aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Pages: [1] 2 3

Author Topic: amuled crashes after short time on Mac OS X  (Read 12126 times)

HipHopPunkSuperStar

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 31
amuled crashes after short time on Mac OS X
« on: January 19, 2005, 05:17:38 PM »

Okay, I tried running amuled under Mac OS X several times now, but it keeps crashing after 20-30 minutes, I've tried the rc8 version, yesterdays and todays cvs always the same.

I hope I can help your development efforts by posting the backtraces here:

Okay, here we go:

This comes from rc8:
crash:
Code: [Select]
Program received signal EXC_BAD_ACCESS, Could not access memory.
[Switching to process 8946 thread 0x2e03]
0x0164eb34 in wxSocketBase::_Wait(long, long, int) ()
bt
Code: [Select]
(gdb) bt
#0  0x0164eb34 in wxSocketBase::_Wait(long, long, int) ()
#1  0x000116a4 in CSocketGlobalThread::Entry() (this=0x4d0e268) at ListenSocket.cpp:2567
#2  0x02269888 in wxThreadInternal::MacThreadStart(void*) ()
#3  0x902c6d88 in PrivateMPEntryPoint ()
#4  0x900246e8 in _pthread_body ()
bt full
Code: [Select]
(gdb) bt full
#0  0x0164eb34 in wxSocketBase::_Wait(long, long, int) ()
No symbol table info available.
#1  0x000116a4 in CSocketGlobalThread::Entry() (this=0x4d0e268) at ListenSocket.cpp:2567
        cur_sock = (CClientReqSocket *) 0x240f220
        it =
        locker = {
  m_isOk = true,
  m_mutex = @0x240e8a0
}
#2  0x02269888 in wxThreadInternal::MacThreadStart(void*) ()
No symbol table info available.
#3  0x902c6d88 in PrivateMPEntryPoint ()
No symbol table info available.
#4  0x900246e8 in _pthread_body ()
No symbol table info available.

This comes from yesterdays cvs:
crash
Code: [Select]
Program received signal EXC_BAD_INSTRUCTION, Illegal instruction/operand.
[Switching to process 7676 thread 0x2ddf]
0x00001994 in ?? ()
bt
Code: [Select]
(gdb) bt
#0  0x00001994 in ?? ()
#1  0x00001994 in ?? ()
#2  0x0165a384 in wxSocketBase::Read(void*, unsigned) ()
#3  0x00013bb4 in ECSocket::ReadBuffer(wxSocketBase*, void*, unsigned) (this=0x240e8e0, sock=0x4d3c6c0, buffer=0xf058ac78, len=1) at ECSocket.cpp:136
#4  0x00013a6c in ECSocket::ReadNumber(wxSocketBase*, void*, unsigned) (this=0x240e8e0, sock=0x4d3c6c0, buffer=0xf058ac78, len=1) at ECSocket.cpp:92
#5  0x00013f58 in ECSocket::ReadFlags(wxSocketBase*) (this=0x240e8e0, sock=0x4d3c6c0) at ECSocket.cpp:212
#6  0x00013ffc in ECSocket::ReadPacket(wxSocketBase*) (this=0x240e8e0, sock=0x4d3c6c0) at ECSocket.cpp:234
#7  0x0004db40 in ExternalConnClientThread::Entry() (this=0x4d11980) at ExternalConn.cpp:1608
#8  0x02269888 in wxThreadInternal::MacThreadStart(void*) ()
#9  0x902c6d88 in PrivateMPEntryPoint ()
#10 0x900246e8 in _pthread_body ()
bt full
Code: [Select]
(gdb) bt full
#0  0x00001994 in ?? ()
No symbol table info available.
#1  0x00001994 in ?? ()
No symbol table info available.
#2  0x0165a384 in wxSocketBase::Read(void*, unsigned) ()
No symbol table info available.
#3  0x00013bb4 in ECSocket::ReadBuffer(wxSocketBase*, void*, unsigned) (this=0x240e8e0, sock=0x4d3c6c0, buffer=0xf058ac78, len=1) at ECSocket.cpp:136
        msgRemain = 1
        LastIO = 0
        iobuf = 0xf058ac78 ""
        error = false
#4  0x00013a6c in ECSocket::ReadNumber(wxSocketBase*, void*, unsigned) (this=0x240e8e0, sock=0x4d3c6c0, buffer=0xf058ac78, len=1) at ECSocket.cpp:92
No locals.
#5  0x00013f58 in ECSocket::ReadFlags(wxSocketBase*) (this=0x240e8e0, sock=0x4d3c6c0) at ECSocket.cpp:212
        i = 0
        flags = 0
        b = 0 '\0'
#6  0x00013ffc in ECSocket::ReadPacket(wxSocketBase*) (this=0x240e8e0, sock=0x4d3c6c0) at ECSocket.cpp:234
        flags = 4032343504
        p = (CECPacket *) 0x0
#7  0x0004db40 in ExternalConnClientThread::Entry() (this=0x4d11980) at ExternalConn.cpp:1608
        request = (CECPacket *) 0xf058ad90
        response = (CECPacket *) 0x0
#8  0x02269888 in wxThreadInternal::MacThreadStart(void*) ()
No symbol table info available.
#9  0x902c6d88 in PrivateMPEntryPoint ()
No symbol table info available.
#10 0x900246e8 in _pthread_body ()
No symbol table info available.

