aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: At last, a good trace  (Read 5020 times)

phoenix

  • Evil respawning bird from aMule Dev Team
  • Developer
  • Hero Member
  • *****
  • Karma: 44
  • Offline Offline
  • Posts: 2503
  • The last shadow you'll ever see
At last, a good trace
« on: May 01, 2004, 01:45:24 PM »

Now somethig usefull. That one has happened a lot lately. Now a got it inside gdb:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1084809088 (LWP 3379)]
Code: [Select]
0x0817e20b in CUpDownClient::IsPartAvailable(unsigned short) (this=0x9750400, iPart=0)
    at updownclient.h:281
281             inline bool             IsPartAvailable(uint16 iPart)   {return ( (iPart >= m_nPartCount) || (!m_abyPartStatus) )? 0:m_abyPartStatus[iPart];}
(gdb) bt
#0  0x0817e20b in CUpDownClient::IsPartAvailable(unsigned short) (this=0x9750400, iPart=0)
    at updownclient.h:281
#1  0x0822aba5 in CPartFile::UpdatePartsInfo() (this=0x94268e0) at PartFile.cpp:2026
#2  0x0817b525 in CUpDownClient::ProcessFileStatus(bool, CSafeMemFile*, CPartFile*) (
    this=0x98a8e70, bUdpPacket=false, data=0xbfef2f00, file=0x94268e0) at DownloadClient.cpp:506
#3  0x08140aab in CClientReqSocket::ProcessPacket(char*, unsigned, unsigned char) (this=0x94f0c50,
    packet=0x9764310 "÷I\210\227\034X\034Û\027qK8$¼¸;\026", size=21, opcode=80 'P')
    at ListenSocket.cpp:455
#4  0x0814641a in CClientReqSocket::PacketReceived(Packet*) (this=0x94f0c50, packet=0x98317d0)
    at ListenSocket.cpp:1702
#5  0x0814a159 in CEMSocket::OnReceive(int) (this=0x94f0c50, nErrorCode=0) at EMSocket.cpp:290
#6  0x0814656e in CClientReqSocket::OnReceive(int) (this=0x94f0c50, nErrorCode=0)
    at ListenSocket.cpp:1729
#7  0x082958f7 in CamuleDlg::socketHandler(wxSocketEvent&) (this=0x9130470, event=@0x97630a8)
    at amuleDlg.cpp:444
#8  0x037f7ef7 in wxEvtHandler::SearchEventTable(wxEventTable&, wxEvent&) ()
   from /usr/lib/libwx_gtk-2.4.so.0
#9  0x037f7d13 in wxEvtHandler::ProcessEvent(wxEvent&) () from /usr/lib/libwx_gtk-2.4.so.0
#10 0x037f7c56 in wxEvtHandler::ProcessPendingEvents() () from /usr/lib/libwx_gtk-2.4.so.0
#11 0x037b9e81 in wxAppBase::ProcessPendingEvents() () from /usr/lib/libwx_gtk-2.4.so.0
#12 0x0375a244 in wxapp_pending_callback () from /usr/lib/libwx_gtk-2.4.so.0
#13 0x007d04ef in g_timeout_add () from /usr/lib/libglib-1.2.so.0
#14 0x007cf35b in g_get_current_time () from /usr/lib/libglib-1.2.so.0
#15 0x007cf846 in g_get_current_time () from /usr/lib/libglib-1.2.so.0
#16 0x007cfaf4 in g_main_run () from /usr/lib/libglib-1.2.so.0
#17 0x003d66af in gtk_main () from /usr/lib/libgtk-1.2.so.0
#18 0x0375ad39 in wxApp::MainLoop() () from /usr/lib/libwx_gtk-2.4.so.0
#19 0x037b9d07 in wxAppBase::OnRun() () from /usr/lib/libwx_gtk-2.4.so.0
#20 0x0375b49b in wxEntry(int, char**) () from /usr/lib/libwx_gtk-2.4.so.0
#21 0x0828e156 in main (argc=1, argv=0xbfef33a4) at amule.cpp:114
(gdb) bt full
#0  0x0817e20b in CUpDownClient::IsPartAvailable(unsigned short) (this=0x9750400, iPart=0)
    at updownclient.h:281
