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 4 ... 8

Author Topic: Re: upredictable memory leak  (Read 71740 times)

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: upredictable memory leak
« Reply #15 on: January 01, 2011, 10:43:58 PM »

Very interesting.
Is your up/download speed still the same as it was with amule?
Did you compile wxWidgets yourself, or did it come with your distro?
« Last Edit: January 01, 2011, 10:46:25 PM by Stu Redman »
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

btkaos

  • Global Moderator
  • Sr. Member
  • *****
  • Karma: 110
  • Offline Offline
  • Posts: 486
  • Kaos is infinite!
Re: upredictable memory leak
« Reply #16 on: January 03, 2011, 01:28:06 AM »

Well, I was in front of my computer when aMule started going eating all the available memory in a similar fashion than it is described here.

I attach amule to gdb and tried to debug, but nothing of value was gained. In all cases, the backtrace pointed to WxSocket::Clone being called again and again from an event. :(

No repeat yet.
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: upredictable memory leak
« Reply #17 on: January 03, 2011, 12:18:48 PM »

That backtrace would have been really interesting. :-(
I did suspect some networking problem. amuled uses different network functions (at least when built with wx 2.8 ), which could explain why only the monolith is involved.
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

btkaos

  • Global Moderator
  • Sr. Member
  • *****
  • Karma: 110
  • Offline Offline
  • Posts: 486
  • Kaos is infinite!
Re: upredictable memory leak
« Reply #18 on: January 05, 2011, 01:34:08 AM »

It happened again, but I wasn't in front of my computer and couldn't interrupt amule.

I'm using this shell hack in order to attach gdb to aMule next time it happens, it could be useful for some of you. I'll post the backtrace again.

Code: [Select]
while true ; do if `test \`ps axl | grep amule | grep -v grep | awk '{ print $8 ;}'\` -gt 2000000`; then gdb -p `pidof amule`; else sleep 10; fi; done

This checks whether amule's RSS is bigger than 2Gb and if so, it launches gdb (and stops amule) In Ubuntu it should be run as root.

[I'm using svn head]
Logged

zekkerj

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 25
Re: Re: upredictable memory leak
« Reply #19 on: January 05, 2011, 05:42:00 AM »

Disabling KAD seems to have worked for me. Maybe you have a different problem, as you're using a different system?
Logged

btkaos

  • Global Moderator
  • Sr. Member
  • *****
  • Karma: 110
  • Offline Offline
  • Posts: 486
  • Kaos is infinite!
Re: upredictable memory leak
« Reply #20 on: January 07, 2011, 01:01:35 AM »

Well, it happened again, aMule did eat all the available memory, but this time the script did save my gnome-session and allowed me to debug.

IMVHO this is the same case than in RRM, it happened when I did set up a hard limit on speed and a lot of connections started queuing without being served, or something like that.

Some backtraces:

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

Hilo 3 (Thread 0x7fc3f6bb4700 (LWP 22872)):
#0  0x00007fc401f5036d in nanosleep () at ../sysdeps/unix/syscall-template.S:82
#1  0x00007fc40058b3ec in wxMicroSleep (microseconds=<value optimized out>) at ../src/unix/utilsunx.cpp:191
#2  0x0000000000574bab in UploadBandwidthThrottler::Entry (this=<value optimized out>)
    at UploadBandwidthThrottler.cpp:323
#3  0x00007fc400584dfa in wxThreadInternal::PthreadStart (thread=0x2cd7c00) at ../src/unix/threadpsx.cpp:766
#4  0x00007fc401f48971 in start_thread (arg=<value optimized out>) at pthread_create.c:304
#5  0x00007fc3ff81692d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#6  0x0000000000000000 in ?? ()

Hilo 2 (Thread 0x7fc3f5bb1700 (LWP 22874)):
#0  __lll_lock_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:136
#1  0x00007fc401f4a849 in _L_lock_953 () from /lib/libpthread.so.0
#2  0x00007fc401f4a66b in __pthread_mutex_lock (mutex=0x244c7d0) at pthread_mutex_lock.c:61
#3  0x00007fc400583216 in wxMutexInternal::Lock (this=0x244c7d0) at ../src/unix/threadpsx.cpp:248
#4  0x00007fc400586652 in Enter (this=0x23d41e0, event=<value optimized out>) at ../include/wx/thread.h:271
#5  wxEvtHandler::AddPendingEvent (this=0x23d41e0, event=<value optimized out>) at ../src/common/event.cpp:1152
#6  0x00000000006b95d1 in CTimerThread::Entry (this=0x2e2ad00) at Timer.cpp:70
#7  0x00007fc400584dfa in wxThreadInternal::PthreadStart (thread=0x2e2ad00) at ../src/unix/threadpsx.cpp:766
#8  0x00007fc401f48971 in start_thread (arg=<value optimized out>) at pthread_create.c:304
#9  0x00007fc3ff81692d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#10 0x0000000000000000 in ?? ()

Hilo 1 (Thread 0x7fc402337940 (LWP 22867)):
#0  wxNodeBase::wxNodeBase (this=0x7fc37bb534b0, list=0x7fc3f00010b0, previous=0x7fc37bb533d0, next=0x0,
    data=0xc1e500, key=...) at ../src/common/list.cpp:76
#1  0x00007fc400517cf5 in wxObjectListNode (this=0x7fc3f00010b0, prev=0x7fc37bb533d0, next=0x0, data=0xc1e500,
    key=...) at ../include/wx/list.h:1185
#2  wxObjectList::CreateNode (this=0x7fc3f00010b0, prev=0x7fc37bb533d0, next=0x0, data=0xc1e500, key=...)
    at ../include/wx/list.h:1185
#3  0x00007fc40052b001 in wxListBase::Append (this=0x7fc3f00010b0, object=0x0) at ../src/common/list.cpp:244
#4  0x00007fc40058666d in Append (this=0xc1e500, event=<value optimized out>) at ../include/wx/list.h:1185
#5  wxEvtHandler::AddPendingEvent (this=0xc1e500, event=<value optimized out>) at ../src/common/event.cpp:1156
#6  0x00007fc40082fa84 in wxSocketBase::OnRequest (this=0x485c990, notification=wxSOCKET_OUTPUT)
    at ../src/common/socket.cpp:1006
#7  0x00007fc40083442e in GSocket::Detected_Write (this=0x6459110) at ../src/unix/gsocket.cpp:1836
#8  0x00007fc3fec8399f in gdk_io_invoke (source=<value optimized out>, condition=<value optimized out>,
    data=<value optimized out>) at /build/buildd/gtk+2.0-2.22.0/gdk/gdkevents.c:1082