And todays cvs:
crash
Code: [Select]
Program received signal EXC_BAD_ACCESS, Could not access memory.
[Switching to process 20343 thread 0x2e03]
0x0165ab34 in wxSocketBase::_Wait(long, long, int) ()
bt
Code: [Select]
bt
#0  0x0165ab34 in wxSocketBase::_Wait(long, long, int) ()
#1  0x000121bc in CSocketGlobalThread::Entry() (this=0x4d1a608) at ListenSocket.cpp:2583
#2  0x02269ef4 in wxThreadInternal::MacThreadStart(void*) ()
#3  0x902c6d88 in PrivateMPEntryPoint ()
#4  0x900246e8 in _pthread_body ()
bt full
Code: [Select]
bt full
#0  0x0165ab34 in wxSocketBase::_Wait(long, long, int) ()
No symbol table info available.
#1  0x000121bc in CSocketGlobalThread::Entry() (this=0x4d1a608) at ListenSocket.cpp:2583
        cur_sock = (CClientReqSocket *) 0x4de36c0
        it =
        locker = {
  m_isOk = true,
  m_mutex = @0x240e894
}
#2  0x02269ef4 in wxThreadInternal::MacThreadStart(void*) ()
No symbol table info available.
#3  0x902c6d88 in PrivateMPEntryPoint ()
No symbol table info available.
#4  0x900246e8 in _pthread_body ()
No symbol table info available.

Hope that helps you guys keeping up the great work...
Let me know if I can do more...
Logged

ken

  • Hero Member
  • *****
  • Karma: 4
  • Offline Offline
  • Posts: 825
Re: amuled crashes after short time on Mac OS X
« Reply #1 on: January 21, 2005, 09:00:02 AM »

Hi HipHopPunkSuperStar,

Thanks for your reports.  Unfortunately, I'm not seeing what's going wrong.  Not your fault, just not enough info yet.

Could you rebuild wxMac with these additional configure flags:  --enable-debug --enable-debug_gdb

Then, repeat the configure and make steps for aMule.

Hopefully, with these changes your backtraces will have a little extra info that will help us debug this.

Thanks.
Logged

HipHopPunkSuperStar

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 31
Re: amuled crashes after short time on Mac OS X
« Reply #2 on: January 21, 2005, 07:47:26 PM »

Okay, downloaded wxMac again and rebuild everything, but I'm not sure if I'm supposed to somehow report on wxMac, if so, tell me how...

So this first crash happend after clicking on the "Files" link in the webserver, after just a few seconds of running amuled:

Crash:
Code: [Select]
Program received signal SIGPIPE, Broken pipe.
0x90048768 in mach_wait_until ()

bt:
Code: [Select]
(gdb) bt
#0  0x90048768 in mach_wait_until ()
#1  0x902e4ff4 in MPDelayUntil ()
#2  0x02afafd4 in wxThread::Sleep(unsigned long) (milliseconds=100) at ../src/mac/carbon/thread.cpp:1247
#3  0x000a98c0 in CamuleDaemonApp::OnRun() (this=0x240e7b0) at amuled.cpp:150
#4  0x02ab1b14 in wxEntry(int&, char**) (argc=@0xbffffcb8, argv=0xbffffd60) at ../src/common/init.cpp:411
#5  0x000a9588 in main (argc=1, argv=0xbffffd60) at amuled.cpp:128

bt full:
Code: [Select]
#0  0x90048768 in mach_wait_until ()
No symbol table info available.
#1  0x902e4ff4 in MPDelayUntil ()
No symbol table info available.
#2  0x02afafd4 in wxThread::Sleep(unsigned long) (milliseconds=100) at ../src/mac/carbon/thread.cpp:1247
        wakeup = {
  hi = 612,
  lo = 2052917596
}
#3  0x000a98c0 in CamuleDaemonApp::OnRun() (this=0x240e7b0) at amuled.cpp:150
        msRun = 0
        locker = {
  m_isOk = true,
  m_mutex = @0x240e8e0
}
        uLoop = 100
        msWait = 100
#4  0x02ab1b14 in wxEntry(int&, char**) (argc=@0xbffffcb8, argv=0xbffffd60) at ../src/common/init.cpp:411
        callOnExit = {}
        cleanupOnExit = {}
#5  0x000a9588 in main (argc=1, argv=0xbffffd60) at amuled.cpp:128
No locals.

This one happend after like 30 secs to 1min of running amuled, but I'm not aware of doing anything that might have provoked it:
crash:
Code: [Select]
Program received signal SIGPIPE, Broken pipe.
0x90010808 in sendto ()

bt:
Code: [Select]
(gdb) bt
#0  0x90010808 in sendto ()
#1  0x02219860 in GSocket::Send_Stream(char const*, int) (this=0x2793e50, buffer=0x2788070 "?#", size=40) at ../src/unix/gsocket.cpp:1312
#2  0x0221886c in GSocket::Write(char const*, int) (this=0x2793e50, buffer=0x2788070 "?#", size=40) at ../src/unix/gsocket.cpp:865
#3  0x02213928 in wxSocketBase::_Write(void const*, unsigned) (this=0x2793570, buffer=0x2788070, nbytes=40) at ../src/common/socket.cpp:541
#4  0x02213808 in wxSocketBase::Write(void const*, unsigned) (this=0x2793570, buffer=0x2788070, nbytes=40) at ../src/common/socket.cpp:509
#5  0x00018dfc in CEMSocket::Send(char*, int, int) (this=0x2793570, lpBuf=0x2788070 "?#", nBufLen=40) at EMSocket.cpp:396
#6  0x00018838 in CEMSocket::SendPacket(Packet*, bool, bool) (this=0x2793570, packet=0x279c310, delpacket=true, controlpacket=true) at EMSocket.cpp:320
#7  0x00025a70 in CUpDownClient::SendPacket(Packet*, bool, bool) (this=0x2796c50, packet=0x279c310, delpacket=true, controlpacket=true) at BaseClient.cpp:2075
#8  0x00035604 in CUpDownClient::SendFileRequest() (this=0x2796c50) at DownloadClient.cpp:246
#9  0x000217bc in CUpDownClient::ConnectionEstablished() (this=0x2796c50) at BaseClient.cpp:1387
#10 0x00021178 in CUpDownClient::TryToConnect(bool) (this=0x2796c50, bIgnoreMaxCon=false) at BaseClient.cpp:1303
#11 0x00035044 in CUpDownClient::AskForDownload() (this=0x2796c50) at DownloadClient.cpp:151
#12 0x0006e450 in CPartFile::Process(unsigned, unsigned char) (this=0x383fa00, reducedownload=0, m_icounter=10 '\n') at PartFile.cpp:1707
#13 0x0003ca80 in CDownloadQueue::Process() (this=0x272c900) at DownloadQueue.cpp:378
#14 0x000a7e9c in CamuleApp::OnCoreTimer(wxEvent&) (this=0x240e7b0) at amule.cpp:1378
#15 0x000a98f4 in CamuleDaemonApp::OnRun() (this=0x240e7b0) at amuled.cpp:156
#16 0x02ab1b14 in wxEntry(int&, char**) (argc=@0xbffffcb8, argv=0xbffffd60) at ../src/common/init.cpp:411
#17 0x000a9588 in main (argc=1, argv=0xbffffd60) at amuled.cpp:128

