aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: SVN 10002 crash an 64bit Debian  (Read 6630 times)

Corwin

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 23
SVN 10002 crash an 64bit Debian
« on: February 05, 2010, 07:48:49 AM »

The lastest (maybe 20 revisions) amule has been crashing right away, within a minute or two of the UI coming up.

Code: [Select]
(gdb) bt                                                                                  
#0  0x0000000000473b1a in CUpDownClient::HasValidHash (this=0x0) at updownclient.h:220    
#1  0x00000000005a7ba4 in CServerSocket::ProcessPacket (this=0x7fffe45d0530, packet=0x7fffe461ce00 "\275n\373\323\364D\003;L\262\316b\016\274*\327\021\306 \233\004oz\234e", size=23, opcode=53 '5')
    at ServerSocket.cpp:562                                                                                                                                                                        
#2  0x00000000005a9068 in CServerSocket::PacketReceived (this=0x7fffe45d0530, packet=0x7fffe45faf80) at ServerSocket.cpp:681                                                                        
#3  0x000000000051db17 in CEMSocket::OnReceive (this=0x7fffe45d0530, nErrorCode=0) at EMSocket.cpp:322                                                                                              
#4  0x00000000005a5143 in CServerSocket::OnReceive (this=0x7fffe45d0530, nErrorCode=wxSOCKET_NOERROR) at ServerSocket.cpp:211                                                                      
#5  0x00000000005a4840 in CServerSocketHandler::ServerSocketHandler (this=0xf41980, event=...) at ServerSocket.cpp:99                                                                              
#6  0x00007ffff5c16de0 in wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () from /usr/lib/libwx_baseu-2.8.so.0                                          
#7  0x00007ffff5c17db4 in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) () from /usr/lib/libwx_baseu-2.8.so.0                                                                              
#8  0x00007ffff5c17e97 in wxEvtHandler::ProcessEvent(wxEvent&) () from /usr/lib/libwx_baseu-2.8.so.0                                                                                                
#9  0x00007ffff5c17238 in wxEvtHandler::ProcessPendingEvents() () from /usr/lib/libwx_baseu-2.8.so.0                                                                                                
#10 0x00007ffff5b893c9 in wxAppConsole::ProcessPendingEvents() () from /usr/lib/libwx_baseu-2.8.so.0                                                                                                
#11 0x00007ffff6332e4b in wxAppBase::ProcessIdle() () from /usr/lib/libwx_gtk2u_core-2.8.so.0                                                                                                      
#12 0x00007ffff6297733 in ?? () from /usr/lib/libwx_gtk2u_core-2.8.so.0                                                                                                                            
#13 0x00007ffff284790e in g_main_dispatch (context=0xf8b1d0) at /tmp/buildd/glib2.0-2.22.4/glib/gmain.c:1960                                                                                        
#14 IA__g_main_context_dispatch (context=0xf8b1d0) at /tmp/buildd/glib2.0-2.22.4/glib/gmain.c:2513                                                                                                  
#15 0x00007ffff284b2c8 in g_main_context_iterate (context=0xf8b1d0, block=<value optimized out>, dispatch=<value optimized out>, self=<value optimized out>)                                        
    at /tmp/buildd/glib2.0-2.22.4/glib/gmain.c:2591                                                                                                                                                
#16 0x00007ffff284b725 in IA__g_main_loop_run (loop=0x7fffe42ea8a0) at /tmp/buildd/glib2.0-2.22.4/glib/gmain.c:2799                                                                                
#17 0x00007ffff4721f87 in IA__gtk_main () at /gtk+2.0-2.18.6/gtk/gtkmain.c:1218                                                                                                                    
#18 0x00007ffff62ae718 in wxEventLoop::Run() () from /usr/lib/libwx_gtk2u_core-2.8.so.0                                                                                                            
#19 0x00007ffff6332cdb in wxAppBase::MainLoop() () from /usr/lib/libwx_gtk2u_core-2.8.so.0                                                                                                          
#20 0x00007ffff5bbd65c in wxEntry(int&, wchar_t**) () from /usr/lib/libwx_baseu-2.8.so.0                                                                                                            
#21 0x00000000006795b4 in main (argc=1, argv=0x7fffffffe318) at amule-gui.cpp:94
Logged