#9  0x00007fc3fd0ec342 in g_main_dispatch (context=0x23d4780) at /build/buildd/glib2.0-2.26.1/glib/gmain.c:2149
#10 g_main_context_dispatch (context=0x23d4780) at /build/buildd/glib2.0-2.26.1/glib/gmain.c:2702
#11 0x00007fc3fd0f02a8 in g_main_context_iterate (context=0x23d4780, block=<value optimized out>,
    dispatch=<value optimized out>, self=<value optimized out>) at /build/buildd/glib2.0-2.26.1/glib/gmain.c:2780
#12 0x00007fc3fd0f07b5 in g_main_loop_run (loop=0x2c3b4e0) at /build/buildd/glib2.0-2.26.1/glib/gmain.c:2988
#13 0x00007fc3ff0423e7 in IA__gtk_main () at /build/buildd/gtk+2.0-2.22.0/gtk/gtkmain.c:1237
#14 0x00007fc400c15a28 in wxEventLoop::Run (this=0x2e2a640) at ../src/gtk/evtloop.cpp:76
#15 0x00007fc400ca5f18 in wxAppBase::MainLoop (this=0x23d41e0) at ../src/common/appcmn.cpp:312
#16 0x00007fc40051f025 in wxEntry (argc=<value optimized out>, argv=<value optimized out>)
    at ../src/common/init.cpp:448
#17 0x00000000005d0892 in main (argc=1, argv=0x7fc3f00010b0) at amule-gui.cpp:93
(gdb) thread apply all bt full

Hilo 3 (Thread 0x7fc3f6bb4700 (LWP 22872)):
#0  0x00007fc401f5036d in nanosleep () at ../sysdeps/unix/syscall-template.S:82
No locales.
#1  0x00007fc40058b3ec in wxMicroSleep (microseconds=<value optimized out>) at ../src/unix/utilsunx.cpp:191
        tmReq = {tv_sec = 0, tv_nsec = 253000000}
#2  0x0000000000574bab in UploadBandwidthThrottler::Entry (this=<value optimized out>)
    at UploadBandwidthThrottler.cpp:323
        timeSinceLastLoop = 1
        minFragSize = 1300
        doubleSendSize = 2600
        sleepTime = 254
        thisLoopTick = 1572013229
        bytesToSpend = <value optimized out>
        extraSleepTime = 1
        lastLoopTick = 1572013229
        allowedDataRate = 10240
        rememberedSlotCounter = 6
        sendLock = {m_isOk = 16, m_mutex = @0x7fc40052d7d8}
#3  0x00007fc400584dfa in wxThreadInternal::PthreadStart (thread=0x2cd7c00) at ../src/unix/threadpsx.cpp:766
        pthread = 0x2aa7110
        rc = <value optimized out>
        dontRunAtAll = false
        __FUNCTION__ = "PthreadStart"