No locals.
#1  0x0822aba5 in CPartFile::UpdatePartsInfo() (this=0x94268e0) at PartFile.cpp:2026
        i = 0
        pos = 0x0
        sl = 62
        partcount = 22
        flag = false
        count = {<> = {}, }
        cur_src = (CUpDownClient *) 0x9750400
#2  0x0817b525 in CUpDownClient::ProcessFileStatus(bool, CSafeMemFile*, CPartFile*) (
    this=0x98a8e70, bUdpPacket=false, data=0xbfef2f00, file=0x94268e0) at DownloadClient.cpp:506
        nED2KPartCount = 22
        bPartsNeeded = true
        iNeeded = 17
#3  0x08140aab in CClientReqSocket::ProcessPacket(char*, unsigned, unsigned char) (this=0x94f0c50,
    packet=0x9764310 "÷I\210\227\034X\034Û\027qK8$¼¸;\026", size=21, opcode=80 'P')
    at ListenSocket.cpp:455
        data = { = { = {_vptr.CFile = 0x830f6c8, m_fd = -1, m_error = 80,
      fFilePath = }, fBuffer = 0x9764310 "÷I\210\227\034X\034Û\027qK8$¼¸;\026",
    fLength = 60684304, fGrowBytes = 0, fPosition = 21, fBufferSize = 21, fFileSize = 21,
    deleteBuffer = 0}, }
        cfilehash = "÷I\210\227\034X\034Û\027qK8$¼¸;"
        file = (class CPartFile *) 0x94268e0
#4  0x0814641a in CClientReqSocket::PacketReceived(Packet*) (this=0x94f0c50, packet=0x98317d0)
    at ListenSocket.cpp:1702
        bResult = 9
        uRawSize = 21
#5  0x0814a159 in CEMSocket::OnReceive(int) (this=0x94f0c50, nErrorCode=0) at EMSocket.cpp:290
        bPacketResult = true
        toCopy = 21
        GlobalReadBuffer = "ÅN\000\000\000\205L0J0\r\006\t*\206H\206÷\r\001\001\001\005\000\0039\00006\0021\000Á\226{æ\200u\210DÊüú\003\nHÖ]\221lBI¢\006\000ãiEK.ºs\032\v¾\230\a\020\024é\032Ï\207¾_\026\000\037\022\027\002\001\021Å2\000\000\000\2060»\237OaXÔÎu¸sIáû2º\022óÓñ\nàê±Ë\220ôÐ'h\nh\225\215g\022K¯\035\020k·¯Ën\bàÓ,ã\220\000\000\000Y÷I\210\227\034X\034Û\027qK8$¼¸;}\000Wife's away neighbor teens get drunk i"...
        readMax = 2000000
        ret = 314
        rptr = 0x83d64da "º#(Ô\035\002«j\213TÙ·­êX\226\032\206¥\204E\203\tkÓ§E³:-\230G\204{\233¹ºH¤\200t\035\210\"\a\201à\036\207¥Éq\024Å&)\201U\225x¦)E\221ðä\030í\vÙ\234Ý\211fìK7\005pN\220é\022¯*ë\02
2ÅUUDq\034¶·ëZÖ\227&Ë¢è=\017FI\224»¤Í\001\234ò9Ì¥\211.TIr]áÞ&*b\206\020a\025\205az^\214\023(Ò4¤Ù9jZAðy¾oÁÀ\221\231TlK¾,V´ âÜ·\026å´+B\231Á\234bö¯:\016\204\017\003ÓÔô¿/­ë4G\026\232F\223 è.«¨"...
        rend = 0x83d64da "º#(Ô\035\002«j\213TÙ·­êX\226\032\206¥\204E\203\tkÓ§E³:-\230G\204{\233¹ºH¤\200t\035\210\"\a\201à\036\207¥Éq\024Å&)\201U\225x¦)E\221ðä\030í\vÙ\234Ý\211fìK7\005pN\220é\022¯*ë\022ÅUUDq\034¶·ëZÖ\227&Ë¢è=\017FI\224»¤Í\001\234ò9Ì¥\211.TIr]áÞ&*b\206\020a\025\205az^\214\023(Ò4¤Ù9jZAðy¾oÁÀ\221\231TlK¾,V´ âÜ·\026å´+B\231Á\234bö¯:\016\204\017\003ÓÔô¿/­ë4G\026\232F\223 è.«¨"...
#6  0x0814656e in CClientReqSocket::OnReceive(int) (this=0x94f0c50, nErrorCode=0)
    at ListenSocket.cpp:1729
No locals.
#7  0x082958f7 in CamuleDlg::socketHandler(wxSocketEvent&) (this=0x9130470, event=@0x97630a8)
    at amuleDlg.cpp:444
        soc = (class CClientReqSocket *) 0x94f0c50
        current_socket = (struct wxSocketBase *) 0x94f0c50
#8  0x037f7ef7 in wxEvtHandler::SearchEventTable(wxEventTable&, wxEvent&) ()
   from /usr/lib/libwx_gtk-2.4.so.0
No symbol table info available.
#9  0x037f7d13 in wxEvtHandler::ProcessEvent(wxEvent&) () from /usr/lib/libwx_gtk-2.4.so.0
No symbol table info available.
#10 0x037f7c56 in wxEvtHandler::ProcessPendingEvents() () from /usr/lib/libwx_gtk-2.4.so.0
No symbol table info available.
#11 0x037b9e81 in wxAppBase::ProcessPendingEvents() () from /usr/lib/libwx_gtk-2.4.so.0
No symbol table info available.
#12 0x0375a244 in wxapp_pending_callback () from /usr/lib/libwx_gtk-2.4.so.0
No symbol table info available.
#13 0x007d04ef in g_timeout_add () from /usr/lib/libglib-1.2.so.0
No symbol table info available.
#14 0x007cf35b in g_get_current_time () from /usr/lib/libglib-1.2.so.0
No symbol table info available.
#15 0x007cf846 in g_get_current_time () from /usr/lib/libglib-1.2.so.0
No symbol table info available.
#16 0x007cfaf4 in g_main_run () from /usr/lib/libglib-1.2.so.0
No symbol table info available.
#17 0x003d66af in gtk_main () from /usr/lib/libgtk-1.2.so.0
No symbol table info available.
#18 0x0375ad39 in wxApp::MainLoop() () from /usr/lib/libwx_gtk-2.4.so.0
No symbol table info available.
#19 0x037b9d07 in wxAppBase::OnRun() () from /usr/lib/libwx_gtk-2.4.so.0
No symbol table info available.
#20 0x0375b49b in wxEntry(int, char**) () from /usr/lib/libwx_gtk-2.4.so.0
No symbol table info available.
#21 0x0828e156 in main (argc=1, argv=0xbfef33a4) at amule.cpp:114
No locals.
(gdb)
Regards,

Marcelo.
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: At last, a good trace
« Reply #1 on: May 01, 2004, 01:50:16 PM »

Some more info, m_abyPartStatus seems to be trash. I have searched the code, and every delete has an assignment with NULL in the next line, so it should not be a dealocated pointer. Something seems to be leaking...

Cheers,

Marcelo.
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: At last, a good trace
« Reply #2 on: May 02, 2004, 05:33:08 AM »

A similar one, but not exactly the same. Same problem with m_abyPartStatus:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1085112192 (LWP 25785)]
Code: [Select]
0x0817e20b in CUpDownClient::IsPartAvailable(unsigned short) (this=0x986c170, iPart=0) at updownclient.h:281
281             inline bool             IsPartAvailable(uint16 iPart)   {return ( (iPart >= m_nPartCount) || (!m_abyPartStatus) )? 0:m_abyPartStatus[iPart];}
(gdb) bt
#0  0x0817e20b in CUpDownClient::IsPartAvailable(unsigned short) (this=0x986c170, iPart=0)
    at updownclient.h:281
#1  0x0822aba5 in CPartFile::UpdatePartsInfo() (this=0x9686588) at PartFile.cpp:2026
#2  0x0818da80 in CDownloadQueue::RemoveSource(CUpDownClient*, bool, bool) (this=0x96006b8,
    toremove=0x98f2b08, updatewindow=true, bDoStatsUpdate=true) at DownloadQueue.cpp:575
#3  0x08172922 in CClientList::RemoveClient(CUpDownClient*) (this=0x94a7258, toremove=0x98f2b08)
    at ClientList.cpp:167
#4  0x08151fcb in ~CUpDownClient (this=0x98f2b08) at BaseClient.cpp:238
#5  0x0813f90e in CClientReqSocket::Disconnect(CString) (this=0x9a5ba68,
    strReason={<> = {}, }) at ListenSocket.cpp:145
#6  0x081462f4 in CClientReqSocket::OnError(int) (this=0x9a5ba68, nErrorCode=107) at ListenSocket.cpp:1683
#7  0x082958db in CamuleDlg::socketHandler(wxSocketEvent&) (this=0x937a480, event=@0x9b86478)
    at amuleDlg.cpp:441
#8  0x003b6e62 in wxEvtHandler::SearchEventTable(wxEventTable&, wxEvent&) () from /usr/lib/libwx_gtk-2.4.so.0
#9  0x003b6c8f in wxEvtHandler::ProcessEvent(wxEvent&) () from /usr/lib/libwx_gtk-2.4.so.0
#10 0x003b6bcb in wxEvtHandler::ProcessPendingEvents() () from /usr/lib/libwx_gtk-2.4.so.0
#11 0x0036d759 in wxAppBase::ProcessPendingEvents() () from /usr/lib/libwx_gtk-2.4.so.0
#12 0x0031b07b in wxapp_pending_callback () from /usr/lib/libwx_gtk-2.4.so.0
#13 0x007d04ef in g_timeout_add () from /usr/lib/libglib-1.2.so.0
#14 0x007cf35b in g_get_current_time () from /usr/lib/libglib-1.2.so.0
#15 0x007cf846 in g_get_current_time () from /usr/lib/libglib-1.2.so.0
#16 0x007cfaf4 in g_main_run () from /usr/lib/libglib-1.2.so.0
#17 0x0064c6af in gtk_main () from /usr/lib/libgtk-1.2.so.0
#18 0x0031b9f2 in wxApp::MainLoop() () from /usr/lib/libwx_gtk-2.4.so.0
#19 0x0036d610 in wxAppBase::OnRun() () from /usr/lib/libwx_gtk-2.4.so.0
#20 0x0031c0cd in wxEntry(int, char**) () from /usr/lib/libwx_gtk-2.4.so.0
#21 0x0828e156 in main (argc=1, argv=0xbfe568d4) at amule.cpp:114
(gdb) bt full
#0  0x0817e20b in CUpDownClient::IsPartAvailable(unsigned short) (this=0x986c170, iPart=0)
    at updownclient.h:281
No locals.
#1  0x0822aba5 in CPartFile::UpdatePartsInfo() (this=0x9686588) at PartFile.cpp:2026
        i = 0
        pos = 0x0
        sl = 4
        partcount = 29
        flag = false
        count = {<> = {}, }
        cur_src = (CUpDownClient *) 0x986c170
#2  0x0818da80 in CDownloadQueue::RemoveSource(CUpDownClient*, bool, bool) (this=0x96006b8,
    toremove=0x98f2b08, updatewindow=true, bDoStatsUpdate=true) at DownloadQueue.cpp:575
        pos2 = 0x974eff8
        sl = 0
        cur_file = (class CPartFile *) 0x9686588
        i = 15
        size = 28
        removed = true
        pos3 = 0x974eff8
        pos4 = 0x0
#3  0x08172922 in CClientList::RemoveClient(CUpDownClient*) (this=0x94a7258, toremove=0x98f2b08)
    at ClientList.cpp:167
        pos = 0x9b41e20
#4  0x08151fcb in ~CUpDownClient (this=0x98f2b08) at BaseClient.cpp:238
No locals.
#5  0x0813f90e in CClientReqSocket::Disconnect(CString) (this=0x9a5ba68,
    strReason={<> = {}, }) at ListenSocket.cpp:145
        temp = (CUpDownClient *) 0x98f2b08
#6  0x081462f4 in CClientReqSocket::OnError(int) (this=0x9a5ba68, nErrorCode=107) at ListenSocket.cpp:1683
        strError = {<> = {}, }
#7  0x082958db in CamuleDlg::socketHandler(wxSocketEvent&) (this=0x937a480, event=@0x9b86478)
    at amuleDlg.cpp:441
        soc = (class CClientReqSocket *) 0x9a5ba68
        current_socket = (struct wxSocketBase *) 0x9a5ba68
#8  0x003b6e62 in wxEvtHandler::SearchEventTable(wxEventTable&, wxEvent&) () from /usr/lib/libwx_gtk-2.4.so.0
No symbol table info available.
#9  0x003b6c8f in wxEvtHandler::ProcessEvent(wxEvent&) () from /usr/lib/libwx_gtk-2.4.so.0
No symbol table info available.
#10 0x003b6bcb in wxEvtHandler::ProcessPendingEvents() () from /usr/lib/libwx_gtk-2.4.so.0
No symbol table info available.
#11 0x0036d759 in wxAppBase::ProcessPendingEvents() () from /usr/lib/libwx_gtk-2.4.so.0
No symbol table info available.
#12 0x0031b07b in wxapp_pending_callback () from /usr/lib/libwx_gtk-2.4.so.0
No symbol table info available.
#13 0x007d04ef in g_timeout_add () from /usr/lib/libglib-1.2.so.0
No symbol table info available.
#14 0x007cf35b in g_get_current_time () from /usr/lib/libglib-1.2.so.0
No symbol table info available.
#15 0x007cf846 in g_get_current_time () from /usr/lib/libglib-1.2.so.0
No symbol table info available.
#16 0x007cfaf4 in g_main_run () from /usr/lib/libglib-1.2.so.0
No symbol table info available.
#17 0x0064c6af in gtk_main () from /usr/lib/libgtk-1.2.so.0
No symbol table info available.
#18 0x0031b9f2 in wxApp::MainLoop() () from /usr/lib/libwx_gtk-2.4.so.0
No symbol table info available.
#19 0x0036d610 in wxAppBase::OnRun() () from /usr/lib/libwx_gtk-2.4.so.0
No symbol table info available.
#20 0x0031c0cd in wxEntry(int, char**) () from /usr/lib/libwx_gtk-2.4.so.0
No symbol table info available.
#21 0x0828e156 in main (argc=1, argv=0xbfe568d4) at amule.cpp:114
No locals.
(gdb)
Logged

greaman

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 42
Re: At last, a good trace
« Reply #3 on: May 02, 2004, 05:43:57 AM »

Quote
Originally posted by phoenix
Some more info, m_abyPartStatus seems to be trash. I have searched the code, and every delete has an assignment with NULL in the next line, so it should not be a dealocated pointer. Something seems to be leaking...

jap, I think you are right...

Except the crashes happening when I view all sorces of a file there are only crashes related to

mem_alloc (optional with Seg fault)

*Part* Functions as Phoenix trace but veen more different functions
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: At last, a good trace
« Reply #4 on: May 02, 2004, 02:19:59 PM »

Ok, more info. I have reduced the number of active downloads. In the previous traces, I had 27 files downloading simultaneously. Now I have 13 active, 5 downloading, 8 waiting. amule is up for 8h:34min, and in this machine it's a record. The problem seems to be related to the number of active downloads.

I believe there's something leaking, and the number of downloads only makes it more evident. I think I'm going to play a little with the code to proove it.

Cheers!
Logged

Jacobo221

  • Hero Member
  • *****
  • Karma: 3
  • Offline Offline
  • Posts: 2712
Re: At last, a good trace
« Reply #5 on: May 03, 2004, 09:41:03 AM »

"I believe there's something leaking, and the number of downloads only makes it more evident. I think I'm going to play a little with the code to proove it." <- DO IT, DO IT!!! FIX IT!!! xD

If you get any good results, don't forget the aMule team exists and is waiting for any fix ;-) (You can post on the Patches forum).
Greetings and thanx!
Logged

greaman

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 42
Re: At last, a good trace
« Reply #6 on: May 03, 2004, 01:37:21 PM »