Corwin

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 23
Re: SVN 10002 crash an 64bit Debian
« Reply #1 on: February 05, 2010, 07:49:35 AM »

Code: [Select]
                                                                                                                   
(gdb) bt full                                                                                                                                                                                       
#0  0x0000000000473b1a in CUpDownClient::HasValidHash (this=0x0) at updownclient.h:220                                                                                                             
No locals.                                                                                                                                                                                         
#1  0x00000000005a7ba4 in CServerSocket::ProcessPacket (this=0x7fffe45d0530, packet=0x7fffe461ce00 "\275n\373\323\364D\003;L\262\316b\016\274*\327\021\306 \233\004oz\234e", size=23, opcode=53 '5')
    at ServerSocket.cpp:562                                                                                                                                                                         
        data = {<CFileDataIO> = {_vptr.CFileDataIO = 0x8fd9b0}, m_growthRate = 0, m_position = 23, m_BufferSize = 23, m_fileSize = 23, m_delete = false, m_readonly = true,                         
          m_buffer = 0x7fffe461ce00 "\275n\373\323\364D\003;L\262\316b\016\274*\327\021\306 \233\004oz\234e"}                                                                                       
        dwIP = 3556470461                                                                                                                                                                           
        nPort = 17652                                                                                                                                                                               
        achUserHash = {m_hash = ";L\262\316b\016\274*\327\021\306 \233\004oz"}                                                                                                                     
        byCryptOptions = 3 '\003'                                                                                                                                                                   
        client = 0x0                                                                                                                                                                               
#2  0x00000000005a9068 in CServerSocket::PacketReceived (this=0x7fffe45d0530, packet=0x7fffe45faf80) at ServerSocket.cpp:681                                                                       
No locals.                                                                                                                                                                                         
#3  0x000000000051db17 in CEMSocket::OnReceive (this=0x7fffe45d0530, nErrorCode=0) at EMSocket.cpp:322                                                                                             
        bPacketResult = false                                                                                                                                                                       
        toCopy = 23                                                                                                                                                                                 
        ret = 43                                                                                                                                                                                   
        rptr = 0xd58f5d "\343\t"                                                                                                                                                                   
        GlobalReadBuffer = "\343\030\000\000\000\065\275n\373\323\364D\003;L\262\316b\016\274*\327\021\306 \233\004oz\343\t\000\000\000\064\300\334\000\000\341>r\000//emule-project.net\003\001\000\021<\000\000\000\003\001\000\371\237Z\237Z\003\001\000\372\036B\023\064\003\001\000\376\264\000\000\000\003\001\000\373\000\275\000\000\000\000\000\000\000\000\000\000\235^\f\277\356\302\234\024g\341\237t:\016\177\061\210\061 V\274\000\376\270\r\000\000\003\001\000\373\000\305\000\000\002\001\000U\n\000Xtreme 7.2\000\000\000\000\000\000\036\353v\353\314ߗ\366\336\063\315\003\003\002\305w\000\000\000\244\236\377\304\033s\003\377\350Z\200\202n\031\225\357\367\375\177ۏ\001\000\000\000X\262\002\377\337\377\377\377\377\377\377\377\377\337\377\377\377\377\377\375\377\333\377\377\375\376\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\376\377\337\377\357\377\377\377\377\377\377\277\177\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\277\377\377\377\377\377\377\377\277\377\377\377\377\377\003\025\000O\236?Ft\206\354[\245o\023\003\305m\000\000\000\223\236\377\304\033s\003\377\350Z\200\202n\031\225\357\367YA\000Yngwie J. Malmstee"...                         
        readMax = 2000000                                                                                                                                                                               
        rend = 0xd58f6b "//emule-project.net\003\001"                                                                                                                                                   
#4  0x00000000005a5143 in CServerSocket::OnReceive (this=0x7fffe45d0530, nErrorCode=wxSOCKET_NOERROR) at ServerSocket.cpp:211                                                                           
No locals.                                                                                                                                                                                               
#5  0x00000000005a4840 in CServerSocketHandler::ServerSocketHandler (this=0xf41980, event=...) at ServerSocket.cpp:99                                                                                   
        socket = 0x7fffe45d0530                                                                                                                                                                         
