aMule Forum

English => Backtraces => Topic started by: staxx on April 13, 2011, 03:56:35 PM

Title: Latest amule svn w/wx 2.8.12 still crashes
Post by: staxx on April 13, 2011, 03:56:35 PM
Hello everybody.

I got latest wxGTK 2.8.12, compiled it with --disable-optimize; compiled amule svn 10525 build with --enable-debug --disable-optimize, but I still experience regular crashes.

Here is backtraces. Other package versions are same as in post http://forum.amule.org/index.php?topic=18777.0 (http://forum.amule.org/index.php?topic=18777.0). Note that amule usually uses something like 600 mb virtual & 90-120 mb resident ram on my system, so I run it with wrapper which sets limits
ulimit -m 1048576 # 1 gb resident max
ulimit -v 3145728 # 3 gb virtual max
so amule is killed before it starts to eat lots of memory and swap heavily, just in case (though it doesn't seem to happen in latest versions). I'm not sure if this crash happened under these conditions (coredump size is 1.6 gb) but I just, well, can't allow amule to hog more resources.


Code: [Select]
Program terminated with signal 6, Aborted.
#0  0x00000030ece329e5 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64   return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
Missing separate debuginfos, use: debuginfo-install gvfs-1.4.3-12.el6.x86_64 libart_lgpl-2.3.20-5.1.el6.x86_64 libcroco-0.6.2-5.el6.x86_64 libgnomecanvas-2.26.0-4.el6.x86_64 libgnomeprint22-2.18.6-4.el6.x86_64 libgnomeprintui22-2.18.4-3.el6.x86_64 libgsf-1.14.15-5.el6.x86_64 librsvg2-2.26.0-5.el6.x86_64 libxml2-2.7.6-1.el6.x86_64
(gdb)
(gdb) bt
#0  0x00000030ece329e5 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x00000030ece341c5 in abort () at abort.c:92
#2  0x000000000073975f in CFileAreaSigHandler::Handler (sig=11, info=0x7fff1ef892b0, ctx=0x7fff1ef89180) at FileArea.cpp:128
#3  <signal handler called>
#4  wxString::UngetWriteBuf (this=0x7fff1ef89750, nLen=0) at src/common/string.cpp:1104
#5  0x00007f8833d95fe9 in ~wxStringBuffer (this=0x7fff1ef89750, pszFormat=0x7e0938 L"%d", argptr=0x7fff1ef89670)
    at include/wx/string.h:1510
#6  wxString::PrintfV(const wxChar *, typedef __va_list_tag __va_list_tag *) (this=0x7fff1ef89750, pszFormat=0x7e0938 L"%d", argptr=
    0x7fff1ef89670) at src/common/string.cpp:1895
#7  0x00007f8833d9623c in wxString::Format (pszFormat=<value optimized out>) at src/common/string.cpp:1810
#8  0x00000000004771e2 in wxString::operator<< (this=0x7fff1ef897f0, i=<value optimized out>) at /usr/include/wx-2.8/wx/string.h:1061
#9  0x000000000063af8f in CLogger::AddLogLine (this=0xcd6c40, file=..., line=239, critical=false, type=<value optimized out>,
    str=<value optimized out>, toStdout=true, toGUI=true) at Logger.cpp:149
#10 0x000000000045d04b in CamuleApp::OnExit (this=0x2521960) at amule.cpp:239
#11 0x00007f8833d78200 in ~CallOnExit (argc=<value optimized out>, argv=<value optimized out>) at src/common/init.cpp:442
#12 wxEntry (argc=<value optimized out>, argv=<value optimized out>) at src/common/init.cpp:448
#13 0x00000000005c98e2 in main (argc=1, argv=<value optimized out>) at amule-gui.cpp:93
(gdb) bt full
#0  0x00000030ece329e5 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
        resultvar = 0
        pid = <value optimized out>
        selftid = 1232
#1  0x00000030ece341c5 in abort () at abort.c:92
        save_stage = 2
        act = {__sigaction_handler = {sa_handler = 0x7f8834067955, sa_sigaction = 0x7f8834067955}, sa_mask = {__val = {9462727472,
    210248880640, 140222965119305, 140733712996080, 140733712994400, 210132560720, 140222961418240, 140222965112597, 4294967295,
    140222965072688, 5, 13026768, 0, 0, 1, 0}}, sa_flags = -329195776, sa_restorer = 0x5}
        sigs = {__val = {32, 0 <repeats 15 times>}}
#2  0x000000000073975f in CFileAreaSigHandler::Handler (sig=11, info=0x7fff1ef892b0, ctx=0x7fff1ef89180) at FileArea.cpp:128
        cur = 0x0
        sa = <value optimized out>
#3  <signal handler called>
No symbol table info available.
#4  wxString::UngetWriteBuf (this=0x7fff1ef89750, nLen=0) at src/common/string.cpp:1104
        pData = 0x7f8833debbc0
#5  0x00007f8833d95fe9 in ~wxStringBuffer (this=0x7fff1ef89750, pszFormat=0x7e0938 L"%d", argptr=0x7fff1ef89670)
    at include/wx/string.h:1510
No locals.
#6  wxString::PrintfV(const wxChar *, typedef __va_list_tag __va_list_tag *) (this=0x7fff1ef89750, pszFormat=0x7e0938 L"%d", argptr=
    0x7fff1ef89670) at src/common/string.cpp:1895
        tmp = {m_str = @0x7fff1ef89750, m_buf = 0x0}
        buf = 0x0
        argptrcopy = {{gp_offset = 469762048, fp_offset = 32648, overflow_arg_area = 0x68, reg_save_area = 0x0}}
        len = <value optimized out>
        size = 1024
#7  0x00007f8833d9623c in wxString::Format (pszFormat=<value optimized out>) at src/common/string.cpp:1810
        argptr = {{gp_offset = 16, fp_offset = 48, overflow_arg_area = 0x7fff1ef89750, reg_save_area = 0x7fff1ef89690}}
        s = {<wxStringBase> = {static npos = 18446744073709551615, m_pchData =
    0x7fff1ef89750 L"\x33debbd8\u7f88\x1ef897f0\u7fff"}, <No data fields>}
#8  0x00000000004771e2 in wxString::operator<< (this=0x7fff1ef897f0, i=<value optimized out>) at /usr/include/wx-2.8/wx/string.h:1061
No locals.
#9  0x000000000063af8f in CLogger::AddLogLine (this=0xcd6c40, file=..., line=239, critical=false, type=<value optimized out>,
    str=<value optimized out>, toStdout=true, toGUI=true) at Logger.cpp:149
        msg = {<wxStringBase> = {static npos = 18446744073709551615, m_pchData =
    0x260ef08 L"\u0412\u044b\u0445\u043e\u0434\u0438\u043c \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f..."}, <No data fields>}
        Event = {<wxEvent> = {<wxObject> = {_vptr.wxObject = 0x0, static ms_classInfo = {m_className = 0x7f8833deaa28 L"wxObject",
                m_objectSize = 16, m_objectConstructor = 0, m_baseInfo1 = 0x0, m_baseInfo2 = 0x0, static sm_first = 0x7f8834b53860,
                m_next = 0x7f88340395c0, static sm_classTable = 0x24d9030}, m_refData = 0x90}, m_eventObject = 0x0, m_eventType = 0,
            m_timeStamp = 0, m_id = 7, m_callbackUserData = 0x7c0000005b, m_propagationLevel = 119, m_skipped = 110, m_isCommandEvent =
---Type <return> to continue, or q <return> to quit---
    false, static ms_classInfo = {m_className = 0x7f8833df0a18 L"wxEvent", m_objectSize = 64, m_objectConstructor = 0, m_baseInfo1 =
    0x7f88340394e0, m_baseInfo2 = 0x0, static sm_first = 0x7f8834b53860, m_next = 0x7f883403b4a0, static sm_classTable = 0x24d9030}},
          m_critical = false, m_stdout = false, m_GUI = 104, m_msg = {<wxStringBase> = {static npos = 18446744073709551615, m_pchData =
    0x7f881c000020 L""}, <No data fields>}}
#10 0x000000000045d04b in CamuleApp::OnExit (this=0x2521960) at amule.cpp:239
No locals.
#11 0x00007f8833d78200 in ~CallOnExit (argc=<value optimized out>, argv=<value optimized out>) at src/common/init.cpp:442
No locals.
#12 wxEntry (argc=<value optimized out>, argv=<value optimized out>) at src/common/init.cpp:448
        initializer = {m_ok = true}
#13 0x00000000005c98e2 in main (argc=1, argv=<value optimized out>) at amule-gui.cpp:93
No locals.
(gdb) thread apply all bt