#4  0x00007fc401f48971 in start_thread (arg=<value optimized out>) at pthread_create.c:304
        __res = <value optimized out>
        pd = 0x7fc3f6bb4700
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140479634818816, -4108199948263213771, 140734433312144,
                140479634819520, 140479827537984, 3, 4141992929088386357, 4140142868344747317}, mask_was_saved = 0}},
          priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <value optimized out>
        robust = <value optimized out>
        freesize = <value optimized out>
        __PRETTY_FUNCTION__ = "start_thread"
#5  0x00007fc3ff81692d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
No locales.
#6  0x0000000000000000 in ?? ()
No symbol table info available.

Hilo 2 (Thread 0x7fc3f5bb1700 (LWP 22874)):
#0  __lll_lock_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:136
No locales.
#1  0x00007fc401f4a849 in _L_lock_953 () from /lib/libpthread.so.0
No symbol table info available.
#2  0x00007fc401f4a66b in __pthread_mutex_lock (mutex=0x244c7d0) at pthread_mutex_lock.c:61
        ignore1 = <value optimized out>
        ignore2 = 38062032
        ignore3 = -512
        __PRETTY_FUNCTION__ = "__pthread_mutex_lock"
        type = <value optimized out>
#3  0x00007fc400583216 in wxMutexInternal::Lock (this=0x244c7d0) at ../src/unix/threadpsx.cpp:248
        err = <value optimized out>
        __FUNCTION__ = "Lock"
#4  0x00007fc400586652 in Enter (this=0x23d41e0, event=<value optimized out>) at ../include/wx/thread.h:271
No locales.
#5  wxEvtHandler::AddPendingEvent (this=0x23d41e0, event=<value optimized out>) at ../src/common/event.cpp:1152
        eventCopy = <value optimized out>
        __FUNCTION__ = "AddPendingEvent"
#6  0x00000000006b95d1 in CTimerThread::Entry (this=0x2e2ad00) at Timer.cpp:70
        now = <value optimized out>
        delta = <value optimized out>
---Type <return> to continue, or q <return> to quit---
        evt = {<wxEvent> = {<wxObject> = {_vptr.wxObject = 0x7dfa10, static ms_classInfo = {
                m_className = 0x7fc4005b5050 L"wxObject", m_objectSize = 16, m_objectConstructor = 0,
                m_baseInfo1 = 0x0, m_baseInfo2 = 0x0, static sm_first = 0x7fc40137b180, m_next = 0x7fc40080dd20,
                static sm_classTable = 0x2393010}, m_refData = 0x0}, m_eventObject = 0x0, m_eventType = 10245,
            m_timeStamp = 0, m_id = 6128, m_callbackUserData = 0x0, m_propagationLevel = 0, m_skipped = false,
            m_isCommandEvent = false, static ms_classInfo = {m_className = 0x7fc4005c71c0 L"wxEvent",
              m_objectSize = 64, m_objectConstructor = 0, m_baseInfo1 = 0x7fc40080dc20, m_baseInfo2 = 0x0,
              static sm_first = 0x7fc40137b180, m_next = 0x7fc40080fbc0,
              static sm_classTable = 0x2393010}}, <No data fields>}
        lastEvent = 1572010891
#7  0x00007fc400584dfa in wxThreadInternal::PthreadStart (thread=0x2e2ad00) at ../src/unix/threadpsx.cpp:766
        pthread = 0x2e71ec0
        rc = <value optimized out>
        dontRunAtAll = false
        __FUNCTION__ = "PthreadStart"
#8  0x00007fc401f48971 in start_thread (arg=<value optimized out>) at pthread_create.c:304
        __res = <value optimized out>
        pd = 0x7fc3f5bb1700
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140479618029312, -4108199948263213771, 140734433313232,
                140479618030016, 140479827537984, 3, 4141999526695023925, 4140142868344747317}, mask_was_saved = 0}},
          priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <value optimized out>
        robust = <value optimized out>
        freesize = <value optimized out>
        __PRETTY_FUNCTION__ = "start_thread"
#9  0x00007fc3ff81692d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
No locales.
#10 0x0000000000000000 in ?? ()
No symbol table info available.

Hilo 1 (Thread 0x7fc402337940 (LWP 22867)):
#0  wxNodeBase::wxNodeBase (this=0x7fc37bb534b0, list=0x7fc3f00010b0, previous=0x7fc37bb533d0, next=0x0,
    data=0xc1e500, key=...) at ../src/common/list.cpp:76
No locales.
#1  0x00007fc400517cf5 in wxObjectListNode (this=0x7fc3f00010b0, prev=0x7fc37bb533d0, next=0x0, data=0xc1e500,
    key=...) at ../include/wx/list.h:1185
No locales.
#2  wxObjectList::CreateNode (this=0x7fc3f00010b0, prev=0x7fc37bb533d0, next=0x0, data=0xc1e500, key=...)
    at ../include/wx/list.h:1185
No locales.
#3  0x00007fc40052b001 in wxListBase::Append (this=0x7fc3f00010b0, object=0x0) at ../src/common/list.cpp:244
        __FUNCTION__ = "Append"
        node = <value optimized out>
#4  0x00007fc40058666d in Append (this=0xc1e500, event=<value optimized out>) at ../include/wx/list.h:1185
No locales.
#5  wxEvtHandler::AddPendingEvent (this=0xc1e500, event=<value optimized out>) at ../src/common/event.cpp:1156
        eventCopy = <value optimized out>
        __FUNCTION__ = "AddPendingEvent"
#6  0x00007fc40082fa84 in wxSocketBase::OnRequest (this=0x485c990, notification=wxSOCKET_OUTPUT)
    at ../src/common/socket.cpp:1006
        event = aviso: can't find linker symbol for virtual table for `wxSocketEvent' value
{<wxEvent> = {<wxObject> = {_vptr.wxObject = 0xc11470, static ms_classInfo = {
                m_className = 0x7fc4005b5050 L"wxObject", m_objectSize = 16, m_objectConstructor = 0,
                m_baseInfo1 = 0x0, m_baseInfo2 = 0x0, static sm_first = 0x7fc40137b180, m_next = 0x7fc40080dd20,
                static sm_classTable = 0x2393010}, m_refData = 0x0}, m_eventObject = 0x485c990, m_eventType = 10002,
            m_timeStamp = 0, m_id = 6123, m_callbackUserData = 0x0, m_propagationLevel = 0, m_skipped = false,
            m_isCommandEvent = false, static ms_classInfo = {m_className = 0x7fc4005c71c0 L"wxEvent",
              m_objectSize = 64, m_objectConstructor = 0, m_baseInfo1 = 0x7fc40080dc20, m_baseInfo2 = 0x0,
              static sm_first = 0x7fc40137b180, m_next = 0x7fc40080fbc0, static sm_classTable = 0x2393010}},
          m_event = wxSOCKET_OUTPUT, m_clientData = 0x0, static ms_classInfo = {
            m_className = 0x7fc400836e58 L"wxSocketEvent", m_objectSize = 80,
            m_objectConstructor = 0x7fc40082e850 <wxSocketEvent::wxCreateObject()>, m_baseInfo1 = 0x7fc40080fc00,
---Type <return> to continue, or q <return> to quit---
            m_baseInfo2 = 0x0, static sm_first = 0x7fc40137b180, m_next = 0x7fc400a40b40,
            static sm_classTable = 0x2393010}}
        flag = <value optimized out>
#7  0x00007fc40083442e in GSocket::Detected_Write (this=0x6459110) at ../src/unix/gsocket.cpp:1836
No locales.
#8  0x00007fc3fec8399f in gdk_io_invoke (source=<value optimized out>, condition=<value optimized out>,
    data=<value optimized out>) at /build/buildd/gtk+2.0-2.22.0/gdk/gdkevents.c:1082
        closure = 0x7fc3e81c7c70
        gdk_cond = GDK_INPUT_WRITE
#9  0x00007fc3fd0ec342 in g_main_dispatch (context=0x23d4780) at /build/buildd/glib2.0-2.26.1/glib/gmain.c:2149
        dispatch = 0x7fc3fd130a90 <g_io_unix_dispatch>
        user_data = 0x7fc3e81c7c70
        callback = 0x7fc3fec83950 <gdk_io_invoke>
        cb_funcs = 0x7fc3fd38c610
        cb_data = 0x7fc3e80659e0
        current_source_link = {data = 0x7fc3e81a8110, next = 0x0}
        source = 0x7fc3e81a8110
        current = 0x2c22a60
        i = 1
#10 g_main_context_dispatch (context=0x23d4780) at /build/buildd/glib2.0-2.26.1/glib/gmain.c:2702
No locales.
#11 0x00007fc3fd0f02a8 in g_main_context_iterate (context=0x23d4780, block=<value optimized out>,
    dispatch=<value optimized out>, self=<value optimized out>) at /build/buildd/glib2.0-2.26.1/glib/gmain.c:2780
        max_priority = 110
        timeout = 0
        some_ready = 1
        nfds = 38
        allocated_nfds = 12565584
        fds = <value optimized out>
        __PRETTY_FUNCTION__ = "g_main_context_iterate"
#12 0x00007fc3fd0f07b5 in g_main_loop_run (loop=0x2c3b4e0) at /build/buildd/glib2.0-2.26.1/glib/gmain.c:2988
        self = 0x23d5570
        __PRETTY_FUNCTION__ = "g_main_loop_run"
#13 0x00007fc3ff0423e7 in IA__gtk_main () at /build/buildd/gtk+2.0-2.22.0/gtk/gtkmain.c:1237
        tmp_list = 0x2e2a640
        functions = 0x0
        init = 0x7fc40108d588
        loop = <value optimized out>
#14 0x00007fc400c15a28 in wxEventLoop::Run (this=0x2e2a640) at ../src/gtk/evtloop.cpp:76
        __FUNCTION__ = "Run"
        exitcode = <value optimized out>
#15 0x00007fc400ca5f18 in wxAppBase::MainLoop (this=0x23d41e0) at ../src/common/appcmn.cpp:312
        mainLoop = {<wxEventLoopPtr> = {m_ptr = 0x2e2a640}, m_pp = 0x23d4258, m_pOld = 0x0}
#16 0x00007fc40051f025 in wxEntry (argc=<value optimized out>, argv=<value optimized out>)
    at ../src/common/init.cpp:448
No locales.
#17 0x00000000005d0892 in main (argc=1, argv=0x7fc3f00010b0) at amule-gui.cpp:93
No locales.

Logged

btkaos

  • Global Moderator
  • Sr. Member
  • *****
  • Karma: 110
  • Offline Offline
  • Posts: 486
  • Kaos is infinite!
Re: upredictable memory leak
« Reply #21 on: January 07, 2011, 01:04:24 AM »

Some more backtraces (after continuing and pressing Ctrl-C)

Code: [Select]
(gdb) bt
#0  __pthread_mutex_unlock_usercnt (mutex=0x23a9840) at pthread_mutex_unlock.c:41
#1  __pthread_mutex_unlock (mutex=0x23a9840) at pthread_mutex_unlock.c:290
#2  0x00007fc400583066 in wxMutexInternal::Unlock (this=0x23a9840) at ../src/unix/threadpsx.cpp:297
#3  0x00007fc40082fa84 in wxSocketBase::OnRequest (this=0x485c990, notification=wxSOCKET_OUTPUT)
    at ../src/common/socket.cpp:1006
#4  0x00007fc40083442e in GSocket::Detected_Write (this=0x6459110) at ../src/unix/gsocket.cpp:1836
#5  0x00007fc3fec8399f in gdk_io_invoke (source=<value optimized out>, condition=<value optimized out>,
    data=<value optimized out>) at /build/buildd/gtk+2.0-2.22.0/gdk/gdkevents.c:1082
#6  0x00007fc3fd0ec342 in g_main_dispatch (context=0x23d4780) at /build/buildd/glib2.0-2.26.1/glib/gmain.c:2149
#7  g_main_context_dispatch (context=0x23d4780) at /build/buildd/glib2.0-2.26.1/glib/gmain.c:2702
#8  0x00007fc3fd0f02a8 in g_main_context_iterate (context=0x23d4780, block=<value optimized out>,
    dispatch=<value optimized out>, self=<value optimized out>) at /build/buildd/glib2.0-2.26.1/glib/gmain.c:2780
#9  0x00007fc3fd0f07b5 in g_main_loop_run (loop=0x2c3b4e0) at /build/buildd/glib2.0-2.26.1/glib/gmain.c:2988
#10 0x00007fc3ff0423e7 in IA__gtk_main () at /build/buildd/gtk+2.0-2.22.0/gtk/gtkmain.c:1237
#11 0x00007fc400c15a28 in wxEventLoop::Run (this=0x2e2a640) at ../src/gtk/evtloop.cpp:76
#12 0x00007fc400ca5f18 in wxAppBase::MainLoop (this=0x23d41e0) at ../src/common/appcmn.cpp:312
#13 0x00007fc40051f025 in wxEntry (argc=<value optimized out>, argv=<value optimized out>)
    at ../src/common/init.cpp:448
#14 0x00000000005d0892 in main (argc=1, argv=0x0) at amule-gui.cpp:93
(gdb) bt
#0  sYSMALLOc (av=0x7fc3f0000020, bytes=48) at malloc.c:3432
#1  _int_malloc (av=0x7fc3f0000020, bytes=48) at malloc.c:4747
#2  0x00007fc3ff7ac38e in __libc_malloc (bytes=48) at malloc.c:3660
#3  0x00007fc400005ded in operator new(unsigned long) () from /usr/lib/libstdc++.so.6
#4  0x00007fc400517cdb in wxObjectList::CreateNode (this=0x7fc3f00010b0, prev=0x7fc35c080020, next=0x45, data=0x4,
    key=...) at ../include/wx/list.h:1185
#5  0x00007fc40052b001 in wxListBase::Append (this=0x7fc3f00010b0, object=0x4) at ../src/common/list.cpp:244
#6  0x00007fc40058666d in Append (this=0xc1e500, event=<value optimized out>) at ../include/wx/list.h:1185
#7  wxEvtHandler::AddPendingEvent (this=0xc1e500, event=<value optimized out>) at ../src/common/event.cpp:1156
#8  0x00007fc40082fa84 in wxSocketBase::OnRequest (this=0x485c990, notification=wxSOCKET_OUTPUT)
    at ../src/common/socket.cpp:1006
#9  0x00007fc40083442e in GSocket::Detected_Write (this=0x6459110) at ../src/unix/gsocket.cpp:1836
#10 0x00007fc3fec8399f in gdk_io_invoke (source=<value optimized out>, condition=<value optimized out>,
    data=<value optimized out>) at /build/buildd/gtk+2.0-2.22.0/gdk/gdkevents.c:1082
#11 0x00007fc3fd0ec342 in g_main_dispatch (context=0x23d4780) at /build/buildd/glib2.0-2.26.1/glib/gmain.c:2149
#12 g_main_context_dispatch (context=0x23d4780) at /build/buildd/glib2.0-2.26.1/glib/gmain.c:2702
#13 0x00007fc3fd0f02a8 in g_main_context_iterate (context=0x23d4780, block=<value optimized out>,
    dispatch=<value optimized out>, self=<value optimized out>) at /build/buildd/glib2.0-2.26.1/glib/gmain.c:2780
#14 0x00007fc3fd0f07b5 in g_main_loop_run (loop=0x2c3b4e0) at /build/buildd/glib2.0-2.26.1/glib/gmain.c:2988
#15 0x00007fc3ff0423e7 in IA__gtk_main () at /build/buildd/gtk+2.0-2.22.0/gtk/gtkmain.c:1237
#16 0x00007fc400c15a28 in wxEventLoop::Run (this=0x2e2a640) at ../src/gtk/evtloop.cpp:76
#17 0x00007fc400ca5f18 in wxAppBase::MainLoop (this=0x23d41e0) at ../src/common/appcmn.cpp:312
#18 0x00007fc40051f025 in wxEntry (argc=<value optimized out>, argv=<value optimized out>)
    at ../src/common/init.cpp:448
#19 0x00000000005d0892 in main (argc=1, argv=0x7fc35c080020) at amule-gui.cpp:93



It seems the culprit is clear, However I'm afraid I don't have time to investigate right now, I hate being so busy, I want some fun.
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: upredictable memory leak
« Reply #22 on: January 07, 2011, 02:15:37 PM »

Can you try to build wx yourself and see if that makes a difference?
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

btkaos

  • Global Moderator
  • Sr. Member
  • *****
  • Karma: 110
  • Offline Offline
  • Posts: 486
  • Kaos is infinite!
Re: upredictable memory leak
« Reply #23 on: January 08, 2011, 01:50:07 AM »

No problem, I'll build wx. Some specific version?

Anyways IMVHO I think wx has nothing to do with that bug, it is a case similar to RRM, aMule cannot handle overload. I can see a correspondence about aMule's load and OOM occurences. Well, it could be the wx network code, I'm not familiar enough with it, but somehow aMule should control the rate of new connections.

In fact, right now I've dramatically increased the load (I have 1000 downloads) and aMule cannot be stable even for an hour. It helps I have know a much faster internet connection.

Unded that kind of load, amule either OOM or crashes, I'll modify my script in order to run aMule directly under GDB and stop it in case it starts eating memory.

Regards, BTK.

Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: upredictable memory leak
« Reply #24 on: January 08, 2011, 04:48:40 PM »

No problem, I'll build wx. Some specific version?
2.8.11 please.

Did you set your number of internet connections and you up/down speed to something your machine can handle, or did you set speed to zero ( == max) ?
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

btkaos

  • Global Moderator
  • Sr. Member
  • *****
  • Karma: 110
  • Offline Offline
  • Posts: 486
  • Kaos is infinite!
Re: upredictable memory leak
« Reply #25 on: January 10, 2011, 02:55:16 PM »

Ok building 2.8.11. Anyways I guess the result will be identical to the binary Ubuntu version.

I always run a reasonable upload limit. Using a low download limit shortens the time to crash. Right now I'm running with upload limit set to 0.

I guess my machine can handle it ok (it is a pretty powerful machine), given than aMule runs in this setup about 100/200 minutes before going out of memory or crashing. However I didn't get yet a backtrace of the crashes, only for the OOM.

I'll report back.
Logged

btkaos

  • Global Moderator
  • Sr. Member
  • *****
  • Karma: 110
  • Offline Offline
  • Posts: 486
  • Kaos is infinite!
Re: upredictable memory leak
« Reply #26 on: January 10, 2011, 06:22:36 PM »

Well it seems that disabling the download speed limit (i,e. setting it to 0) enhances aMule's stability. I'll let it running overnight and see what happens.

amule build with local wx is done, but I didn't replace yet my running one.
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: upredictable memory leak
« Reply #27 on: January 10, 2011, 09:23:23 PM »

Please also apply the logging patch.
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

btkaos

  • Global Moderator
  • Sr. Member
  • *****
  • Karma: 110
  • Offline Offline
  • Posts: 486
  • Kaos is infinite!
Re: upredictable memory leak
« Reply #28 on: January 10, 2011, 09:32:14 PM »

Ok patch applied. I guess if another one should be used for the downloads.

Right now amule is running flawlessly with download limit set to zero and very high load (more than reasonable). I'll wait overnight and then I'll set up a download limit and see it that crashes amule. Given that previously (with the limit set) it was crashing very quickly and the backtrace showed an OOM when OnConnect, there must be some flaw in the way the upload throttlers handle the very high load.
Logged

btkaos

  • Global Moderator
  • Sr. Member
  • *****
  • Karma: 110
  • Offline Offline
  • Posts: 486
  • Kaos is infinite!
Re: upredictable memory leak
« Reply #29 on: January 10, 2011, 11:10:37 PM »

Well I got bored after 10 hours of stable amule and did set up a download limit and guess what happened? amule crashed in 5 minutes.

The crash happens earlier given the difference of the limit with the real maximum possible download.

That is to say, my mule was downloading at 800Kb/s without limit, then if I setup the limit at 600 the crash will occur but take much to happen that if I set up the limit at 200Kb/s.

When amule got to 2Gb of RSS I got the following backtrace:
Code: [Select]
Program received signal SIGINT, Interrupt.
0x00007ffff5c21370 in __gnu_debug::_Safe_iterator_base::_M_get_mutex () from /usr/lib/libstdc++.so.6
(gdb) bt
#0  0x00007ffff5c21370 in __gnu_debug::_Safe_iterator_base::_M_get_mutex () from /usr/lib/libstdc++.so.6
#1  0x00007ffff5c2cc4e in __gnu_debug::_Safe_iterator_base::_M_detach() () from /usr/lib/libstdc++.so.6
#2  0x00000000004b268c in CDownloadQueue::CopyFileList (this=0x13c01e0, out_list=...,
    includeCompleted=<value optimized out>) at DownloadQueue.cpp:193
#3  0x000000000063213e in CTransferWnd::UpdateCategory (this=<value optimized out>, index=4,
    titleChanged=<value optimized out>) at TransferWnd.cpp:162
#4  0x00000000006322d0 in CTransferWnd::UpdateCatTabTitles (this=0x15dada0) at TransferWnd.cpp:404
#5  0x000000000064d64b in MuleNotify::HandleNotification (ntf=...) at GuiEvents.cpp:50
#6  0x000000000047e0ed in MuleNotify::DoNotify (func=<value optimized out>) at GuiEvents.h:393
#7  0x0000000000660a59 in CPartFile::Process (this=0x17abf10, reducedownload=<value optimized out>,
    m_icounter=<value optimized out>) at PartFile.cpp:1574
#8  0x00000000004b638d in CDownloadQueue::Process (this=<value optimized out>) at DownloadQueue.cpp:445
#9  0x000000000044d8a7 in CamuleApp::OnCoreTimer (this=0xc68280) at amule.cpp:1176
#10 0x00007ffff6203fe0 in wxEvtHandler::ProcessEventIfMatches (entry=<value optimized out>, handler=0x7fffffffd5a0,
    event=...) at ../src/common/event.cpp:1239
#11 0x00007ffff6205333 in wxEventHashTable::HandleEvent (this=<value optimized out>, event=..., self=0xc68280)
    at ../src/common/event.cpp:906
#12 0x00007ffff62054a8 in wxEvtHandler::ProcessEvent (this=0xc68280, event=...) at ../src/common/event.cpp:1301
#13 0x00007ffff620451d in wxEvtHandler::ProcessPendingEvents (this=0xc68280) at ../src/common/event.cpp:1196
#14 0x00007ffff615e3e9 in wxAppConsole::ProcessPendingEvents (this=<value optimized out>)
    at ../src/common/appbase.cpp:294
#15 0x00007ffff69241bb in wxAppBase::ProcessIdle (this=0x7fffffffd660) at ../src/common/appcmn.cpp:435
#16 0x00007ffff687a8e9 in wxapp_idle_callback () at ../src/gtk/app.cpp:213
#17 0x00007ffff2d6a342 in g_main_dispatch (context=0xc68820) at /build/buildd/glib2.0-2.26.1/glib/gmain.c:2149
#18 g_main_context_dispatch (context=0xc68820) at /build/buildd/glib2.0-2.26.1/glib/gmain.c:2702
#19 0x00007ffff2d6e2a8 in g_main_context_iterate (context=0xc68820, block=<value optimized out>,
    dispatch=<value optimized out>, self=<value optimized out>) at /build/buildd/glib2.0-2.26.1/glib/gmain.c:2780
#20 0x00007ffff2d6e7b5 in g_main_loop_run (loop=0x7fffe405b380) at /build/buildd/glib2.0-2.26.1/glib/gmain.c:2988
#21 0x00007ffff4cc03e7 in IA__gtk_main () at /build/buildd/gtk+2.0-2.22.0/gtk/gtkmain.c:1237
#22 0x00007ffff6893a28 in wxEventLoop::Run (this=0x7fffe41054b0) at ../src/gtk/evtloop.cpp:76
#23 0x00007ffff6923f18 in wxAppBase::MainLoop (this=0xc68280) at ../src/common/appcmn.cpp:312
#24 0x00007ffff619d025 in wxEntry (argc=<value optimized out>, argv=<value optimized out>)
    at ../src/common/init.cpp:448
#25 0x00000000005d0892 in main (argc=1, argv=0x7fffffffd5a0) at amule-gui.cpp:93
(gdb) c

It is useless, but then I tried to continue and got a segfault :)

Code: [Select]
#0  0x00007ffff53e1ba5 in raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x00007ffff53e56b0 in abort () at abort.c:92
#2  0x00007ffff6208d61 in wxFatalSignalHandler () at ../src/unix/utilsunx.cpp:1112
#3  <signal handler called>
#4  __pthread_mutex_lock (mutex=0x545345445f45435a) at pthread_mutex_lock.c:50
#5  0x00007ffff2d69b8a in g_source_unref_internal (source=0x7fffa943b870, context=0x545345445f454352, have_lock=0)
    at /build/buildd/glib2.0-2.26.1/glib/gmain.c:1502
#6  0x00007ffff2d617c0 in g_io_add_watch_full (channel=<value optimized out>, priority=<value optimized out>,
    condition=<value optimized out>, func=0x7ffff4901950 <gdk_io_invoke>, user_data=0x7fffe4223260,
    notify=0x7ffff4901930 <gdk_io_destroy>) at /build/buildd/glib2.0-2.26.1/glib/giochannel.c:671
#7  0x00007ffff49018e6 in IA__gdk_input_add_full (source=<value optimized out>, condition=0,
    function=<value optimized out>, data=0x29ec2b0, destroy=0) at /build/buildd/gtk+2.0-2.22.0/gdk/gdkevents.c:1129
#8  0x00007ffff68953b6 in GSocketGUIFunctionsTableConcrete::Install_Callback (this=<value optimized out>, socket=
    0x29ec2b0, event=<value optimized out>) at ../src/gtk/gsockgtk.cpp:98
#9  0x00007ffff64b167e in GSocket::Write (this=0x29ec2b0, buffer=<value optimized out>, size=<value optimized out>)
    at ../src/unix/gsocket.cpp:1257
#10 0x00007ffff64ad388 in wxSocketBase::_Write (this=0x38856e0, buffer=0x1f66290, nbytes=46)
    at ../src/common/socket.cpp:539
#11 0x00007ffff64ad4dc in wxSocketBase::Write (this=0x545345445f45435a, buffer=0x1, nbytes=1)
    at ../src/common/socket.cpp:507
#12 0x00000000006818ce in CSocketClientProxy::Write (this=0x38856e0, buffer=0x1f66290, nbytes=46) at Proxy.cpp:1309
#13 0x00000000004e3d08 in CEncryptedStreamSocket::Write (this=0x38856e0, lpBuf=0x1f66290, nBufLen=46)
    at EncryptedStreamSocket.cpp:210
#14 0x00000000004e0ec2 in CEMSocket::Send (this=0x38856e0, maxNumberOfBytesToSend=<value optimized out>,
    minFragSize=<value optimized out>, onlyAllowedToSendControlPacket=<value optimized out>) at EMSocket.cpp:572
#15 0x00000000004999a2 in CEMSocket::SendControlData (this=0x545345445f45435a, maxNumberOfBytesToSend=1,
    minFragSize=1) at EMSocket.h:69
#16 0x000000000048e21b in CClientTCPSocket::SendControlData (this=0x545345445f45435a, maxNumberOfBytesToSend=1,
    overchargeMaxBytesToSend=1) at ClientTCPSocket.cpp:2124
#17 0x00000000005747b4 in UploadBandwidthThrottler::Entry (this=<value optimized out>)
    at UploadBandwidthThrottler.cpp:381
#18 0x00007ffff6202dfa in wxThreadInternal::PthreadStart (thread=0x16d7c50) at ../src/unix/threadpsx.cpp:766
#19 0x00007ffff7bc6971 in start_thread (arg=<value optimized out>) at pthread_create.c:304
#20 0x00007ffff549492d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#21 0x0000000000000000 in ?? ()

Umm interesting but the bug should be easy to reproduce. STU, just add lots of donwloads so you will download very fast and then set a small speed limit.

Now starting with my local wx version with the logging patch applied. BTW, I tried to look for DownloadBandwithTrottler and I found nothing :)
Regards,
BTK
Logged
Pages: 1 [2] 3 4 ... 8