#6  0x00007ffff5c16de0 in wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () from /usr/lib/libwx_baseu-2.8.so.0                                               
No symbol table info available.                                                                                                                                                                         
#7  0x00007ffff5c17db4 in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) () from /usr/lib/libwx_baseu-2.8.so.0                                                                                   
No symbol table info available.                                                                                                                                                                         
#8  0x00007ffff5c17e97 in wxEvtHandler::ProcessEvent(wxEvent&) () from /usr/lib/libwx_baseu-2.8.so.0                                                                                                     
No symbol table info available.                                                                                                                                                                         
#9  0x00007ffff5c17238 in wxEvtHandler::ProcessPendingEvents() () from /usr/lib/libwx_baseu-2.8.so.0                                                                                                     
No symbol table info available.                                                                                                                                                                         
#10 0x00007ffff5b893c9 in wxAppConsole::ProcessPendingEvents() () from /usr/lib/libwx_baseu-2.8.so.0                                                                                                     
No symbol table info available.                                                                                                                                                                         
#11 0x00007ffff6332e4b in wxAppBase::ProcessIdle() () from /usr/lib/libwx_gtk2u_core-2.8.so.0                                                                                                           
No symbol table info available.                                                                                                                                                                         
#12 0x00007ffff6297733 in ?? () from /usr/lib/libwx_gtk2u_core-2.8.so.0                                                                                                                                 
No symbol table info available.                                                                                                                                                                         
#13 0x00007ffff284790e in g_main_dispatch (context=0xf8b1d0) at /tmp/buildd/glib2.0-2.22.4/glib/gmain.c:1960                                                                                             
        dispatch = 0x7ffff2845ad0 <g_idle_dispatch>                                                                                                                                                     
        user_data = 0x0                                                                                                                                                                                 
        callback = 0x7ffff6297690                                                                                                                                                                       
        cb_funcs = 0x7ffff2ad0e30                                                                                                                                                                       
        cb_data = 0x7fffe46136b0                                                                                                                                                                         
        current_source_link = {data = 0x7fffe4695050, next = 0x0}                                                                                                                                       
        source = 0x7fffe4695050                                                                                                                                                                         
        current = 0x1d1e780                                                                                                                                                                             
        i = 0                                                                                                                                                                                           
#14 IA__g_main_context_dispatch (context=0xf8b1d0) at /tmp/buildd/glib2.0-2.22.4/glib/gmain.c:2513                                                                                                       
No locals.                                                                                                                                                                                               
#15 0x00007ffff284b2c8 in g_main_context_iterate (context=0xf8b1d0, block=<value optimized out>, dispatch=<value optimized out>, self=<value optimized out>)                                             
---Type <return> to continue, or q <return> to quit---                                                                                                                                                   
    at /tmp/buildd/glib2.0-2.22.4/glib/gmain.c:2591                                                                                                                                                     
        max_priority = 300                                                                                                                                                                               
        timeout = 0                                                                                                                                                                                     
        some_ready = 1                                                                                                                                                                                   
        nfds = 18                                                                                                                                                                                       
        allocated_nfds = -165058128                                                                                                                                                                     
        fds = <value optimized out>                                                                                                                                                                     
        __PRETTY_FUNCTION__ = "g_main_context_iterate"                                                                                                                                                   
#16 0x00007ffff284b725 in IA__g_main_loop_run (loop=0x7fffe42ea8a0) at /tmp/buildd/glib2.0-2.22.4/glib/gmain.c:2799                                                                                     
        self = 0xf8cf90                                                                                                                                                                                 
        __PRETTY_FUNCTION__ = "IA__g_main_loop_run"                                                                                                                                                     
#17 0x00007ffff4721f87 in IA__gtk_main () at /gtk+2.0-2.18.6/gtk/gtkmain.c:1218                                                                                                                         
        tmp_list = 0x7fffe459f870                                                                                                                                                                       
        functions = 0x0
        init = 0x7ffff66dfac8
        loop = <value optimized out>