Quote
Originally posted by phoenix
Ok, more info. I have reduced the number of active downloads. In the previous traces, I had 27 files downloading simultaneously. Now I have 13 active, 5 downloading, 8 waiting. amule is up for 8h:34min, and in this machine it's a record. The problem seems to be related to the number of active downloads.

I believe there's something leaking, and the number of downloads only makes it more evident. I think I'm going to play a little with the code to proove it.

Cheers!

well I have 3 amules running on 3 machines simultanously for my little estings ;) and on one machine there are only 12 files waiting, all short before completion (9,28 or 18,55 Megs to finish) and even there amule always crashes with SEG fault at least every two hours. Its not very funny to have 12 files open since months which just don't complete because amule is crashing before you get a good position in queue ;)

On another machne there are 120 downloads active and it runs a stable as the machine with twelve... crashing at least after two hours with SEG fault and pointing at a *Part*-Function (5 or 6 different Functions I have seen untill now)
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: At last, a good trace
« Reply #7 on: May 08, 2004, 10:57:17 AM »

Code: [Select]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1084936064 (LWP 20096)]
0x0817e25b in CUpDownClient::IsPartAvailable(unsigned short) (this=0x96f3710, iPart=0) at updownclient.h:281
281             inline bool             IsPartAvailable(uint16 iPart)   {return ( (iPart >= m_nPartCount) || (!m_abyPartStatus) )? 0:m_abyPartStatus[iPart];}
(gdb) bt
#0  0x0817e25b in CUpDownClient::IsPartAvailable(unsigned short) (this=0x96f3710, iPart=0)
    at updownclient.h:281
#1  0x0822abf5 in CPartFile::UpdatePartsInfo() (this=0x92c3da0) at PartFile.cpp:2026
#2  0x0817b575 in CUpDownClient::ProcessFileStatus(bool, CSafeMemFile*, CPartFile*) (this=0x9661018,
    bUdpPacket=true, data=0xbfedc5f0, file=0x92c3da0) at DownloadClient.cpp:506
#3  0x0817518c in CClientUDPSocket::ProcessPacket(char*, unsigned short, unsigned char, char*, unsigned short)
    (this=0x90caf68, packet=0xbfedc702 "", size=4, opcode=145 '\221', host=0x92500b0 "80.11.37.26", port=4672)
    at ClientUDPSocket.cpp:184
#4  0x0817496a in CClientUDPSocket::OnReceive(int) (this=0x90caf68, nErrorCode=0) at ClientUDPSocket.cpp:92
#5  0x08295acd in CamuleDlg::socketHandler(wxSocketEvent&) (this=0x8f7b478, event=@0x9b77a10)
    at amuleDlg.cpp:493
#6  0x003b6e62 in wxEvtHandler::SearchEventTable(wxEventTable&, wxEvent&) () from /usr/lib/libwx_gtk-2.4.so.0
#7  0x003b6c8f in wxEvtHandler::ProcessEvent(wxEvent&) () from /usr/lib/libwx_gtk-2.4.so.0
#8  0x003b6bcb in wxEvtHandler::ProcessPendingEvents() () from /usr/lib/libwx_gtk-2.4.so.0
#9  0x0036d759 in wxAppBase::ProcessPendingEvents() () from /usr/lib/libwx_gtk-2.4.so.0
#10 0x0031b07b in wxapp_pending_callback () from /usr/lib/libwx_gtk-2.4.so.0
#11 0x007d04ef in g_timeout_add () from /usr/lib/libglib-1.2.so.0
#12 0x007cf35b in g_get_current_time () from /usr/lib/libglib-1.2.so.0
#13 0x007cf846 in g_get_current_time () from /usr/lib/libglib-1.2.so.0
#14 0x007cfaf4 in g_main_run () from /usr/lib/libglib-1.2.so.0
#15 0x0064c6af in gtk_main () from /usr/lib/libgtk-1.2.so.0
#16 0x0031b9f2 in wxApp::MainLoop() () from /usr/lib/libwx_gtk-2.4.so.0
#17 0x0036d610 in wxAppBase::OnRun() () from /usr/lib/libwx_gtk-2.4.so.0
#18 0x0031c0cd in wxEntry(int, char**) () from /usr/lib/libwx_gtk-2.4.so.0
#19 0x0828e1a6 in main (argc=1, argv=0xbfedde34) at amule.cpp:114
(gdb) bt full
#0  0x0817e25b in CUpDownClient::IsPartAvailable(unsigned short) (this=0x96f3710, iPart=0)
    at updownclient.h:281
No locals.
#1  0x0822abf5 in CPartFile::UpdatePartsInfo() (this=0x92c3da0) at PartFile.cpp:2026
        i = 0
        pos = 0x0
        sl = 76
        partcount = 75
        flag = false
        count = {<> = {}, }
        cur_src = (CUpDownClient *) 0x96f3710
#2  0x0817b575 in CUpDownClient::ProcessFileStatus(bool, CSafeMemFile*, CPartFile*) (this=0x9661018,
    bUdpPacket=true, data=0xbfedc5f0, file=0x92c3da0) at DownloadClient.cpp:506
        nED2KPartCount = 0
        bPartsNeeded = true
        iNeeded = 0
#3  0x0817518c in CClientUDPSocket::ProcessPacket(char*, unsigned short, unsigned char, char*, unsigned short)
    (this=0x90caf68, packet=0xbfedc702 "", size=4, opcode=145 '\221', host=0x92500b0 "80.11.37.26", port=4672)
    at ClientUDPSocket.cpp:184
        data_in = { = { = {_vptr.CFile = 0x830f708, m_fd = -1, m_error = 64,
      fFilePath = }, fBuffer = 0xbfedc702 "", fLength = 11882481, fGrowBytes = 0,
    fPosition = 2, fBufferSize = 4, fFileSize = 4, deleteBuffer = 0}, }
        nRank = 0
        sender = (CUpDownClient *) 0x9661018
#4  0x0817496a in CClientUDPSocket::OnReceive(int) (this=0x90caf68, nErrorCode=0) at ClientUDPSocket.cpp:92
        buffer = "Å\221\000\000S\023\231ÃK%Î&¬\002õRß ]\000¸\004Ñ\0008Çí¿´Ìn\000\000\000\000\000\000\000\000\000
\210Çí¿c²a\000\bUý\bhÇí¿\210Çí¿¦âk\000t°\b\thÇí¿\210Çí¿¯m|\000pÇí¿hÇí¿\003\000\000\000\001\000\000\000\002\000\0
00\000\002\000\000\000\000\000\210\001¸\004Ñ\000\000\000\000\000´Ìn\000¨Çí¿Ôgc\000tSý\b\001\000\000\000¨Çí¿Àºd\0
00hSý\b0Ëí¿\000\000\000\000´Ìn\000´Ìn\000hSý\b8Èí¿Üaa\000hSý\bhSý\b\f\000\000\000`Èí¿°8õ\btnm\000"...
        serverbuffer =
        addr =
        length = 6
        addr_in = {s_addr = 438635344}
        fromIP = 0x92500b0 "80.11.37.26"
#5  0x08295acd in CamuleDlg::socketHandler(wxSocketEvent&) (this=0x8f7b478, event=@0x9b77a10)
    at amuleDlg.cpp:493
        soc = (class CClientUDPSocket *) 0x90caf68
        current_socket = (struct wxSocketBase *) 0x90caf68
#6  0x003b6e62 in wxEvtHandler::SearchEventTable(wxEventTable&, wxEvent&) () from /usr/lib/libwx_gtk-2.4.so.0
No symbol table info available.
#7  0x003b6c8f in wxEvtHandler::ProcessEvent(wxEvent&) () from /usr/lib/libwx_gtk-2.4.so.0
No symbol table info available.
#8  0x003b6bcb in wxEvtHandler::ProcessPendingEvents() () from /usr/lib/libwx_gtk-2.4.so.0
No symbol table info available.
#9  0x0036d759 in wxAppBase::ProcessPendingEvents() () from /usr/lib/libwx_gtk-2.4.so.0
No symbol table info available.
#10 0x0031b07b in wxapp_pending_callback () from /usr/lib/libwx_gtk-2.4.so.0
No symbol table info available.
#11 0x007d04ef in g_timeout_add () from /usr/lib/libglib-1.2.so.0
No symbol table info available.
#12 0x007cf35b in g_get_current_time () from /usr/lib/libglib-1.2.so.0
No symbol table info available.
#13 0x007cf846 in g_get_current_time () from /usr/lib/libglib-1.2.so.0
No symbol table info available.
#14 0x007cfaf4 in g_main_run () from /usr/lib/libglib-1.2.so.0
No symbol table info available.
#15 0x0064c6af in gtk_main () from /usr/lib/libgtk-1.2.so.0
No symbol table info available.
#16 0x0031b9f2 in wxApp::MainLoop() () from /usr/lib/libwx_gtk-2.4.so.0
No symbol table info available.
#17 0x0036d610 in wxAppBase::OnRun() () from /usr/lib/libwx_gtk-2.4.so.0
No symbol table info available.
#18 0x0031c0cd in wxEntry(int, char**) () from /usr/lib/libwx_gtk-2.4.so.0
No symbol table info available.
#19 0x0828e1a6 in main (argc=1, argv=0xbfedde34) at amule.cpp:114
No locals.
(gdb)
Logged

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Re: At last, a good trace
« Reply #8 on: May 08, 2004, 01:44:50 PM »

(one of those special times when kry comes around and post instead of only reading)

phoenix, you seem a great bug-tracer and so I'm asking you to join the official testers team and get to test cvs snapshots of current development.
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: At last, a good trace
« Reply #9 on: May 09, 2004, 02:12:28 AM »

Kry, that would be great! What shall I do?
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: At last, a good trace
« Reply #10 on: May 09, 2004, 04:20:55 AM »

Ok, what I suspected is in fact, true. I was examining the core file from the last trace, and something is definetly leaking. I have created two varables, one before and one after m_abyPartStatus. The first one is called must_b_aa, and the last one is called must_be_55, and they are initialized at the constructors and nowhere else are touched. And guess what? must_be_aa is 0x43 and must_be_55 is 0x94
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: At last, a good trace
« Reply #11 on: May 09, 2004, 04:23:49 AM »

Would that make sense?

Code: [Select]
--- PartFile.cpp.old    2004-05-08 23:17:55.000000000 -0300
+++ PartFile.cpp        2004-05-08 23:44:42.000000000 -0300
@@ -2020,8 +2020,8 @@

        for(int sl=0; sl                if (!srclists[sl].IsEmpty()) {
-                       for (POSITION pos = srclists[sl].GetHeadPosition(); pos != 0; ) {
-                               cur_src = srclists[sl].GetNext(pos);
+                       for (POSITION pos = srclists[sl].GetHeadPosition(); pos != 0; pos = srclists[sl].NextAt(pos)) {
+                               cur_src = srclists[sl].GetAt(pos);
                                for (uint16 i = 0; i < partcount; i++)  {
                                        if (cur_src->IsPartAvailable(i)) {
                                                m_SrcpartFrequency[i] +=1;
« Last Edit: May 09, 2004, 04:45:33 AM by phoenix »
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: At last, a good trace
« Reply #12 on: May 11, 2004, 12:11:25 PM »

I have recently found that GetNext has a side effect on pos. I used to think that this was ugly :-) Is this a new trend? :-) Anyway, it took me some time to figure it out, I don't think that this is good for readability. An ampersand in front of pos does not take that much space in the source.

Anyway, in another part of the code (PartFile.cpp:1674), just beeing paranoid, I changed

Code: [Select]
for(POSITION pos = m_downloadingSourcesList.GetHeadPosition();pos!=0;)

to

Code: [Select]
  for (POSITION pos = m_downloadingSourcesList.GetHeadPosition(); pos != 0; pos = m_downloadingSourcesList.NextAt(pos)) {

The correct value of pos after the attribution should have been 0xa1c5a18, but it segfaulted with 0x18, as if it only got the last byte from the pointer. I have read the code many times, but did not find a suitable explanation. Maybe a stack corruption?

By the way, I have the core open in gdb, if anyone is insterested in the value of some variable.

Cheers!
« Last Edit: May 11, 2004, 12:23:08 PM by phoenix »
Logged