Thread 2 (Thread 0x7f882b57f700 (LWP 1239)):
#0  0x00000030ed60ed4d in nanosleep () at ../sysdeps/unix/syscall-template.S:82
#1  0x00007f8833dcdefc in wxMicroSleep (microseconds=<value optimized out>) at src/unix/utilsunx.cpp:191
#2  0x000000000057208b in UploadBandwidthThrottler::Entry (this=0x520e1d0) at UploadBandwidthThrottler.cpp:323
#3  0x00007f8833dc94d1 in wxThreadInternal::PthreadStart (thread=0x520e1d0) at src/unix/threadpsx.cpp:766
#4  0x00000030ed6077e1 in start_thread (arg=0x7f882b57f700) at pthread_create.c:301
#5  0x00000030ecee5dcd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115

Thread 1 (Thread 0x7f8833ccc940 (LWP 1232)):
#0  0x00000030ece329e5 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x00000030ece341c5 in abort () at abort.c:92
#2  0x000000000073975f in CFileAreaSigHandler::Handler (sig=11, info=0x7fff1ef892b0, ctx=0x7fff1ef89180) at FileArea.cpp:128
#3  <signal handler called>
#4  wxString::UngetWriteBuf (this=0x7fff1ef89750, nLen=0) at src/common/string.cpp:1104
#5  0x00007f8833d95fe9 in ~wxStringBuffer (this=0x7fff1ef89750, pszFormat=0x7e0938 L"%d", argptr=0x7fff1ef89670)
    at include/wx/string.h:1510
#6  wxString::PrintfV(const wxChar *, typedef __va_list_tag __va_list_tag *) (this=0x7fff1ef89750, pszFormat=0x7e0938 L"%d", argptr=
    0x7fff1ef89670) at src/common/string.cpp:1895
#7  0x00007f8833d9623c in wxString::Format (pszFormat=<value optimized out>) at src/common/string.cpp:1810
#8  0x00000000004771e2 in wxString::operator<< (this=0x7fff1ef897f0, i=<value optimized out>) at /usr/include/wx-2.8/wx/string.h:1061
#9  0x000000000063af8f in CLogger::AddLogLine (this=0xcd6c40, file=..., line=239, critical=false, type=<value optimized out>,
    str=<value optimized out>, toStdout=true, toGUI=true) at Logger.cpp:149
#10 0x000000000045d04b in CamuleApp::OnExit (this=0x2521960) at amule.cpp:239
#11 0x00007f8833d78200 in ~CallOnExit (argc=<value optimized out>, argv=<value optimized out>) at src/common/init.cpp:442
#12 wxEntry (argc=<value optimized out>, argv=<value optimized out>) at src/common/init.cpp:448
#13 0x00000000005c98e2 in main (argc=1, argv=<value optimized out>) at amule-gui.cpp:93
Title: Re: Latest amule svn w/wx 2.8.12 still crashes
Post by: btkaos on April 13, 2011, 04:07:18 PM
Weird. Any steps to reproduce the crash? It seems you are using some kind of Fedora system, please specify that.

Also, does the crash happens if you compile everything with --disable-debug and --enable-optimize?

Regards,
BTK
Title: Re: Latest amule svn w/wx 2.8.12 still crashes
Post by: staxx on April 13, 2011, 09:50:08 PM
This is redhat 6 system.
Versions of some packages

glibc-2.12-1.19.el6.x86_64
libstdc++-4.4.5-6.el6.x86_64
gcc-4.4.5-6.el6.x86_64
gtk2-2.18.9-6.el6.x86_64
wxGTK-2.8.12-1.el6.x86_64
cryptopp-5.6.1-4.el6.x86_64

Crash happens with amule just downloading/uploading files on some desktop, at some point it disappears, leaving coredump.

--disable-debug --enable-optimize for amule -yes, it happens, I used such version before, just rebuild it with --disable-optimize now to get possibly better crash dump.
I don't think wxGTK was ever built with --enable-optimize, because it seems that --disable-optimize is typical for fedora and epel wxGTK builds. However it doesn't mean that optimization flags aren't used, as rpm sets typical optimization flags anyway. I really don't know why it's build this way, it's just the way wxGTK is always built lately for these systems by package maintainers.
Title: Re: Latest amule svn w/wx 2.8.12 still crashes
Post by: Stu Redman on April 14, 2011, 12:01:51 AM
Not really a crash. Looks like it got killed and somehow stumbled on shutdown (shutting it down proper is not trivial and may easily fail when it gets killed). Question is, why is it still eating so much memory?
Title: Re: Latest amule svn w/wx 2.8.12 still crashes
Post by: staxx on April 14, 2011, 10:52:11 AM
Here is another one, crashed few hours after starting. This coredump is small, so amule wasn't killed because of memory limit:

Code: [Select]
Core was generated by `/usr/bin/amule'.
Program terminated with signal 6, Aborted.
#0  0x00000030ece329e5 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64   return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
Missing separate debuginfos, use: debuginfo-install libart_lgpl-2.3.20-5.1.el6.x86_64 libgnomecanvas-2.26.0-4.el6.x86_64 libgnomeprint22-2.18.6-4.el6.x86_64 libgnomeprintui22-2.18.4-3.el6.x86_64 libxml2-2.7.6-1.el6.x86_64
(gdb) bt
#0  0x00000030ece329e5 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x00000030ece341c5 in abort () at abort.c:92
#2  0x000000000073975f in CFileAreaSigHandler::Handler (sig=11, info=0x7fff3d4028f0, ctx=0x7fff3d4027c0)
    at FileArea.cpp:128
#3  <signal handler called>
#4  0x0000000008231880 in ?? ()
#5  0x00000030f822462f in gdk_io_invoke (source=<value optimized out>, condition=<value optimized out>, data=
    0x7fd588001880) at gdkevents.c:1082
#6  0x00000030eca38f0e in g_main_dispatch (context=0x194bf30) at gmain.c:1960
#7  IA__g_main_context_dispatch (context=0x194bf30) at gmain.c:2513
#8  0x00000030eca3c938 in g_main_context_iterate (context=0x194bf30, block=1, dispatch=1,
    self=<value optimized out>) at gmain.c:2591
#9  0x00000030eca3cd55 in IA__g_main_loop_run (loop=0x552f280) at gmain.c:2799
#10 0x00000030f974c2c7 in IA__gtk_main () at gtkmain.c:1218
#11 0x00000036bbfe78f8 in wxEventLoop::Run (this=0x19f2a80) at src/gtk/evtloop.cpp:76
#12 0x00000036bc06216b in wxAppBase::MainLoop (this=0x194b960) at src/common/appcmn.cpp:312
#13 0x00000036bb6961c5 in wxEntry (argc=<value optimized out>, argv=<value optimized out>)
    at src/common/init.cpp:448
#14 0x00000000005c98e2 in main (argc=1, argv=<value optimized out>) at amule-gui.cpp:93
(gdb) bt full
#0  0x00000030ece329e5 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
        resultvar = 0
        pid = <value optimized out>
        selftid = 24495
#1  0x00000030ece341c5 in abort () at abort.c:92
        save_stage = 2
        act = {__sigaction_handler = {sa_handler = 0x1, sa_sigaction = 0x1}, sa_mask = {__val = {1, 26619152, 0,
    79, 210166197551, 26619152, 0, 79, 210166197551, 0, 210128513053, 1, 75925488, 1, 26619152,
    140734221002800}}, sa_flags = 79, sa_restorer = 0x30ecce5180 <g_threads_got_initialized>}
        sigs = {__val = {32, 0 <repeats 15 times>}}
#2  0x000000000073975f in CFileAreaSigHandler::Handler (sig=11, info=0x7fff3d4028f0, ctx=0x7fff3d4027c0)
    at FileArea.cpp:128
        cur = 0x0
        sa = <value optimized out>
#3  <signal handler called>
No symbol table info available.
#4  0x0000000008231880 in ?? ()
No symbol table info available.
#5  0x00000030f822462f in gdk_io_invoke (source=<value optimized out>, condition=<value optimized out>, data=
    0x7fd588001880) at gdkevents.c:1082
        closure = 0x7fd588001880
        gdk_cond = GDK_INPUT_WRITE
#6  0x00000030eca38f0e in g_main_dispatch (context=0x194bf30) at gmain.c:1960
        dispatch = 0x30eca6e2f0 <g_io_unix_dispatch>
        was_in_call = 0
        user_data = 0x7fd588001880
        callback = 0x30f82245e0 <gdk_io_invoke>
        cb_funcs = 0x30ecce4970
        cb_data = 0x7fd588002630
        current_source_link = {data = 0x7fd5880026a0, next = 0x0}
        need_destroy = <value optimized out>
        source = 0x7fd5880026a0
        current = 0x46a4340
        i = <value optimized out>
---Type <return> to continue, or q <return> to quit---
#7  IA__g_main_context_dispatch (context=0x194bf30) at gmain.c:2513
No locals.
#8  0x00000030eca3c938 in g_main_context_iterate (context=0x194bf30, block=1, dispatch=1,
    self=<value optimized out>) at gmain.c:2591
        max_priority = 2147483647
        timeout = 9
        some_ready = 1
        nfds = 523
        allocated_nfds = <value optimized out>
        fds = <value optimized out>
        __PRETTY_FUNCTION__ = "g_main_context_iterate"
#9  0x00000030eca3cd55 in IA__g_main_loop_run (loop=0x552f280) at gmain.c:2799
        self = 0x194cd80
        __PRETTY_FUNCTION__ = "IA__g_main_loop_run"
#10 0x00000030f974c2c7 in IA__gtk_main () at gtkmain.c:1218
        tmp_list = <value optimized out>
        functions = 0x0
        init = <value optimized out>
        loop = 0x552f280
#11 0x00000036bbfe78f8 in wxEventLoop::Run (this=0x19f2a80) at src/gtk/evtloop.cpp:76
        activate = {m_evtLoopOld = 0x0}
        exitcode = <value optimized out>
#12 0x00000036bc06216b in wxAppBase::MainLoop (this=0x194b960) at src/common/appcmn.cpp:312
        mainLoop = {<wxEventLoopPtr> = {m_ptr = 0x19f2a80}, m_pp = 0x194b9d8, m_pOld = 0x0}
#13 0x00000036bb6961c5 in wxEntry (argc=<value optimized out>, argv=<value optimized out>)
    at src/common/init.cpp:448
        initializer = {m_ok = true}
#14 0x00000000005c98e2 in main (argc=1, argv=<value optimized out>) at amule-gui.cpp:93
No locals.
(gdb) thread apply all bt

Thread 3 (Thread 0x7fd597285700 (LWP 24512)):
#0  pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:216
#1  0x00000036bb6e5be6 in wxConditionInternal::WaitTimeout (this=0x1a39130, milliseconds=100)
    at src/unix/threadpsx.cpp:405
#2  0x00000036bb6e7063 in wxSemaphoreInternal::WaitTimeout (this=0x510dfc0, milliseconds=100)
    at src/unix/threadpsx.cpp:552
#3  0x00000000006987bd in CTimerThread::Entry (this=0x5520710) at Timer.cpp:66
#4  0x00000036bb6e74d1 in wxThreadInternal::PthreadStart (thread=0x5520710) at src/unix/threadpsx.cpp:766
#5  0x00000030ed6077e1 in start_thread (arg=0x7fd597285700) at pthread_create.c:301
#6  0x00000030ecee5dcd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115

Thread 2 (Thread 0x7fd59cba7700 (LWP 24508)):
#0  0x00000030ed60ed4d in nanosleep () at ../sysdeps/unix/syscall-template.S:82
#1  0x00000036bb6ebefc in wxMicroSleep (microseconds=<value optimized out>) at src/unix/utilsunx.cpp:191
#2  0x000000000057208b in UploadBandwidthThrottler::Entry (this=0x4652fc0) at UploadBandwidthThrottler.cpp:323
#3  0x00000036bb6e74d1 in wxThreadInternal::PthreadStart (thread=0x4652fc0) at src/unix/threadpsx.cpp:766
#4  0x00000030ed6077e1 in start_thread (arg=0x7fd59cba7700) at pthread_create.c:301
#5  0x00000030ecee5dcd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115

Thread 1 (Thread 0x7fd5a52f1940 (LWP 24495)):
#0  0x00000030ece329e5 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x00000030ece341c5 in abort () at abort.c:92
#2  0x000000000073975f in CFileAreaSigHandler::Handler (sig=11, info=0x7fff3d4028f0, ctx=0x7fff3d4027c0)
    at FileArea.cpp:128
#3  <signal handler called>
#4  0x0000000008231880 in ?? ()
#5  0x00000030f822462f in gdk_io_invoke (source=<value optimized out>, condition=<value optimized out>, data=
    0x7fd588001880) at gdkevents.c:1082
#6  0x00000030eca38f0e in g_main_dispatch (context=0x194bf30) at gmain.c:1960
#7  IA__g_main_context_dispatch (context=0x194bf30) at gmain.c:2513
#8  0x00000030eca3c938 in g_main_context_iterate (context=0x194bf30, block=1, dispatch=1,
    self=<value optimized out>) at gmain.c:2591
#9  0x00000030eca3cd55 in IA__g_main_loop_run (loop=0x552f280) at gmain.c:2799
---Type <return> to continue, or q <return> to quit---
#10 0x00000030f974c2c7 in IA__gtk_main () at gtkmain.c:1218
#11 0x00000036bbfe78f8 in wxEventLoop::Run (this=0x19f2a80) at src/gtk/evtloop.cpp:76
#12 0x00000036bc06216b in wxAppBase::MainLoop (this=0x194b960) at src/common/appcmn.cpp:312
#13 0x00000036bb6961c5 in wxEntry (argc=<value optimized out>, argv=<value optimized out>)
    at src/common/init.cpp:448
#14 0x00000000005c98e2 in main (argc=1, argv=<value optimized out>) at amule-gui.cpp:93
Title: Re: Latest amule svn w/wx 2.8.12 still crashes
Post by: btkaos on April 14, 2011, 11:30:58 AM
Here is another one, crashed few hours after starting. This coredump is small, so amule wasn't killed because of memory limit:

Code: [Select]
#3  <signal handler called>
#4  0x0000000008231880 in ?? ()
#5  0x00000030f822462f in gdk_io_invoke (source=<value optimized out>, condition=<value optimized out>, data=
    0x7fd588001880) at gdkevents.c:1082
#6  0x00000030eca38f0e in g_main_dispatch (context=0x194bf30) at gmain.c:1960
#7  IA__g_main_context_dispatch (context=0x194bf30) at gmain.c:2513
#8  0x00000030eca3c938 in g_main_context_iterate (context=0x194bf30, block=1, dispatch=1,
    self=<value optimized out>) at gmain.c:2591
Umm, more glib context corruption problems. The problem may be complicated to debug, as wxsockets layer mess with events in every read and write. (which is part of the bad performance of aMule)

Every read performs a Disable/Enable pair, and in some place the context gets corrupted. We have another race in wx no doubt. (Assuming the user did really use wx 2.8.12, maybe static linking prevented that)

We should check that those operations are really thread safe.
Title: Re: Latest amule svn w/wx 2.8.12 still crashes
Post by: btkaos on April 14, 2011, 04:43:56 PM
A pointer to investigate is the following code in glib's gmain.c:

Code: [Select]
  UNLOCK_CONTEXT (context);

  current->depth++;
  /* The on-stack allocation of the GSList is unconventional, but
   * we know that the lifetime of the link is bounded to this
   * function as the link is kept in a thread specific list and
   * not manipulated outside of this function and its descendants.
   * Avoiding the overhead of a g_slist_alloc() is useful as many
   * applications do little more than dispatch events.
   *
   * This is a performance hack - do not revert to g_slist_prepend()!
   */
  current_source_link.data = source;
  current_source_link.next = current->dispatching_sources;
  current->dispatching_sources = &current_source_link;
  need_destroy = ! dispatch (source,
     callback,
     user_data);
  g_assert (current->dispatching_sources == &current_source_link);
  current->dispatching_sources = current_source_link.next;
  current->depth--;
 
  if (cb_funcs)
    cb_funcs->unref (cb_data);

    LOCK_CONTEXT (context);

This is the only place I can see the context could get corrupted. But how? I need to investigate more on wx threads and events. Note however that the upload thread may manipulate the context when doing a Read (Write too?) via Disable, so here may be the source of the crashes.

Local lock in Kry's patch may not be enough, as the context is shared for all thread, wx socket layer may need a global lock.

My explanations are not very good, please ask for more if needed.
Title: Re: Latest amule svn w/wx 2.8.12 still crashes
Post by: staxx on April 18, 2011, 04:34:37 AM
Well it's definitely dynamically linked with wx 2.8.12 built by me. Looks like there is more "official" build in epel-testing repository now, though I don't see a reason why it would work differently, as I used same spec.  Glib version is glib2-2.22.5-6.el6.x86_64

Is there any fix for this problem planned, or you need some more info from me? I'm getting these crashes very often, since Apr 14 amule has crashed 5 times already for me :( All the backtraces look just like these ones, sometimes with order of threads different. Function "UploadBandwidthThrottler::Entry" can be seen in all backtraces, but it would be impossible to disable upload limit, I don't want amule to hog whole channel.. I don't mind rebuilding amule with some other options, if needed, these crashes are way more annoying than anything else.
Title: Re: Latest amule svn w/wx 2.8.12 still crashes
Post by: btkaos on April 18, 2011, 05:57:01 PM
Is there any fix for this problem planned, or you need some more info from me? I'm getting these crashes very often, since Apr 14 amule has crashed 5 times already for me :( All the backtraces look just like these ones, sometimes with order of threads different. Function "UploadBandwidthThrottler::Entry" can be seen in all backtraces, but it would be impossible to disable upload limit, I don't want amule to hog whole channel.. I don't mind rebuilding amule with some other options, if needed, these crashes are way more annoying than anything else.
staxx, I have some idea of what is causing these kind of problems, (different threads enabling/disabling events on the same socket) but the fix will be hard and take a lot of time.

For now, I recommend running amule without download limit and not a lot of files. To do so, pause the less important files and the crash should disappear. The more people you are uploading/downloading, the more likely the crash will occur.
Title: Re: Latest amule svn w/wx 2.8.12 still crashes
Post by: kristof on April 29, 2011, 06:30:26 AM
Quote
staxx, I have some idea of what is causing these kind of problems, (different threads enabling/disabling events on the same socket) but the fix will be hard and take a lot of time.

I have this bug too.  aMule 2.3.1.rc1 with wx 2.8.12 on Ubuntu Maverick.  With download limit set and many downloads aMule crashes in 1-2 hours.  All bt have a thread that is inside UploadBandwidthThrottler::Entry.

Would you share your idea for a fix?  Some desperate users might to try to implement on their own while waiting for official fix. Even a temporary dirty hack we can do on our own would be better than crashes.  Maybe a global mutex in some critical places? I am not above hacking at wx. :)
Title: Re: Latest amule svn w/wx 2.8.12 still crashes
Post by: btkaos on April 29, 2011, 03:21:04 PM
Quote
staxx, I have some idea of what is causing these kind of problems, (different threads enabling/disabling events on the same socket) but the fix will be hard and take a lot of time.

I have this bug too.  aMule 2.3.1.rc1 with wx 2.8.12 on Ubuntu Maverick.  With download limit set and many downloads aMule crashes in 1-2 hours.  All bt have a thread that is inside UploadBandwidthThrottler::Entry.

Would you share your idea for a fix?  Some desperate users might to try to implement on their own while waiting for official fix. Even a temporary dirty hack we can do on our own would be better than crashes.  Maybe a global mutex in some critical places? I am not above hacking at wx. :)
I believe that the problem is basically that the event handling/disabling code is not safe even in glib/gtk, there may be a small window somewhere.

kristof, are you sure you are using wx 2.8.12?
Title: Re: Latest amule svn w/wx 2.8.12 still crashes
Post by: kristof on April 29, 2011, 09:22:51 PM
I believe that the problem is basically that the event handling/disabling code is not safe even in glib/gtk, there may be a small window somewhere.

kristof, are you sure you are using wx 2.8.12?

I will build and deploy amule on a machine that does not have wx distribution packages so that I can be completely certain.  I thought I had done this already but I see that my compile machine has distribution packages installed.  I am surprised to see until I remembered that I am lazy.  I installed complete builddeps for amule instead of installing required dependencies one by one.

Thanks for asking this!
Title: Re: Latest amule svn w/wx 2.8.12 still crashes
Post by: btkaos on April 30, 2011, 12:06:13 AM
I believe that the problem is basically that the event handling/disabling code is not safe even in glib/gtk, there may be a small window somewhere.

kristof, are you sure you are using wx 2.8.12?

I will build and deploy amule on a machine that does not have wx distribution packages so that I can be completely certain.  I thought I had done this already but I see that my compile machine has distribution packages installed.  I am surprised to see until I remembered that I am lazy.  I installed complete builddeps for amule instead of installing required dependencies one by one.

Thanks for asking this!

kristof, you may use the ldd command in order to see what libraries you are using.
Title: Re: Latest amule svn w/wx 2.8.12 still crashes
Post by: btkaos on April 30, 2011, 12:07:28 AM
By the way, this is difficult to fix right now because wx 2.9 had a rewrite of sockets code, so I'm waiting until wx can be built against gtk head to start writing patches.
Title: Re: Latest amule svn w/wx 2.8.12 still crashes
Post by: kristof on April 30, 2011, 05:30:40 PM
I removed all distribution wx packages and rebuilt.  I am certain aMule uses wx 2.8.12 which I compile myself.  It is also verified with ldd.

There were three crashes in one evening and one over the nighttime.  I checked bt each time and all have the usual pattern with segv just after
Code: [Select]
_GSocket_GDK_Input (data=0x2db1b90, source=45, condition=GDK_INPUT_WRITE) at ./src/gtk/gsockgtk.cpp:43
Quote
By the way, this is difficult to fix right now because wx 2.9 had a rewrite of sockets code, so I'm waiting until wx can be built against gtk head to start writing patches.

It is understandable that you must wait to attack the bug.  External dependencies force such things.

Can crash probability be decreased by restricting total connection count?  I think of disabling kad, reducing maximum connection count in preferences, etc.  Else is it only the number of uploads and downloads at each instant that matters?  I understand it may be a guess!  :)
Title: Re: Latest amule svn w/wx 2.8.12 still crashes
Post by: btkaos on April 30, 2011, 06:09:04 PM
I removed all distribution wx packages and rebuilt.  I am certain aMule uses wx 2.8.12 which I compile myself.  It is also verified with ldd.

There were three crashes in one evening and one over the nighttime.  I checked bt each time and all have the usual pattern with segv just after
Code: [Select]
_GSocket_GDK_Input (data=0x2db1b90, source=45, condition=GDK_INPUT_WRITE) at ./src/gtk/gsockgtk.cpp:43
Quote
By the way, this is difficult to fix right now because wx 2.9 had a rewrite of sockets code, so I'm waiting until wx can be built against gtk head to start writing patches.

It is understandable that you must wait to attack the bug.  External dependencies force such things.

Can crash probability be decreased by restricting total connection count?  I think of disabling kad, reducing maximum connection count in preferences, etc.  Else is it only the number of uploads and downloads at each instant that matters?  I understand it may be a guess!  :)
Well kristof, you may try to reduce the number of active downloads/uploads. That is, start pausing files until amule stop crashing. Once you manage that, it would be helpful to know what the limit is, so I'll try to reproduce.
Title: Re: Latest amule svn w/wx 2.8.12 still crashes
Post by: kristof on April 30, 2011, 11:50:21 PM
Well kristof, you may try to reduce the number of active downloads/uploads. That is, start pausing files until amule stop crashing. Once you manage that, it would be helpful to know what the limit is, so I'll try to reproduce.

I will do that.  However, I can give an upper limit start.  With the following I crash aMule in 1-2 hours:

kad enabled
max simultaneousness connections 250
max new connections / 5 seconds 25
downloads 800
upload limit 64KB/second
download 150KB/second
slot allocation 4KB/sec

Overwhelming majority of files have few/slow/no sources.  Only 10-15 maximum can be seen to actively download at one time. Usually it is less than 10.

I also reported a high cpu use bug in this thread http://forum.amule.org/index.php?topic=18867.0  I don't know if these are related.  High cpu does not always happen.  Socket bug always happens.

It seems that disabling kad helps runtime but I have not yet kept records well enough to support my feeling.
Title: Re: Latest amule svn w/wx 2.8.12 still crashes
Post by: Stu Redman on May 01, 2011, 05:56:31 AM
I'd rather try limiting the number of connections than pause downloads.
Title: Re: Latest amule svn w/wx 2.8.12 still crashes
Post by: kristof on May 02, 2011, 03:55:11 AM
I'd rather try limiting the number of connections than pause downloads.

In Preferences / Connection / Max simultaneous connections ?
Title: Re: Latest amule svn w/wx 2.8.12 still crashes
Post by: Stu Redman on May 02, 2011, 10:15:54 PM
Yes.
Title: Re: Latest amule svn w/wx 2.8.12 still crashes
Post by: kristof on May 03, 2011, 12:50:19 AM
Latest trial:

kad disabled
max simultaneousness connections 100
max new connections / 5 seconds 25
downloads 800 (about 150 are stopped state)
upload limit 64KB/second
download 150KB/second
slot allocation 4KB/sec

aMule ran just less than 24 hours.
Title: Re: Latest amule svn w/wx 2.8.12 still crashes
Post by: btkaos on May 03, 2011, 05:53:38 PM
kristof, you could try running amule under gdb, maybe the backtrace will help.
Title: Re: Latest amule svn w/wx 2.8.12 still crashes
Post by: kristof on May 03, 2011, 07:00:07 PM
Lately, I always run amule under gdb.  I look at backtraces after every crash but I have stopped saving them because they all look the same.  It is always a segv in _GSocket_GDK_Input.  The backtrace of the offending thread is always the same.  I included below one of the last that I saved.

I can post all backtraces for future crashes if it is worthwhile.  I did not want to flood the thread with redundant information.

Code: [Select]
Program received signal SIGSEGV, Segmentation fault.
0x0000000002db1b80 in ?? ()
(gdb)


(gdb) bt
#0  0x0000000002db1b80 in ?? ()
#1  0x000000000096ca64 in _GSocket_GDK_Input (data=0x2db1b90, source=45,
    condition=GDK_INPUT_WRITE) at ./src/gtk/gsockgtk.cpp:43
#2  0x00007ffff675499f in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#3  0x00007ffff4996342 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#4  0x00007ffff499a2a8 in ?? () from /lib/libglib-2.0.so.0
#5  0x00007ffff499a7b5 in g_main_loop_run () from /lib/libglib-2.0.so.0
#6  0x00007ffff6b133e7 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#7  0x000000000096c780 in wxEventLoop::Run (this=0x1a9a180)
    at ./src/gtk/evtloop.cpp:76
#8  0x00000000008c81ea in wxAppBase::MainLoop (this=0x11eb310)
    at ./src/common/appcmn.cpp:312
#9  0x00000000008c8364 in wxAppBase::OnRun (this=0x11eb310)
    at ./src/common/appcmn.cpp:367
#10 0x00000000009f952f in wxEntry (argc=@0x11ae6d0, argv=0x11da790)
    at ./src/common/init.cpp:448
#11 0x00000000009f9603 in wxEntry (argc=@0x7fffffffe2ac, argv=0x7fffffffe398)
    at ./src/common/init.cpp:460
#12 0x0000000000638542 in main (argc=1, argv=0x7fffffffe398)
    at amule-gui.cpp:93
(gdb)


(gdb) bt full
#0  0x0000000002db1b80 in ?? ()
No symbol table info available.
#1  0x000000000096ca64 in _GSocket_GDK_Input (data=0x2db1b90, source=45,
    condition=GDK_INPUT_WRITE) at ./src/gtk/gsockgtk.cpp:43
        socket = 0x2db1b90
#2  0x00007ffff675499f in ?? () from /usr/lib/libgdk-x11-2.0.so.0
No symbol table info available.
#3  0x00007ffff4996342 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
No symbol table info available.
#4  0x00007ffff499a2a8 in ?? () from /lib/libglib-2.0.so.0
No symbol table info available.
#5  0x00007ffff499a7b5 in g_main_loop_run () from /lib/libglib-2.0.so.0
No symbol table info available.
#6  0x00007ffff6b133e7 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
No symbol table info available.
#7  0x000000000096c780 in wxEventLoop::Run (this=0x1a9a180)
    at ./src/gtk/evtloop.cpp:76
        __FUNCTION__ = "Run"
        activate = {m_evtLoopOld = 0x0}
        exitcode = 0
#8  0x00000000008c81ea in wxAppBase::MainLoop (this=0x11eb310)
    at ./src/common/appcmn.cpp:312
        mainLoop = {<wxEventLoopPtr> = {m_ptr = 0x1a9a180}, m_pp = 0x11eb388,
---Type <return> to continue, or q <return> to quit---
          m_pOld = 0x0}
#9  0x00000000008c8364 in wxAppBase::OnRun (this=0x11eb310)
    at ./src/common/appcmn.cpp:367
No locals.
#10 0x00000000009f952f in wxEntry (argc=@0x11ae6d0, argv=0x11da790)
    at ./src/common/init.cpp:448
        callOnExit = {<No data fields>}
        initializer = {m_ok = true}
#11 0x00000000009f9603 in wxEntry (argc=@0x7fffffffe2ac, argv=0x7fffffffe398)
    at ./src/common/init.cpp:460
No locals.
#12 0x0000000000638542 in main (argc=1, argv=0x7fffffffe398)
    at amule-gui.cpp:93
No locals.
(gdb)




(gdb) thread apply all bt

Thread 5 (Thread 0x7fffe75f8700 (LWP 14150)):
#0  0x00007ffff7bcae09 in pthread_cond_timedwait@@GLIBC_2.3.2 ()
   from /lib/libpthread.so.0
#1  0x0000000000a5e1a7 in wxConditionInternal::WaitTimeout (this=0x1b647b0,
    milliseconds=100) at ./src/unix/threadpsx.cpp:405
#2  0x0000000000a60f80 in wxCondition::WaitTimeout (this=0x1b67eb8,
    milliseconds=100) at ./include/wx/thrimpl.cpp:258
#3  0x0000000000a5e6e7 in wxSemaphoreInternal::WaitTimeout (this=0x1b67eb0,
    milliseconds=100) at ./src/unix/threadpsx.cpp:552
#4  0x0000000000a612e2 in wxSemaphore::WaitTimeout (this=0x2308388,
    milliseconds=100) at ./include/wx/thrimpl.cpp:322
#5  0x000000000078090a in CTimerThread::Entry (this=0x2308350) at Timer.cpp:66
#6  0x0000000000a5e9ae in wxThreadInternal::PthreadStart (thread=0x2308350)
    at ./src/unix/threadpsx.cpp:766
#7  0x0000000000a5e85e in wxPthreadStart (ptr=0x2308350)
    at ./src/unix/threadpsx.cpp:718
#8  0x00007ffff7bc6971 in start_thread () from /lib/libpthread.so.0
#9  0x00007ffff390a92d in clone () from /lib/libc.so.6
#10 0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7fffed3e3700 (LWP 14147)):
#0  0x00000000005ceae8 in std::__norm::_Deque_iterator<ThrottledControlSocket*, ---Type <return> to continue, or q <return> to quit---
ThrottledControlSocket*&, ThrottledControlSocket**>::operator++ (
    this=0x7fffed3e1410) at /usr/include/c++/4.4/bits/stl_deque.h:136
#1  0x00000000005d6a8c in std::__copy_move<false, false, std::random_access_iterator_tag>::__copy_m<__gnu_debug::_Safe_iterator<std::__norm::_Deque_iterator<ThrottledControlSocket*, ThrottledControlSocket*&, ThrottledControlSocket**>, std::__debug::deque<ThrottledControlSocket*, std::allocator<ThrottledControlSocket*> > >, std::__norm::_Deque_iterator<ThrottledControlSocket*, ThrottledControlSocket*&, ThrottledControlSocket**> > (__first=..., __last=..., __result=...)
    at /usr/include/c++/4.4/bits/stl_algobase.h:345
#2  0x00000000005d6475 in std::__copy_move_a<false, __gnu_debug::_Safe_iterator<std::__norm::_Deque_iterator<ThrottledControlSocket*, ThrottledControlSocket*&, ThrottledControlSocket**>, std::__debug::deque<ThrottledControlSocket*, std::allocator<ThrottledControlSocket*> > >, std::__norm::_Deque_iterator<ThrottledControlSocket*, ThrottledControlSocket*&, ThrottledControlSocket**> > (__first=...,
    __last=..., __result=...) at /usr/include/c++/4.4/bits/stl_algobase.h:397
#3  0x00000000005d5b12 in std::__copy_move_a2<false, __gnu_debug::_Safe_iterator<std::__norm::_Deque_iterator<ThrottledControlSocket*, ThrottledControlSocket*&, ThrottledControlSocket**>, std::__debug::deque<ThrottledControlSocket*, std::allocator<ThrottledControlSocket*> > >, std::__norm::_Deque_iterator<ThrottledControlSocket*, ThrottledControlSocket*&, ThrottledControlSocket**> > (
    __first=..., __last=..., __result=...)
    at /usr/include/c++/4.4/bits/stl_algobase.h:436
#4  0x00000000005d472f in std::copy<__gnu_debug::_Safe_iterator<std::__norm::_De---Type <return> to continue, or q <return> to quit---
que_iterator<ThrottledControlSocket*, ThrottledControlSocket*&, ThrottledControlSocket**>, std::__debug::deque<ThrottledControlSocket*, std::allocator<ThrottledControlSocket*> > >, std::__norm::_Deque_iterator<ThrottledControlSocket*, ThrottledControlSocket*&, ThrottledControlSocket**> > (__first=..., __last=...,
    __result=...) at /usr/include/c++/4.4/bits/stl_algobase.h:468
#5  0x00000000005d591b in std::__uninitialized_copy<true>::uninitialized_copy<__gnu_debug::_Safe_iterator<std::__norm::_Deque_iterator<ThrottledControlSocket*, ThrottledControlSocket*&, ThrottledControlSocket**>, std::__debug::deque<ThrottledControlSocket*, std::allocator<ThrottledControlSocket*> > >, std::__norm::_Deque_iterator<ThrottledControlSocket*, ThrottledControlSocket*&, ThrottledControlSocket**> > (__first=..., __last=..., __result=...)
    at /usr/include/c++/4.4/bits/stl_uninitialized.h:93
#6  0x00000000005d43b9 in std::uninitialized_copy<__gnu_debug::_Safe_iterator<std::__norm::_Deque_iterator<ThrottledControlSocket*, ThrottledControlSocket*&, ThrottledControlSocket**>, std::__debug::deque<ThrottledControlSocket*, std::allocator<ThrottledControlSocket*> > >, std::__norm::_Deque_iterator<ThrottledControlSocket*, ThrottledControlSocket*&, ThrottledControlSocket**> > (__first=...,
    __last=..., __result=...)
    at /usr/include/c++/4.4/bits/stl_uninitialized.h:117
#7  0x00000000005d2664 in std::__uninitialized_copy_a<__gnu_debug::_Safe_iterator<std::__norm::_Deque_iterator<ThrottledControlSocket*, ThrottledControlSocket*&, ThrottledControlSocket**>, std::__debug::deque<ThrottledControlSocket*, std::allocator<ThrottledControlSocket*> > >, std::__norm::_Deque_iterator<ThrottledCon---Type <return> to continue, or q <return> to quit---
trolSocket*, ThrottledControlSocket*&, ThrottledControlSocket**>, ThrottledControlSocket*> (__first=..., __last=..., __result=...)
    at /usr/include/c++/4.4/bits/stl_uninitialized.h:257
#8  0x00000000005d0b49 in std::__norm::deque<ThrottledControlSocket*, std::allocator<ThrottledControlSocket*> >::_M_range_insert_aux<__gnu_debug::_Safe_iterator<std::__norm::_Deque_iterator<ThrottledControlSocket*, ThrottledControlSocket*&, ThrottledControlSocket**>, std::__debug::deque<ThrottledControlSocket*, std::allocator<ThrottledControlSocket*> > > > (this=0x193a608, __pos=...,
    __first=..., __last=...) at /usr/include/c++/4.4/bits/deque.tcc:473
#9  0x00000000005cee3c in std::__norm::deque<ThrottledControlSocket*, std::allocator<ThrottledControlSocket*> >::_M_insert_dispatch<__gnu_debug::_Safe_iterator<std::__norm::_Deque_iterator<ThrottledControlSocket*, ThrottledControlSocket*&, ThrottledControlSocket**>, std::__debug::deque<ThrottledControlSocket*, std::allocator<ThrottledControlSocket*> > > > (this=0x193a608, __pos=..., __first=...,
    __last=...) at /usr/include/c++/4.4/bits/stl_deque.h:1593
#10 0x00000000005cd0a0 in std::__norm::deque<ThrottledControlSocket*, std::allocator<ThrottledControlSocket*> >::insert<__gnu_debug::_Safe_iterator<std::__norm::_Deque_iterator<ThrottledControlSocket*, ThrottledControlSocket*&, ThrottledControlSocket**>, std::__debug::deque<ThrottledControlSocket*, std::allocator<ThrottledControlSocket*> > > > (this=0x193a608, __position=..., __first=...,
    __last=...) at /usr/include/c++/4.4/bits/stl_deque.h:1350
#11 0x00000000005cb3e4 in std::__debug::deque<ThrottledControlSocket*, std::allocator<ThrottledControlSocket*> >::insert<__gnu_debug::_Safe_iterator<std::__norm---Type <return> to continue, or q <return> to quit---
::_Deque_iterator<ThrottledControlSocket*, ThrottledControlSocket*&, ThrottledControlSocket**>, std::__debug::deque<ThrottledControlSocket*, std::allocator<ThrottledControlSocket*> > > > (this=0x193a608, __position=..., __first=...,
    __last=...) at /usr/include/c++/4.4/debug/deque:360
#12 0x00000000005c9b5c in UploadBandwidthThrottler::Entry (this=0x193a570)
    at UploadBandwidthThrottler.cpp:358
#13 0x0000000000a5e9ae in wxThreadInternal::PthreadStart (thread=0x193a570)
    at ./src/unix/threadpsx.cpp:766
#14 0x0000000000a5e85e in wxPthreadStart (ptr=0x193a570)
    at ./src/unix/threadpsx.cpp:718
#15 0x00007ffff7bc6971 in start_thread () from /lib/libpthread.so.0
#16 0x00007ffff390a92d in clone () from /lib/libc.so.6
#17 0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7ffff7fca940 (LWP 14134)):
#0  0x0000000002db1b80 in ?? ()
#1  0x000000000096ca64 in _GSocket_GDK_Input (data=0x2db1b90, source=45,
    condition=GDK_INPUT_WRITE) at ./src/gtk/gsockgtk.cpp:43
#2  0x00007ffff675499f in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#3  0x00007ffff4996342 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#4  0x00007ffff499a2a8 in ?? () from /lib/libglib-2.0.so.0
#5  0x00007ffff499a7b5 in g_main_loop_run () from /lib/libglib-2.0.so.0
#6  0x00007ffff6b133e7 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
---Type <return> to continue, or q <return> to quit---
#7  0x000000000096c780 in wxEventLoop::Run (this=0x1a9a180)
    at ./src/gtk/evtloop.cpp:76
#8  0x00000000008c81ea in wxAppBase::MainLoop (this=0x11eb310)
    at ./src/common/appcmn.cpp:312
#9  0x00000000008c8364 in wxAppBase::OnRun (this=0x11eb310)
    at ./src/common/appcmn.cpp:367
#10 0x00000000009f952f in wxEntry (argc=@0x11ae6d0, argv=0x11da790)
    at ./src/common/init.cpp:448
#11 0x00000000009f9603 in wxEntry (argc=@0x7fffffffe2ac, argv=0x7fffffffe398)
    at ./src/common/init.cpp:460
#12 0x0000000000638542 in main (argc=1, argv=0x7fffffffe398)
    at amule-gui.cpp:93
(gdb)

Title: Re: Latest amule svn w/wx 2.8.12 still crashes
Post by: kristof on May 03, 2011, 08:16:32 PM
[Sorry for the new message but I don't see a button for editing my previous post.]

To be more exact it is always line 43 of gsockgtk.cpp.
Title: Re: Latest amule svn w/wx 2.8.12 still crashes
Post by: btkaos on May 03, 2011, 08:33:38 PM
[Sorry for the new message but I don't see a button for editing my previous post.]

To be more exact it is always line 43 of gsockgtk.cpp.
Ok Kristof, that backtrace is what we expected. Just one thing, could you install debug packages libgtk2.0-0-dbg libx11-6-dbg libstdc++6-4.4-dbg libc6-dbg and get the backtrace again?
Title: Re: Latest amule svn w/wx 2.8.12 still crashes
Post by: kristof on May 03, 2011, 10:20:17 PM
Ok Kristof, that backtrace is what we expected. Just one thing, could you install debug packages libgtk2.0-0-dbg libx11-6-dbg libstdc++6-4.4-dbg libc6-dbg and get the backtrace again?

Ok, installed.  I will post new backtraces once aMule crashes.
Title: Re: Latest amule svn w/wx 2.8.12 still crashes
Post by: kristof on May 08, 2011, 03:32:07 PM
Here is the latest crash.  Maximum connections set at 75 with kad enabled.  It was a few hours before aMule crashed.

Code: [Select]
Program received signal SIGSEGV, Segmentation fault.
0x0000000002f6c140 in ?? ()
(gdb) bt
#0  0x0000000002f6c140 in ?? ()
#1  0x000000000096ca64 in _GSocket_GDK_Input (data=0x2f6c150, source=61, condition=GDK_INPUT_WRITE) at ./src/gtk/gsockgtk.cpp:43
#2  0x00007ffff675499f 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
#3  0x00007ffff4996342 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#4  0x00007ffff499a2a8 in ?? () from /lib/libglib-2.0.so.0
#5  0x00007ffff499a7b5 in g_main_loop_run () from /lib/libglib-2.0.so.0
#6  0x00007ffff6b133e7 in IA__gtk_main () at /build/buildd/gtk+2.0-2.22.0/gtk/gtkmain.c:1237
#7  0x000000000096c780 in wxEventLoop::Run (this=0x1c4d330) at ./src/gtk/evtloop.cpp:76
#8  0x00000000008c81ea in wxAppBase::MainLoop (this=0x11eb310) at ./src/common/appcmn.cpp:312
#9  0x00000000008c8364 in wxAppBase::OnRun (this=0x11eb310) at ./src/common/appcmn.cpp:367
#10 0x00000000009f952f in wxEntry (argc=@0x11ae6d0, argv=0x11da790) at ./src/common/init.cpp:448
#11 0x00000000009f9603 in wxEntry (argc=@0x7fffffffe2ac, argv=0x7fffffffe398) at ./src/common/init.cpp:460
#12 0x0000000000638542 in main (argc=1, argv=0x7fffffffe398) at amule-gui.cpp:93
(gdb) bt full
#0  0x0000000002f6c140 in ?? ()
No symbol table info available.
#1  0x000000000096ca64 in _GSocket_GDK_Input (data=0x2f6c150, source=61, condition=GDK_INPUT_WRITE) at ./src/gtk/gsockgtk.cpp:43
        socket = 0x2f6c150
#2  0x00007ffff675499f 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 = 0x2dd77d0
        gdk_cond = GDK_INPUT_WRITE
#3  0x00007ffff4996342 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
No symbol table info available.
#4  0x00007ffff499a2a8 in ?? () from /lib/libglib-2.0.so.0
No symbol table info available.
#5  0x00007ffff499a7b5 in g_main_loop_run () from /lib/libglib-2.0.so.0
No symbol table info available.
#6  0x00007ffff6b133e7 in IA__gtk_main () at /build/buildd/gtk+2.0-2.22.0/gtk/gtkmain.c:1237
        tmp_list = 0x1d217b0
        functions = 0x0
        init = 0x7fffffffe1c0
        loop = <value optimized out>
#7  0x000000000096c780 in wxEventLoop::Run (this=0x1c4d330) at ./src/gtk/evtloop.cpp:76
        __FUNCTION__ = "Run"
        activate = {m_evtLoopOld = 0x0}
        exitcode = 0
#8  0x00000000008c81ea in wxAppBase::MainLoop (this=0x11eb310) at ./src/common/appcmn.cpp:312
        mainLoop = {<wxEventLoopPtr> = {m_ptr = 0x1c4d330}, m_pp = 0x11eb388, m_pOld = 0x0}
#9  0x00000000008c8364 in wxAppBase::OnRun (this=0x11eb310) at ./src/common/appcmn.cpp:367
No locals.
#10 0x00000000009f952f in wxEntry (argc=@0x11ae6d0, argv=0x11da790) at ./src/common/init.cpp:448
        callOnExit = {<No data fields>}
        initializer = {m_ok = true}
#11 0x00000000009f9603 in wxEntry (argc=@0x7fffffffe2ac, argv=0x7fffffffe398) at ./src/common/init.cpp:460
No locals.
#12 0x0000000000638542 in main (argc=1, argv=0x7fffffffe398) at amule-gui.cpp:93
No locals.
(gdb) thread apply all bt

Thread 5 (Thread 0x7fffe75f8700 (LWP 8548)):
#0  pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:212
#1  0x0000000000a5e1a7 in wxConditionInternal::WaitTimeout (this=0x1d212d0, milliseconds=100) at ./src/unix/threadpsx.cpp:405
#2  0x0000000000a60f80 in wxCondition::WaitTimeout (this=0x1aab158, milliseconds=100) at ./include/wx/thrimpl.cpp:258
#3  0x0000000000a5e6e7 in wxSemaphoreInternal::WaitTimeout (this=0x1aab150, milliseconds=100) at ./src/unix/threadpsx.cpp:552
#4  0x0000000000a612e2 in wxSemaphore::WaitTimeout (this=0x24df978, milliseconds=100) at ./include/wx/thrimpl.cpp:322
#5  0x000000000078090a in CTimerThread::Entry (this=0x24df940) at Timer.cpp:66
#6  0x0000000000a5e9ae in wxThreadInternal::PthreadStart (thread=0x24df940) at ./src/unix/threadpsx.cpp:766
#7  0x0000000000a5e85e in wxPthreadStart (ptr=0x24df940) at ./src/unix/threadpsx.cpp:718
#8  0x00007ffff7bc6971 in start_thread (arg=<value optimized out>) at pthread_create.c:304
#9  0x00007ffff390a92d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#10 0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7fffed3e3700 (LWP 8545)):
#0  0x00007ffff7bce36d in nanosleep () at ../sysdeps/unix/syscall-template.S:82
#1  0x0000000000a664aa in wxMicroSleep (microseconds=625000) at ./src/unix/utilsunx.cpp:191
#2  0x0000000000a664cb in wxMilliSleep (milliseconds=625) at ./src/unix/utilsunx.cpp:212
#3  0x0000000000a5f1c6 in wxThread::Sleep (milliseconds=625) at ./src/unix/threadpsx.cpp:986
#4  0x00000000005c9868 in UploadBandwidthThrottler::Entry (this=0x1d41960) at UploadBandwidthThrottler.cpp:323
#5  0x0000000000a5e9ae in wxThreadInternal::PthreadStart (thread=0x1d41960) at ./src/unix/threadpsx.cpp:766
#6  0x0000000000a5e85e in wxPthreadStart (ptr=0x1d41960) at ./src/unix/threadpsx.cpp:718
#7  0x00007ffff7bc6971 in start_thread (arg=<value optimized out>) at pthread_create.c:304
#8  0x00007ffff390a92d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#9  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7ffff7fca940 (LWP 8532)):
#0  0x0000000002f6c140 in ?? ()
#1  0x000000000096ca64 in _GSocket_GDK_Input (data=0x2f6c150, source=61, condition=GDK_INPUT_WRITE) at ./src/gtk/gsockgtk.cpp:43
#2  0x00007ffff675499f 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
#3  0x00007ffff4996342 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#4  0x00007ffff499a2a8 in ?? () from /lib/libglib-2.0.so.0
#5  0x00007ffff499a7b5 in g_main_loop_run () from /lib/libglib-2.0.so.0
#6  0x00007ffff6b133e7 in IA__gtk_main () at /build/buildd/gtk+2.0-2.22.0/gtk/gtkmain.c:1237
#7  0x000000000096c780 in wxEventLoop::Run (this=0x1c4d330) at ./src/gtk/evtloop.cpp:76
#8  0x00000000008c81ea in wxAppBase::MainLoop (this=0x11eb310) at ./src/common/appcmn.cpp:312
#9  0x00000000008c8364 in wxAppBase::OnRun (this=0x11eb310) at ./src/common/appcmn.cpp:367
#10 0x00000000009f952f in wxEntry (argc=@0x11ae6d0, argv=0x11da790) at ./src/common/init.cpp:448
#11 0x00000000009f9603 in wxEntry (argc=@0x7fffffffe2ac, argv=0x7fffffffe398) at ./src/common/init.cpp:460
---Type <return> to continue, or q <return> to quit---
#12 0x0000000000638542 in main (argc=1, argv=0x7fffffffe398) at amule-gui.cpp:93
(gdb)

I first ran aMule with maximum connections set at 50.  aMule ran for days with no problem.   I enabled kad and it did not crash.  I lost patience so I changed maximum connections to 75.  aMule ran more than 24 hours.  The end began with high cpu as I have reported in another thread, 160-180% of dual core.  aMule used a large amount of memory, 1.1GB resident.  aMule took more and more memory.  The machine swapped continually.  aMule gui froze.  aMule continued to eat memory.  aMule was killed because of OOM at 4GB of memory used.  No bt from OOM.   :(  I had to restart aMule to get the bt above.  Luckily (?) it happened in some hours.
Title: Re: Latest amule svn w/wx 2.8.12 still crashes
Post by: kristof on May 12, 2011, 08:25:43 PM
With libglib2.0-0-dbg installed.

Code: [Select]
Program received signal SIGSEGV, Segmentation fault.
0x00000000033980a0 in ?? ()
(gdb) bt
#0  0x00000000033980a0 in ?? ()
#1  0x000000000096ca64 in _GSocket_GDK_Input (data=0x33980b0, source=15, condition=GDK_INPUT_WRITE) at ./src/gtk/gsockgtk.cpp:43
#2  0x00007ffff675499f 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
#3  0x00007ffff4996342 in g_main_dispatch (context=0x11eb840) at /build/buildd/glib2.0-2.26.1/glib/gmain.c:2149
#4  g_main_context_dispatch (context=0x11eb840) at /build/buildd/glib2.0-2.26.1/glib/gmain.c:2702
#5  0x00007ffff499a2a8 in g_main_context_iterate (context=0x11eb840, block=<value optimized out>, dispatch=<value optimized out>, self=<value optimized out>)
    at /build/buildd/glib2.0-2.26.1/glib/gmain.c:2780
#6  0x00007ffff499a7b5 in g_main_loop_run (loop=0x1cd4c50) at /build/buildd/glib2.0-2.26.1/glib/gmain.c:2988
#7  0x00007ffff6b133e7 in IA__gtk_main () at /build/buildd/gtk+2.0-2.22.0/gtk/gtkmain.c:1237
#8  0x000000000096c780 in wxEventLoop::Run (this=0x1cd2f80) at ./src/gtk/evtloop.cpp:76
#9  0x00000000008c81ea in wxAppBase::MainLoop (this=0x11eb310) at ./src/common/appcmn.cpp:312
#10 0x00000000008c8364 in wxAppBase::OnRun (this=0x11eb310) at ./src/common/appcmn.cpp:367
#11 0x00000000009f952f in wxEntry (argc=@0x11ae6d0, argv=0x11da790) at ./src/common/init.cpp:448
#12 0x00000000009f9603 in wxEntry (argc=@0x7fffffffe29c, argv=0x7fffffffe388) at ./src/common/init.cpp:460
#13 0x0000000000638542 in main (argc=1, argv=0x7fffffffe388) at amule-gui.cpp:93
(gdb) bt full
#0  0x00000000033980a0 in ?? ()
No symbol table info available.
#1  0x000000000096ca64 in _GSocket_GDK_Input (data=0x33980b0, source=15, condition=GDK_INPUT_WRITE) at ./src/gtk/gsockgtk.cpp:43
        socket = 0x33980b0
#2  0x00007ffff675499f 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 = 0x7fffe826ab60
        gdk_cond = GDK_INPUT_WRITE
#3  0x00007ffff4996342 in g_main_dispatch (context=0x11eb840) at /build/buildd/glib2.0-2.26.1/glib/gmain.c:2149
        dispatch = 0x7ffff49daa90 <g_io_unix_dispatch>
        user_data = 0x7fffe826ab60
        callback = 0x7ffff6754950 <gdk_io_invoke>
        cb_funcs = 0x7ffff4c36610
        cb_data = 0x7fffe82d9140
        current_source_link = {data = 0x7fffe818a1f0, next = 0x0}
        source = 0x7fffe818a1f0
        current = 0x1b6faa0
        i = 14
#4  g_main_context_dispatch (context=0x11eb840) at /build/buildd/glib2.0-2.26.1/glib/gmain.c:2702
No locals.
#5  0x00007ffff499a2a8 in g_main_context_iterate (context=0x11eb840, 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 = 0
        timeout = 0
        some_ready = 1
        nfds = 39
        allocated_nfds = 8731907
        fds = <value optimized out>
        __PRETTY_FUNCTION__ = "g_main_context_iterate"
#6  0x00007ffff499a7b5 in g_main_loop_run (loop=0x1cd4c50) at /build/buildd/glib2.0-2.26.1/glib/gmain.c:2988
        self = 0x11ec630
        __PRETTY_FUNCTION__ = "g_main_loop_run"
#7  0x00007ffff6b133e7 in IA__gtk_main () at /build/buildd/gtk+2.0-2.22.0/gtk/gtkmain.c:1237
        tmp_list = 0x1cda300
        functions = 0x0
        init = 0x7fffffffe1b0
        loop = <value optimized out>
#8  0x000000000096c780 in wxEventLoop::Run (this=0x1cd2f80) at ./src/gtk/evtloop.cpp:76
        __FUNCTION__ = "Run"
        activate = {m_evtLoopOld = 0x0}
        exitcode = 0
#9  0x00000000008c81ea in wxAppBase::MainLoop (this=0x11eb310) at ./src/common/appcmn.cpp:312
        mainLoop = {<wxEventLoopPtr> = {m_ptr = 0x1cd2f80}, m_pp = 0x11eb388, m_pOld = 0x0}
#10 0x00000000008c8364 in wxAppBase::OnRun (this=0x11eb310) at ./src/common/appcmn.cpp:367
No locals.
#11 0x00000000009f952f in wxEntry (argc=@0x11ae6d0, argv=0x11da790) at ./src/common/init.cpp:448
        callOnExit = {<No data fields>}
        initializer = {m_ok = true}
#12 0x00000000009f9603 in wxEntry (argc=@0x7fffffffe29c, argv=0x7fffffffe388) at ./src/common/init.cpp:460
No locals.
#13 0x0000000000638542 in main (argc=1, argv=0x7fffffffe388) at amule-gui.cpp:93
---Type <return> to continue, or q <return> to quit---
No locals.
(gdb) thread apply all bt

Thread 5 (Thread 0x7fffe75f8700 (LWP 11998)):
#0  pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:212
#1  0x0000000000a5e1a7 in wxConditionInternal::WaitTimeout (this=0x251b5b0, milliseconds=100) at ./src/unix/threadpsx.cpp:405
#2  0x0000000000a60f80 in wxCondition::WaitTimeout (this=0x1a95ee8, milliseconds=100) at ./include/wx/thrimpl.cpp:258
#3  0x0000000000a5e6e7 in wxSemaphoreInternal::WaitTimeout (this=0x1a95ee0, milliseconds=100) at ./src/unix/threadpsx.cpp:552
#4  0x0000000000a612e2 in wxSemaphore::WaitTimeout (this=0x1b2bee8, milliseconds=100) at ./include/wx/thrimpl.cpp:322
#5  0x000000000078090a in CTimerThread::Entry (this=0x1b2beb0) at Timer.cpp:66
#6  0x0000000000a5e9ae in wxThreadInternal::PthreadStart (thread=0x1b2beb0) at ./src/unix/threadpsx.cpp:766
#7  0x0000000000a5e85e in wxPthreadStart (ptr=0x1b2beb0) at ./src/unix/threadpsx.cpp:718
#8  0x00007ffff7bc6971 in start_thread (arg=<value optimized out>) at pthread_create.c:304
#9  0x00007ffff390a92d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#10 0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7fffed3e3700 (LWP 11995)):
#0  0x00007ffff7bce36d in nanosleep () at ../sysdeps/unix/syscall-template.S:82
#1  0x0000000000a664aa in wxMicroSleep (microseconds=1000) at ./src/unix/utilsunx.cpp:191
#2  0x0000000000a664cb in wxMilliSleep (milliseconds=1) at ./src/unix/utilsunx.cpp:212
#3  0x0000000000a5f1c6 in wxThread::Sleep (milliseconds=1) at ./src/unix/threadpsx.cpp:986
#4  0x00000000005c9868 in UploadBandwidthThrottler::Entry (this=0x1dc2100) at UploadBandwidthThrottler.cpp:323
#5  0x0000000000a5e9ae in wxThreadInternal::PthreadStart (thread=0x1dc2100) at ./src/unix/threadpsx.cpp:766
#6  0x0000000000a5e85e in wxPthreadStart (ptr=0x1dc2100) at ./src/unix/threadpsx.cpp:718
#7  0x00007ffff7bc6971 in start_thread (arg=<value optimized out>) at pthread_create.c:304
#8  0x00007ffff390a92d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#9  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7ffff7fca940 (LWP 11982)):
#0  0x00000000033980a0 in ?? ()
#1  0x000000000096ca64 in _GSocket_GDK_Input (data=0x33980b0, source=15, condition=GDK_INPUT_WRITE) at ./src/gtk/gsockgtk.cpp:43
#2  0x00007ffff675499f 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
#3  0x00007ffff4996342 in g_main_dispatch (context=0x11eb840) at /build/buildd/glib2.0-2.26.1/glib/gmain.c:2149
#4  g_main_context_dispatch (context=0x11eb840) at /build/buildd/glib2.0-2.26.1/glib/gmain.c:2702
#5  0x00007ffff499a2a8 in g_main_context_iterate (context=0x11eb840, block=<value optimized out>, dispatch=<value optimized out>, self=<value optimized out>)
    at /build/buildd/glib2.0-2.26.1/glib/gmain.c:2780
#6  0x00007ffff499a7b5 in g_main_loop_run (loop=0x1cd4c50) at /build/buildd/glib2.0-2.26.1/glib/gmain.c:2988
#7  0x00007ffff6b133e7 in IA__gtk_main () at /build/buildd/gtk+2.0-2.22.0/gtk/gtkmain.c:1237
#8  0x000000000096c780 in wxEventLoop::Run (this=0x1cd2f80) at ./src/gtk/evtloop.cpp:76
#9  0x00000000008c81ea in wxAppBase::MainLoop (this=0x11eb310) at ./src/common/appcmn.cpp:312
#10 0x00000000008c8364 in wxAppBase::OnRun (this=0x11eb310) at ./src/common/appcmn.cpp:367
#11 0x00000000009f952f in wxEntry (argc=@0x11ae6d0, argv=0x11da790) at ./src/common/init.cpp:448
#12 0x00000000009f9603 in wxEntry (argc=@0x7fffffffe29c, argv=0x7fffffffe388) at ./src/common/init.cpp:460
#13 0x0000000000638542 in main (argc=1, argv=0x7fffffffe388) at amule-gui.cpp:93
(gdb)
Title: Re: Latest amule svn w/wx 2.8.12 still crashes
Post by: kristof on September 16, 2011, 06:54:04 AM
Is this bug one that we might find to be fixed in 2.3.1 RC2?  I don't mean to pester.  I am asking only so I know whether to bother compiling the new version.  :)
Title: Re: Latest amule svn w/wx 2.8.12 still crashes
Post by: Stu Redman on September 16, 2011, 08:46:28 PM
I'm afraid no.
Title: Re: Latest amule svn w/wx 2.8.12 still crashes
Post by: staxx on September 22, 2011, 07:57:52 PM
These bugs don't appear when using amuled/amulegui combo, by the way. Ever since I switched to amuled, it can work for weeks under any conditions and with any settings without crashing on same systems.
Title: Re: Latest amule svn w/wx 2.8.12 still crashes
Post by: kristof on November 18, 2011, 10:46:24 PM
These bugs don't appear when using amuled/amulegui combo, by the way. Ever since I switched to amuled, it can work for weeks under any conditions and with any settings without crashing on same systems.

Thanks!!!  :D  Amuled does crash for me but not as often as amule.  Amule runs 1-2 hours.  Amuled runs usually one week.  Amuled ends up the same as amule.  It crashes or it goes into the "high cpu" state I reported in another thread.  In "high cpu" state it uses constant 100% cpu until I kill it.  It is not a big problem for me.  One week average uptime is enough.
Title: Re: Latest amule svn w/wx 2.8.12 still crashes
Post by: Stu Redman on January 02, 2012, 12:10:21 AM
Please try if things improve with the new experimental Asio branch (http://forum.amule.org/index.php?topic=19416.0).