#18 0x00007ffff62ae718 in wxEventLoop::Run() () from /usr/lib/libwx_gtk2u_core-2.8.so.0
No symbol table info available.
#19 0x00007ffff6332cdb in wxAppBase::MainLoop() () from /usr/lib/libwx_gtk2u_core-2.8.so.0
No symbol table info available.
#20 0x00007ffff5bbd65c in wxEntry(int&, wchar_t**) () from /usr/lib/libwx_baseu-2.8.so.0
No symbol table info available.
#21 0x00000000006795b4 in main (argc=1, argv=0x7fffffffe318) at amule-gui.cpp:94
No locals.
Logged

Corwin

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 23
Re: SVN 10002 crash an 64bit Debian
« Reply #2 on: February 05, 2010, 07:50:13 AM »

Code: [Select]
(gdb) thread apply all bt

Thread 5 (Thread 0x7fffe9919910 (LWP 6170)):
#0  0x00007ffff7bd020d in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007ffff5c14856 in wxConditionInternal::WaitTimeout(unsigned long) () from /usr/lib/libwx_baseu-2.8.so.0
#2  0x00007ffff5c15807 in wxSemaphoreInternal::WaitTimeout(unsigned long) () from /usr/lib/libwx_baseu-2.8.so.0
#3  0x00000000007af8a0 in CTimerThread::Entry (this=0x7fffe4595200) at Timer.cpp:66
#4  0x00007ffff5c16641 in wxThreadInternal::PthreadStart(wxThread*) () from /usr/lib/libwx_baseu-2.8.so.0
#5  0x00007ffff7bcb73a in start_thread () from /lib/libpthread.so.0
#6  0x00007ffff4ebf69d in clone () from /lib/libc.so.6
#7  0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7fffea91c910 (LWP 1127)):
#0  0x00007ffff7bd3131 in nanosleep () from /lib/libpthread.so.0
#1  0x00007ffff5c1b9bc in wxMicroSleep(unsigned long) () from /usr/lib/libwx_baseu-2.8.so.0
#2  0x00000000005d0ee5 in UploadBandwidthThrottler::Entry (this=0x1e44200) at UploadBandwidthThrottler.cpp:323
#3  0x00007ffff5c16641 in wxThreadInternal::PthreadStart(wxThread*) () from /usr/lib/libwx_baseu-2.8.so.0
#4  0x00007ffff7bcb73a in start_thread () from /lib/libpthread.so.0
#5  0x00007ffff4ebf69d in clone () from /lib/libc.so.6
#6  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7ffff7fad7f0 (LWP 991)):
#0  0x0000000000473b1a in CUpDownClient::HasValidHash (this=0x0) at updownclient.h:220
#1  0x00000000005a7ba4 in CServerSocket::ProcessPacket (this=0x7fffe45d0530, packet=0x7fffe461ce00 "\275n\373\323\364D\003;L\262\316b\016\274*\327\021\306 \233\004oz\234e", size=23, opcode=53 '5')
    at ServerSocket.cpp:562
#2  0x00000000005a9068 in CServerSocket::PacketReceived (this=0x7fffe45d0530, packet=0x7fffe45faf80) at ServerSocket.cpp:681
#3  0x000000000051db17 in CEMSocket::OnReceive (this=0x7fffe45d0530, nErrorCode=0) at EMSocket.cpp:322
#4  0x00000000005a5143 in CServerSocket::OnReceive (this=0x7fffe45d0530, nErrorCode=wxSOCKET_NOERROR) at ServerSocket.cpp:211
#5  0x00000000005a4840 in CServerSocketHandler::ServerSocketHandler (this=0xf41980, event=...) at ServerSocket.cpp:99
#6  0x00007ffff5c16de0 in wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () from /usr/lib/libwx_baseu-2.8.so.0
#7  0x00007ffff5c17db4 in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) () from /usr/lib/libwx_baseu-2.8.so.0
#8  0x00007ffff5c17e97 in wxEvtHandler::ProcessEvent(wxEvent&) () from /usr/lib/libwx_baseu-2.8.so.0
#9  0x00007ffff5c17238 in wxEvtHandler::ProcessPendingEvents() () from /usr/lib/libwx_baseu-2.8.so.0
#10 0x00007ffff5b893c9 in wxAppConsole::ProcessPendingEvents() () from /usr/lib/libwx_baseu-2.8.so.0
#11 0x00007ffff6332e4b in wxAppBase::ProcessIdle() () from /usr/lib/libwx_gtk2u_core-2.8.so.0
#12 0x00007ffff6297733 in ?? () from /usr/lib/libwx_gtk2u_core-2.8.so.0
#13 0x00007ffff284790e in g_main_dispatch (context=0xf8b1d0) at /tmp/buildd/glib2.0-2.22.4/glib/gmain.c:1960
#14 IA__g_main_context_dispatch (context=0xf8b1d0) at /tmp/buildd/glib2.0-2.22.4/glib/gmain.c:2513
#15 0x00007ffff284b2c8 in g_main_context_iterate (context=0xf8b1d0, block=<value optimized out>, dispatch=<value optimized out>, self=<value optimized out>)
    at /tmp/buildd/glib2.0-2.22.4/glib/gmain.c:2591