bt full:
Code: [Select]
(gdb) bt full
#0  0x90010808 in sendto ()
No symbol table info available.
#1  0x02219860 in GSocket::Send_Stream(char const*, int) (this=0x2793e50, buffer=0x2788070 "?#", size=40) at ../src/unix/gsocket.cpp:1312
        old_handler = (void (*)(void)) 0x1
        ret = 41512672
#2  0x0221886c in GSocket::Write(char const*, int) (this=0x2793e50, buffer=0x2788070 "?#", size=40) at ../src/unix/gsocket.cpp:865
        ret = -1073745408
#3  0x02213928 in wxSocketBase::_Write(void const*, unsigned) (this=0x2793570, buffer=0x2788070, nbytes=40) at ../src/common/socket.cpp:541
        total = 0
        ret = 41451632
#4  0x02213808 in wxSocketBase::Write(void const*, unsigned) (this=0x2793570, buffer=0x2788070, nbytes=40) at ../src/common/socket.cpp:509
No locals.
#5  0x00018dfc in CEMSocket::Send(char*, int, int) (this=0x2793570, lpBuf=0x2788070 "?#", nBufLen=40) at EMSocket.cpp:396
        tosend = 40
        result = 41451632
#6  0x00018838 in CEMSocket::SendPacket(Packet*, bool, bool) (this=0x2793570, packet=0x279c310, delpacket=true, controlpacket=true) at EMSocket.cpp:320
        bCheckControlQueue = false
#7  0x00025a70 in CUpDownClient::SendPacket(Packet*, bool, bool) (this=0x2796c50, packet=0x279c310, delpacket=true, controlpacket=true) at BaseClient.cpp:2075
No locals.
#8  0x00035604 in CUpDownClient::SendFileRequest() (this=0x2796c50) at DownloadClient.cpp:246
        packet = (Packet *) 0x279c310
        dataFileReq = {
  = {
    = {
      _vptr$CFile = 0x272f68,
      m_fd = -1,
      m_error = false,
      fFilePath = {
        = {
          static npos = 4294967295,
          m_pchData = 0x2b74df4 ""
        }, }
    },
    members of CMemFile:
    m_GrowBytes = 32,
    m_position = 0,
    m_BufferSize = 0,
    m_FileSize = 0,
    m_delete = false,
    m_buffer = 0x0
  },
  = {
    _vptr$CFileDataIO = 0x272fdc
  }, }
#9  0x000217bc in CUpDownClient::ConnectionEstablished() (this=0x2796c50) at BaseClient.cpp:1387
        e = {
  = {
    = {
      _vptr$wxObject = 0xbffff5b0,
      static ms_classInfo = {
        m_className = 0x2b1a2c4 "wxObject",
        m_objectSize = 8,
        m_objectConstructor = 0,
        m_baseInfo1 = 0x0,
        m_baseInfo2 = 0x0,
        static sm_first = 0x223a264,
        m_next = 0x2b93a98,
        static sm_classTable = 0x240c9d0
      },
      m_refData = 0x273c4c0
    },
    members of wxEvent:
    m_eventObject = 0xbffff670,
    m_eventType = 0,
    m_timeStamp = 10000,
    m_id = 800,
    m_callbackUserData = 0x6,
    m_propagationLevel = 914745753,
    m_skipped = 3221222832,
    m_isCommandEvent = false,
    static ms_classInfo = {
      m_className = 0x2b1d080 "wxEvent",
      m_objectSize = 40,
      m_objectConstructor = 0,
      m_baseInfo1 = 0x2b93acc,
      m_baseInfo2 = 0x0,
      static sm_first = 0x223a264,
      m_next = 0x2b93cd0,
      static sm_classTable = 0x240c9d0
    }
  },
  members of GUIEvent:
  ID = 3221222752,
  byte_value = 0 '\0',
  short_value = 5220,
  long_value = 3221222832,
  longlong_value = 1234776,
  string_value = {
    = {
      static npos = 4294967295,
      m_pchData = 0x12e1e0 "\177?\002?\220~"
    }, },
  ptr_value = 0xbffff5d0,
  ptr_aux_value = 0x0
}
        packet = (Packet *) 0xbffff620
        packet = (Packet *) 0xbffff620
#10 0x00021178 in CUpDownClient::TryToConnect(bool) (this=0x2796c50, bIgnoreMaxCon=false) at BaseClient.cpp:1303
        data = {
  = {
    = {
      _vptr$CFile = 0x0,
      m_fd = -1,
      m_error = false,
      fFilePath = {
        = {
          static npos = 4294967295,
          m_pchData = 0x0
        }, }
    },
    members of CMemFile:
    m_GrowBytes = 0,
    m_position = 10,
    m_BufferSize = 0,
    m_FileSize = 0,
    m_delete = 45567476,
    m_buffer = 0x2796c50 "\002y?@"
  },
  = {
    _vptr$CFileDataIO = 0x0
  }, }
        packet = (Packet *) 0x2b885b8
        tmp = {
  = {
    = {
      = {
        = {
          _vptr$wxObject = 0x2b885b8,
          static ms_classInfo = {
            m_className = 0x2b1a2c4 "wxObject",
            m_objectSize = 8,
            m_objectConstructor = 0,
            m_baseInfo1 = 0x0,
            m_baseInfo2 = 0x0,
            static sm_first = 0x223a264,
            m_next = 0x2b93a98,
            static sm_classTable = 0x240c9d0
          },
          m_refData = 0x0
        },
        members of wxSockAddress:
        static ms_classInfo = {
          m_className = 0x2222b2c "wxSockAddress",
          m_objectSize = 12,
          m_objectConstructor = 0,
          m_baseInfo1 = 0x2b93acc,
          m_baseInfo2 = 0x0,
          static sm_first = 0x223a264,
          m_next = 0x223a034,
          static sm_classTable = 0x240c9d0
        },
        m_address = 0x0
      },
      members of wxIPaddress:
      static ms_classInfo = {
        m_className = 0x2222b3c "wxIPaddress",
        m_objectSize = 12,
        m_objectConstructor = 0,
        m_baseInfo1 = 0x223a04c,
        m_baseInfo2 = 0x0,
        static sm_first = 0x223a264,
        m_next = 0x223a04c,
        static sm_classTable = 0x240c9d0
      }
    },
    members of wxIPV4address:
    static ms_classInfo = {
      m_className = 0x2222b48 "wxIPV4address",
      m_objectSize = 16,
      m_objectConstructor = 0x220db50 ,
      m_baseInfo1 = 0x223a064,
      m_baseInfo2 = 0x0,
      static sm_first = 0x223a264,
      m_next = 0x223a064,
      static sm_classTable = 0x240c9d0
    },
    m_origHostname = {
      = {
        static npos = 4294967295,
        m_pchData = 0x2710 "}\210\002?=\214"
      }, }
  }, }
#11 0x00035044 in CUpDownClient::AskForDownload() (this=0x2796c50) at DownloadClient.cpp:151
No locals.
#12 0x0006e450 in CPartFile::Process(unsigned, unsigned char) (this=0x383fa00, reducedownload=0, m_icounter=10 '\n') at PartFile.cpp:1707
        download_state = 11 '\v'
        it =
        cur_src = (CUpDownClient *) 0x2796c50
        old_trans = 0
        dwCurTick = 2526484452
#13 0x0003ca80 in CDownloadQueue::Process() (this=0x272c900) at DownloadQueue.cpp:378
        cur_file = (CPartFile *) 0x383fa00
        i = 3
        size = 7
        downspeed = 0
#14 0x000a7e9c in CamuleApp::OnCoreTimer(wxEvent&) (this=0x240e7b0) at amule.cpp:1378
        msPrev1 = 97269
        msPrev5 = 95957
        msPrevSave = 60003
        msCur = 97561
#15 0x000a98f4 in CamuleDaemonApp::OnRun() (this=0x240e7b0) at amuled.cpp:156
        msRun = 2526484396
        locker = {
  m_isOk = true,
  m_mutex = @0x240e8e0
}
        uLoop = 100
        msWait = 100
#16 0x02ab1b14 in wxEntry(int&, char**) (argc=@0xbffffcb8, argv=0xbffffd60) at ../src/common/init.cpp:411
        callOnExit = {}
        cleanupOnExit = {}
#17 0x000a9588 in main (argc=1, argv=0xbffffd60) at amuled.cpp:128
No locals.

Ah, this all happens with rc8 as todays cvs woun't compile on my mac...
Logged

ken

  • Hero Member
  • *****
  • Karma: 4
  • Offline Offline
  • Posts: 825
Re: amuled crashes after short time on Mac OS X
« Reply #3 on: January 23, 2005, 11:36:53 PM »

Quote
Originally posted by HipHopPunkSuperStar
Okay, downloaded wxMac again and rebuild everything, but I'm not sure if I'm supposed to somehow report on wxMac, if so, tell me how...
OK, thanks for doing all that.  You didn't necessarily need to download it again.  I meant to just have you rebuild it with additional configure flags.  But you didn't harm anything.

Also, I didn't mean to suggest that the bug is in wxMac, just that running amuled with a version of wxMac that has debugging information enabled could help us locate the bug in amuled.  So, no reason yet to report anything to wxMac devs.

Quote
So this first crash happend after clicking on the "Files" link in the webserver, after just a few seconds of running amuled:

Crash:
Code: [Select]
Program received signal SIGPIPE, Broken pipe.
0x90048768 in mach_wait_until ()
[other backtraces snipped]

These aren't actually crashes.  By default, gdb stops the execution of the program whenever the program receives a signal.  Some signals (e.g. EXC_BAD_ACCESS or SIGSEGV) are the sort of thing which would crash amuled if gdb had allowed the signal to pass.  Others (e.g. SIGPIPE) are benign and amuled can cope with them if gdb allows them to pass.  The way to tell gdb to let this benign signal pass through to the program is to issue this command to gdb before running the program:

handle SIGPIPE nostop noprint pass

Since you'll want gdb to execute this command every time you use it, you can put it into the file ~/.gdbinit and it will be executed automatically whenever you run gdb.

(Just so you know, if you had told gdb to continue after getting these "crashes", you would have seen that amuled would happily go about its business.)
Logged

ken

  • Hero Member
  • *****
  • Karma: 4
  • Offline Offline
  • Posts: 825
Re: amuled crashes after short time on Mac OS X
« Reply #4 on: January 23, 2005, 11:50:39 PM »

I have another suggestion to try, as well.  I'm pretty sure from your previous backtraces that the crash is the result of an object being freed and then being used after it is gone.  Here's an additional command to issue to gdb before running amuled:
Code: [Select]
set env MallocScribble 1This will cause freed memory to be overwritten with 0x55555555, so that if something continues to use it after it's freed, it will likely fail immediately (as opposed to stumbling along seemingly successfully for a while out of sheer dumb luck).

Unlike my previous post, this command is not something that should go into ~/.gdbinit.  Just manually enter it each time you run amuled from gdb, until we figure out the cause of your crashes.
Logged

HipHopPunkSuperStar

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 31
Re: amuled crashes after short time on Mac OS X
« Reply #5 on: January 24, 2005, 02:48:14 PM »

Okay, seems like I forgot to create the .gdbinit file when I changed computers...

Now here comes a new crash with the lines from the wiki and the one above in the .gdbinit.
For the last hint, I used the "set env MallocScribble 1 " command from within gdb after initializing it with the
Code: [Select]
$gdb /Path/to/amuled command. I hope this was correct.

Now here we go with the crash:
Code: [Select]
Program received signal EXC_BAD_ACCESS, Could not access memory.
[Switching to process 1448 thread 0x3003]
0x02213e14 in wxSocketBase::_Wait(long, long, int) (this=???, seconds=???, milliseconds=???, flags=???) at ../src/common/socket.cpp:719
719         result = m_socket->Select(flags | GSOCK_LOST_FLAG);

bt
Code: [Select]
(gdb) bt
#0  0x02213e14 in wxSocketBase::_Wait(long, long, int) (this=???, seconds=???, milliseconds=???, flags=???) at ../src/common/socket.cpp:719
#1  0x02215328 in wxSocketClient::WaitOnConnect(long, long) (this=0x2760ed0, seconds=0, milliseconds=0) at ../src/common/socket.cpp:1252
#2  0x00011d60 in CSocketGlobalThread::Entry() (this=0x273e0b8) at ListenSocket.cpp:2559
#3  0x02afa7f4 in wxThreadInternal::MacThreadStart(void*) (parameter=0x273e0b8) at ../src/mac/carbon/thread.cpp:1042
#4  0x902c6d88 in PrivateMPEntryPoint ()
#5  0x900246e8 in _pthread_body ()

bt full
Code: [Select]
bt full
#0  0x02213e14 in wxSocketBase::_Wait(long, long, int) (this=???, seconds=???, milliseconds=???, flags=???) at ../src/common/socket.cpp:719
        result = Cannot access memory at address 0x40
Logged

HipHopPunkSuperStar

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 31
Re: amuled crashes after short time on Mac OS X
« Reply #6 on: January 24, 2005, 03:18:14 PM »

And anotherone:
Crash:
Code: [Select]
rogram received signal EXC_BAD_ACCESS, Could not access memory.
[Switching to process 1473 thread 0x3103]
0x02213e14 in wxSocketBase::_Wait(long, long, int) (this=???, seconds=???, milliseconds=???, flags=???) at ../src/common/socket.cpp:719
719         result = m_socket->Select(flags | GSOCK_LOST_FLAG);

bt:
Code: [Select]
(gdb) bt
#0  0x02213e14 in wxSocketBase::_Wait(long, long, int) (this=???, seconds=???, milliseconds=???, flags=???) at ../src/common/socket.cpp:719
#1  0x02215328 in wxSocketClient::WaitOnConnect(long, long) (this=0x275ae40, seconds=0, milliseconds=0) at ../src/common/socket.cpp:1252
#2  0x00011d60 in CSocketGlobalThread::Entry() (this=0x27407b8) at ListenSocket.cpp:2559
#3  0x02afa7f4 in wxThreadInternal::MacThreadStart(void*) (parameter=0x27407b8) at ../src/mac/carbon/thread.cpp:1042
#4  0x902c6d88 in PrivateMPEntryPoint ()
#5  0x900246e8 in _pthread_body ()

bt full
Code: [Select]
(gdb) bt full
#0  0x02213e14 in wxSocketBase::_Wait(long, long, int) (this=???, seconds=???, milliseconds=???, flags=???) at ../src/common/socket.cpp:719
        result = Cannot access memory at address 0x40

Seems to be the same...
Logged

stefanero

  • Some Support
  • Developer
  • Hero Member
  • *****
  • Karma: 8
  • Offline Offline
  • Posts: 4235
Re: amuled crashes after short time on Mac OS X
« Reply #7 on: January 24, 2005, 07:42:29 PM »

how much max connections do you have in prefs?
and there is at least under linux a bug in udp socket, so you could try to disable it in prefs and see if it runs better then.

with max connections < 1024 and udp sockt disabled runs fine here for about 22h till i shut it down.

so maybe you can try that
stefanero
Logged
In its default setup, Windows XP on the Internet amounts to a car
parked in a bad part of town, with the doors unlocked, the key in
the ignition and a Post-It note on the dashboard saying, "Please
don't steal this."

ken

  • Hero Member
  • *****
  • Karma: 4
  • Offline Offline
  • Posts: 825
Re: amuled crashes after short time on Mac OS X
« Reply #8 on: January 25, 2005, 01:34:26 AM »

Well, HipHopPunkSuperStar, thanks to your persistence (Thanks!), we now have complete information on where this crash is happening, but I'm afraid I still don't know why.  Hopefully, one of the other developers will have an insight.

If stefanero's suggestions help, let us know.  Of course, we would like to figure out the reason for this crash.

You're having this problem with amuled.  Does amule itself (aMule.app) work for you?

Also, do you have a dual-processor Mac?  I don't know if it matters, just stabbing in the dark.
Logged

HipHopPunkSuperStar

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 31
Re: amuled crashes after short time on Mac OS X
« Reply #9 on: January 25, 2005, 02:08:47 AM »

I'll try stefanero's tip tomorrow and let you know (hopefully till then bittorrent is ready and I got my powerbook running Debian, right now I can't check 'cause bt and the debian installation is taking up all my bandwith...)

aMule.app works for me, but it's SLOW, (I know about the "limitations" of the ED2K network, the credits and stuff) and it seemed to me that especialy Mac Users are having this problem of slowness but no one had tried amuled, so I thought maybe I could solve the problem using amuled, and actualy it *seems* to be faster, although I can't confirm it cause it crashes after max. 30 minutes.. While it's running it *seems* to download faster than aMule.app, at least it stays above 1,8 K for more than a couple of seconds what never happens with aMule.app ...

For the system I'm running, probably I should have told you before, the first post I made to this thread and the crashes and backtraces were from a G4 TiBook 667MHz, all the others from my new 2x2GHz G5 :-)

(as I said before, I'm currently installing debian on mi TiBook so I might be able to give you some info on the differences of aMule & amuled between Linux & Mac aswell, I would only need someone to tell me where this eMule-file which I suppose stores the credits is located on my mac as I still haven't found it to copy it between the two systems.)
Logged

phoenix

  • Evil respawning bird from aMule Dev Team
  • Developer
  • Hero Member
  • *****
  • Karma: 44
  • Offline Offline
  • Posts: 2503
  • The last shadow you'll ever see
RE: amuled crashes after short time on Mac OS X
« Reply #10 on: January 25, 2005, 03:04:22 AM »

Quote
Originally posted by HipHopPunkSuperStar
Code: [Select]
Program received signal [b]EXC_BAD_INSTRUCTION[/b], Illegal instruction/operand.
[Switching to process 7676 thread 0x2ddf]
0x00001994 in ?? ()

Oh-oh, I would say that either this is a corrupt executable or a failing RAM module. :(

If the problem is just with aMule, I would stick to the first option.

Quote
Originally posted by HipHopPunkSuperStar
Program received signal EXC_BAD_ACCESS, Could not access memory.
[Switching to process 1448 thread 0x3003]
0x02213e14 in wxSocketBase::_Wait(long, long, int) (this=???, seconds=???, milliseconds=???, flags=???) at ../src/common/socket.cpp:719
719         result = m_socket->Select(flags | GSOCK_LOST_FLAG);

(gdb) bt full
#0  0x02213e14 in wxSocketBase::_Wait(long, long, int) (this=???, seconds=???, milliseconds=???, flags=???) at ../src/common/socket.cpp:719
        result = Cannot access memory at address 0x40

Now, this one seems consistent and reproducible, could be a wxBUG. ;) But I don't think so. Looks like m_socket == 0x40, and that indicates either memory corruption or a previously deleted socket. More probable is memory corruption, because since the times of RSB (random socket bug) we always set the socket to NULL after deletion, so we would probably not get to this point of the code. Either way, we won't find the error on these lines.

maybe try:
(gdb) frame 1
(gdb) p *this

So that we can have a look at this :P

I think it is strange that this has not been reported on other platforms.
Any new information, please report. Thanks for your help!
Logged

lfroen

  • Guest
Re: amuled crashes after short time on Mac OS X
« Reply #11 on: January 25, 2005, 06:48:21 AM »

I amuled limit to number of connection must be set to 1000. If not - segfaults in wx socket code are guarantied. We should include this in preferences.
Logged

ken

  • Hero Member
  • *****
  • Karma: 4
  • Offline Offline
  • Posts: 825
Re: amuled crashes after short time on Mac OS X
« Reply #12 on: January 25, 2005, 08:03:59 AM »

phoenix, I agree, it presents very much as memory corruption, except that it's remarkably consistent in where it crashes.

Actually, now that I think about it, I bet stefanero and lfroen are correct.  HipHop may have a m_socket->m_fd greater than FD_SETSIZE (1024).  So, the call to Select uses FD_SET which is writing out of bounds, overwriting the stack and garbling the backtrace, as seen.  If it's not the FD_SET, then the select(m_fd + 1, &readfds, &writefds, &exceptfds, &tv) will memset readfds, writefds, and exceptfds out to the location where m_fd would be if they were large enough.

HipHop, doing what phoenix suggested (frame 1, print *this) when amuled crashes will confirm this theory.  (By the way, I'm envious of your G5. :) )

The two places that aMule data is stored on Mac OS X are ~/.aMule directory (just like other platforms) and "~/Library/Preferences/eMule Preferences" which is the same as ~/.eMule file for other platforms.  However, this file ("eMule Preferences" AKA .eMule) doesn't store your credits.  Your credits are stored on the computers of the clients with whom you've earned them.  To "redeem" them, you need to keep your userhash which is in your .aMule directory (preferences.dat and cryptkey.dat).  The credits that others have earned with you are in the clients.met, also in .aMule.  Anyway, copying ~/.aMule and the prefs file to another system is how you move an aMule configuration.  However, don't run two aMule clients with the same userhash simultaneously.  I think you can get banned that way.
Logged

phoenix

  • Evil respawning bird from aMule Dev Team
  • Developer
  • Hero Member
  • *****
  • Karma: 44
  • Offline Offline
  • Posts: 2503
  • The last shadow you'll ever see
Re: amuled crashes after short time on Mac OS X
« Reply #13 on: January 25, 2005, 10:22:56 AM »

Quote
Originally posted by ken
phoenix, I agree, it presents very much as memory corruption, except that it's remarkably consistent in where it crashes.
Yeah, I agree too.

Quote
Originally posted by ken
Actually, now that I think about it, I bet stefanero and lfroen are correct.  HipHop may have a m_socket->m_fd greater than FD_SETSIZE (1024).  So, the call to Select uses FD_SET which is writing out of bounds, overwriting the stack and garbling the backtrace, as seen.  If it's not the FD_SET, then the select(m_fd + 1, &readfds, &writefds, &exceptfds, &tv) will memset readfds, writefds, and exceptfds out to the location where m_fd would be if they were large enough.
Then we need to do:
(gdb) p *m_socket

The message about 0x40 is from gdb, my guess is that m_socket is 0x40, but who knows... If that is the case, then it is most likely memory corruption.

Cheers!
Logged

HipHopPunkSuperStar

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 31
Re: amuled crashes after short time on Mac OS X
« Reply #14 on: January 25, 2005, 11:28:14 AM »

Okay, I disabled the UDP-Port, Max Connections is set to 500 (I think I never touched this...)
Anyway I got two crashs pretty soon after launching amuled so here we go:

Crash
Code: [Select]
Program received signal EXC_BAD_ACCESS, Could not access memory.
[Switching to process 531 thread 0x2e03]
0x02213e14 in wxSocketBase::_Wait(long, long, int) (this=???, seconds=???, milliseconds=???, flags=???) at ../src/common/socket.cpp:719
719         result = m_socket->Select(flags | GSOCK_LOST_FLAG);

bt
Code: [Select]
(gdb) bt
#0  0x02213e14 in wxSocketBase::_Wait(long, long, int) (this=???, seconds=???, milliseconds=???, flags=???) at ../src/common/socket.cpp:719
#1  0x02214084 in wxSocketBase::WaitForLost(long, long) (this=0x27bc9b0, seconds=0, milliseconds=0) at ../src/common/socket.cpp:784
#2  0x00011db8 in CSocketGlobalThread::Entry() (this=0x2741b38) at ListenSocket.cpp:2567
#3  0x02afa7f4 in wxThreadInternal::MacThreadStart(void*) (parameter=0x2741b38) at ../src/mac/carbon/thread.cpp:1042
#4  0x902c6d88 in PrivateMPEntryPoint ()
#5  0x900246e8 in _pthread_body ()

bt full
Code: [Select]
(gdb) bt full
#0  0x02213e14 in wxSocketBase::_Wait(long, long, int) (this=???, seconds=???, milliseconds=???, flags=???) at ../src/common/socket.cpp:719
        result = Cannot access memory at address 0x40

frame 1
Code: [Select]
(gdb) frame 1
#1  0x02214084 in wxSocketBase::WaitForLost(long, long) (this=0x27bc9b0, seconds=0, milliseconds=0) at ../src/common/socket.cpp:784
784       return _Wait(seconds, milliseconds, GSOCK_LOST_FLAG);

p *this
Code: [Select]
(gdb) p *this
$1 = {
  = {
    _vptr$wxObject = 0x26fa98,
    static ms_classInfo = {
      m_className = 0x2b1a2c4 "wxObject",
      m_objectSize = 8,
      m_objectConstructor = 0,
      m_baseInfo1 = 0x0,
      m_baseInfo2 = 0x0,
      static sm_first = 0x223a264,
      m_next = 0x2b93a98,
      static sm_classTable = 0x240c9d0
    },
    m_refData = 0x0
  },
  members of wxSocketBase:
  static ms_classInfo = {
    m_className = 0x2222e1c "wxSocketBase",
    m_objectSize = 120,
    m_objectConstructor = 0,
    m_baseInfo1 = 0x2b93acc,
    m_baseInfo2 = 0x0,
    static sm_first = 0x223a264,
    m_next = 0x223a18c,
    static sm_classTable = 0x240c9d0
  },
  m_socket = 0x27505d0,
  m_type = wxSOCKET_BASE,
  m_flags = 1,
  m_connected = true,
  m_establishing = false,
  m_reading = false,
  m_writing = false,
  m_error = false,
  m_lasterror = 1431655765,
  m_lcount = 0,
  m_timeout = 600,
  m_states = {
    = {
      = {
        = {
          _vptr$wxObject = 0x2b88380,
          static ms_classInfo = {
            m_className = 0x2b1a2c4 "wxObject",
            m_objectSize = 8,
            m_objectConstructor = 0,
            m_baseInfo1 = 0x0,
            m_baseInfo2 = 0x0,
            static sm_first = 0x223a264,
            m_next = 0x2b93a98,
            static sm_classTable = 0x240c9d0
          },
          m_refData = 0x0
        },
        members of wxListBase:
        m_count = 0,
        m_destroy = false,
        m_nodeFirst = 0x0,
        m_nodeLast = 0x0,
        m_keyType = wxKEY_NONE
      }, },
    members of wxList:
    static ms_classInfo = {
      m_className = 0x2b19d9c "wxList",
      m_objectSize = 28,
      m_objectConstructor = 0x2abe254 ,
      m_baseInfo1 = 0x2b93acc,
      m_baseInfo2 = 0x0,
      static sm_first = 0x223a264,
      m_next = 0x2b93a20,
      static sm_classTable = 0x240c9d0
    }
  },
  m_interrupt = false,
  m_beingDeleted = false,
  m_unread = 0x0,
  m_unrd_size = 0,
  m_unrd_cur = 0,
  m_id = -1,
  m_handler = 0x0,
  m_clientData = 0x0,
  m_notify = false,
  m_eventmask = 0,
  static m_countInit = 1
}

p *m_socket
Code: [Select]
(gdb) p *m_socket
$2 = {
  _vptr$GSocket = 0x2239660,
  m_ok = true,
  m_fd = 1344,
  m_local = 0x0,
  m_peer = 0x27aa5c0,
  m_error = GSOCK_NOERROR,
  m_non_blocking = false,
  m_server = false,
  m_stream = true,
  m_establishing = false,
  m_reusable = false,
  m_timeout = 0,
  m_detected = 8,
  m_cbacks = {0x2214408 , 0x2214408 , 0x2214408 , 0x2214408 },
  m_data = {0x27bc9b0 "", 0x27bc9b0 "", 0x27bc9b0 "", 0x27bc9b0 ""},
  m_gui_dependent = 0x0
}

And another crash, although to me the crash looks pretty much the same, but what do I know about this  ?(

crash
Code: [Select]
Program received signal EXC_BAD_ACCESS, Could not access memory.
[Switching to process 557 thread 0x2f03]
0x02213e14 in wxSocketBase::_Wait(long, long, int) (this=???, seconds=???, milliseconds=???, flags=???) at ../src/common/socket.cpp:719
719         result = m_socket->Select(flags | GSOCK_LOST_FLAG);

bt
Code: [Select]
(gdb) bt
#0  0x02213e14 in wxSocketBase::_Wait(long, long, int) (this=???, seconds=???, milliseconds=???, flags=???) at ../src/common/socket.cpp:719
#1  0x02215328 in wxSocketClient::WaitOnConnect(long, long) (this=0x27591e0, seconds=0, milliseconds=0) at ../src/common/socket.cpp:1252
#2  0x00011d60 in CSocketGlobalThread::Entry() (this=0x2741c38) at ListenSocket.cpp:2559
#3  0x02afa7f4 in wxThreadInternal::MacThreadStart(void*) (parameter=0x2741c38) at ../src/mac/carbon/thread.cpp:1042
#4  0x902c6d88 in PrivateMPEntryPoint ()
#5  0x900246e8 in _pthread_body ()

bt full
Code: [Select]
(gdb) bt full
#0  0x02213e14 in wxSocketBase::_Wait(long, long, int) (this=???, seconds=???, milliseconds=???, flags=???) at ../src/common/socket.cpp:719
        result = Cannot access memory at address 0x40
frame 1
Code: [Select]
(gdb) frame 1
#1  0x02215328 in wxSocketClient::WaitOnConnect(long, long) (this=0x27591e0, seconds=0, milliseconds=0) at ../src/common/socket.cpp:1252
1252      return _Wait(seconds, milliseconds, GSOCK_CONNECTION_FLAG |

p *this
Code: [Select]
(gdb) p *this
$1 = {
  = {
    = {
      _vptr$wxObject = 0x26fa98,
      static ms_classInfo = {
        m_className = 0x2b1a2c4 "wxObject",
        m_objectSize = 8,
        m_objectConstructor = 0,
        m_baseInfo1 = 0x0,
        m_baseInfo2 = 0x0,
        static sm_first = 0x223a264,
        m_next = 0x2b93a98,
        static sm_classTable = 0x240c9d0
      },
      m_refData = 0x0
    },
    members of wxSocketBase:
    static ms_classInfo = {
      m_className = 0x2222e1c "wxSocketBase",
      m_objectSize = 120,
      m_objectConstructor = 0,
      m_baseInfo1 = 0x2b93acc,
      m_baseInfo2 = 0x0,
      static sm_first = 0x223a264,
      m_next = 0x223a18c,
      static sm_classTable = 0x240c9d0
    },
    m_socket = 0x27883a0,
    m_type = wxSOCKET_CLIENT,
    m_flags = 1,
    m_connected = false,
    m_establishing = true,
    m_reading = false,
    m_writing = false,
    m_error = false,
    m_lasterror = 1431655765,
    m_lcount = 0,
    m_timeout = 600,
    m_states = {
      = {
        = {
          = {
            _vptr$wxObject = 0x2b88380,
            static ms_classInfo = {
              m_className = 0x2b1a2c4 "wxObject",
              m_objectSize = 8,
              m_objectConstructor = 0,
              m_baseInfo1 = 0x0,
              m_baseInfo2 = 0x0,
              static sm_first = 0x223a264,
              m_next = 0x2b93a98,
              static sm_classTable = 0x240c9d0
            },
            m_refData = 0x0
          },
          members of wxListBase:
          m_count = 0,
          m_destroy = false,
          m_nodeFirst = 0x0,
          m_nodeLast = 0x0,
          m_keyType = wxKEY_NONE
        }, },
      members of wxList:
      static ms_classInfo = {
        m_className = 0x2b19d9c "wxList",
        m_objectSize = 28,
        m_objectConstructor = 0x2abe254 ,
        m_baseInfo1 = 0x2b93acc,
        m_baseInfo2 = 0x0,
        static sm_first = 0x223a264,
        m_next = 0x2b93a20,
        static sm_classTable = 0x240c9d0
      }
    },
    m_interrupt = false,
    m_beingDeleted = false,
    m_unread = 0x0,
    m_unrd_size = 0,
    m_unrd_cur = 0,
    m_id = -1,
    m_handler = 0x0,
    m_clientData = 0x0,
    m_notify = false,
    m_eventmask = 0,
    static m_countInit = 1
  },
  members of wxSocketClient:
  static ms_classInfo = {
    m_className = 0x2222e3c "wxSocketClient",
    m_objectSize = 120,
    m_objectConstructor = 0,
    m_baseInfo1 = 0x223a1a4,
    m_baseInfo2 = 0x0,
    static sm_first = 0x223a264,
    m_next = 0x223a1bc,
    static sm_classTable = 0x240c9d0
  }
}

p *m_socket
Code: [Select]
(gdb) p *m_socket
$2 = {
  _vptr$GSocket = 0x2239660,
  m_ok = true,
  m_fd = 1345,
  m_local = 0x0,
  m_peer = 0x27589e0,
  m_error = GSOCK_WOULDBLOCK,
  m_non_blocking = false,
  m_server = false,
  m_stream = true,
  m_establishing = false,
  m_reusable = false,
  m_timeout = 0,
  m_detected = 8,
  m_cbacks = {0x2214408 , 0x2214408 , 0x2214408 , 0x2214408 },
  m_data = {0x27591e0 "", 0x27591e0 "", 0x27591e0 "", 0x27591e0 ""},
  m_gui_dependent = 0x0
}

Hope this helps you somehow...
Logged
Pages: [1] 2 3