#16 0x00007ffff284b725 in IA__g_main_loop_run (loop=0x7fffe42ea8a0) at /tmp/buildd/glib2.0-2.22.4/glib/gmain.c:2799
#17 0x00007ffff4721f87 in IA__gtk_main () at /gtk+2.0-2.18.6/gtk/gtkmain.c:1218
#18 0x00007ffff62ae718 in wxEventLoop::Run() () from /usr/lib/libwx_gtk2u_core-2.8.so.0
#19 0x00007ffff6332cdb in wxAppBase::MainLoop() () from /usr/lib/libwx_gtk2u_core-2.8.so.0
#20 0x00007ffff5bbd65c in wxEntry(int&, wchar_t**) () from /usr/lib/libwx_baseu-2.8.so.0
#21 0x00000000006795b4 in main (argc=1, argv=0x7fffffffe318) at amule-gui.cpp:94
Logged

GonoszTopi

  • The current man in charge of most things.
  • Administrator
  • Hero Member
  • *****
  • Karma: 169
  • Offline Offline
  • Posts: 2685
Re: SVN 10002 crash an 64bit Debian
« Reply #3 on: February 05, 2010, 05:43:37 PM »

Would you be as kind as to test both revision 9988 and 9989? I have a strange feeling that the "fix" introduced in rev.9989 causes the crash. Although... who knows?
Logged
concordia cum veritate

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: SVN 10002 crash an 64bit Debian
« Reply #4 on: February 05, 2010, 08:10:03 PM »

I have a strange feeling that the "fix" introduced in rev.9989 causes the crash.
Well, what do we have here ?
Code: (ServerSocket.cpp 545 ) [Select]
case OP_CALLBACKREQUESTED: {
AddDebugLogLineM(false,logServer,wxT("Server: OP_CALLBACKREQUESTED"));

theStats::AddDownOverheadServer(size);
if (size >= 6) {
CMemFile data(packet,size);
uint32 dwIP = data.ReadUInt32();
uint16 nPort = data.ReadUInt16();
snip
CUpDownClient* client = theApp->clientlist->FindClientByIP(dwIP,nPort);
if (size >= 23 && client->HasValidHash()){
snip
if (client) {
client->TryToConnect();
} else {
client = new CUpDownClient(nPort,dwIP,0,0,0, true, true);
theApp->clientlist->AddClient(client);
client->TryToConnect();
}

Server sends us an IP. We look up the client matching the IP and dereference it without checking first if we got a valid result. FindClientByIP returns NULL if there's no client to the IP. So the bug is right here.
And further down, after using client-> several times it finally checks if it's != 0 and creates it.  :D

I don't see the connection to 9989, but I don't believe in such a coincidence either. Anyway, ServerSocket.cpp should be fixed with 10005.
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: SVN 10002 crash an 64bit Debian
« Reply #5 on: February 05, 2010, 09:38:29 PM »

9980 is what set the problem off actually.
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

Corwin

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 23
Re: SVN 10002 crash an 64bit Debian
« Reply #6 on: February 10, 2010, 11:03:05 PM »

I verified that the problem exists in 9988 and no longer exists in 10005 and 10007. Thank you!!! :)
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: SVN 10002 crash an 64bit Debian
« Reply #7 on: February 12, 2010, 07:31:29 PM »

Thank you for testing and reporting!
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon