I've been following the other forum posts about amule consuming all memory and crashing recently. The crash is caused something that changed in either amule, cryptopp wxwidgets or something. I have been experiencing the following:
1) amule starts normally
2) amule runs for a while (1 or 2 hours)
3) amule starts consuming all memory
4) amule starts consuming all swap
5) system is unresponsive
6) eventually the kernel kills the amule process
7) system is back to normal.
The following is the memory usage of amule during that time:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
5662 alex 20 0 499m 58m 23m S 4.8 0.7 1:53.31 amule
... [steady normally running state for 1-2 hours]...
5662 alex 20 0 499m 58m 23m S 4.8 0.7 1:53.31 amule
5662 alex 20 0 499m 58m 23m S 4.8 0.7 1:53.55 amule
5662 alex 20 0 512m 71m 23m R 18.3 0.9 1:55.28 amule
5662 alex 20 0 798m 357m 23m R 100.4 4.5 2:00.32 amule
5662 alex 20 0 1344m 903m 23m R 100.5 11.3 2:05.36 amule
5662 alex 20 0 1889m 1.4g 23m R 100.5 18.1 2:10.40 amule
5662 alex 20 0 2438m 2.0g 23m R 100.5 25.0 2:15.44 amule
5662 alex 20 0 2984m 2.5g 23m R 100.7 31.8 2:20.49 amule
5662 alex 20 0 3596m 3.1g 23m R 100.3 39.4 2:25.52 amule
5662 alex 20 0 4236m 3.7g 23m R 100.5 47.4 2:30.56 amule
5662 alex 20 0 4831m 4.3g 23m R 98.4 54.9 2:35.50 amule
5662 alex 20 0 5444m 4.9g 22m R 100.3 62.5 2:40.54 amule
5662 alex 20 0 0 0 0 D 47.2 0.0 2:42.97 amule
This was generated by extracting the amule details from the "top" command every 10 or 20 seconds. Clearly you can see that it is consuming all memory.
I tried running amule through valgrind, but it doesn't ever get to the same state. I think this is because valgrind slows down amule so much that timeouts occur and then it doesn't behave the same. I could try it again if necessary. Also, can someone who uses valgrind regularly post a suppression file that I could look at and compare to mine.
My machine is fedora 14.
uname -a:
Linux alex.builderlynx.com 2.6.35.10-74.fc14.x86_64 #1 SMP Thu Dec 23 16:04:50 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux
WxWidgets:
wx-config --version-full
2.8.11.0
I compiled my own version of cryptopp using the most recent subversion snapshot available from the website. This has the patch applied that was mentioned in the forum post:
http://forum.amule.org/index.php?topic=18222.msg100743#msg100743I am working with amule 10424 snapshot. I compile amule with:
./configure --prefix=/usr --disable-optimize --disable-ccache --enable-debug --enable-geoip --enable-webserver
make
make install
I have run amule through gdb. Here is the backtrace information that I get. Hopefully it is some use to you:
Program received signal SIGSEGV, Segmentation fault.
0x000000359be09284 in pthread_mutex_lock () from /lib64/libpthread.so.0
Missing separate debuginfos, use: debuginfo-install amule-2.2.6-3.fc14.x86_64
(gdb) bt
#0 0x000000359be09284 in pthread_mutex_lock () from /lib64/libpthread.so.0
#1 0x000000359d63e939 in ?? () from /lib64/libglib-2.0.so.0
#2 0x000000359d64074e in g_source_remove () from /lib64/libglib-2.0.so.0
#3 0x0000003a03be86d6 in GSocketGUIFunctionsTableConcrete::Uninstall_Callback(GSocket*, GSocketEvent) ()
from /usr/lib64/libwx_gtk2u_core-2.8.so.0
#4 0x00000035a6e234a7 in GSocket::Detected_Write() () from /usr/lib64/libwx_baseu_net-2.8.so.0
#5 0x00000035a262537f in ?? () from /usr/lib64/libgdk-x11-2.0.so.0
#6 0x000000359d641e33 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#7 0x000000359d642610 in ?? () from /lib64/libglib-2.0.so.0
#8 0x000000359d642c82 in g_main_loop_run () from /lib64/libglib-2.0.so.0
#9 0x00000035a4f4b0b7 in gtk_main () from /usr/lib64/libgtk-x11-2.0.so.0
#10 0x0000003a03be74f8 in wxEventLoop::Run() () from /usr/lib64/libwx_gtk2u_core-2.8.so.0
#11 0x0000003a03c6499b in wxAppBase::MainLoop() () from /usr/lib64/libwx_gtk2u_core-2.8.so.0
#12 0x00000035a56972ca in wxEntry(int&, wchar_t**) () from /usr/lib64/libwx_baseu-2.8.so.0
#13 0x000000000062318a in main (argc=1, argv=0x7fffffffe0a8) at amule-gui.cpp:93
(gdb) bt full
#0 0x000000359be09284 in pthread_mutex_lock () from /lib64/libpthread.so.0
No symbol table info available.
#1 0x000000359d63e939 in ?? () from /lib64/libglib-2.0.so.0
No symbol table info available.
#2 0x000000359d64074e in g_source_remove () from /lib64/libglib-2.0.so.0
No symbol table info available.
#3 0x0000003a03be86d6 in GSocketGUIFunctionsTableConcrete::Uninstall_Callback(GSocket*, GSocketEvent) ()
from /usr/lib64/libwx_gtk2u_core-2.8.so.0
No symbol table info available.
#4 0x00000035a6e234a7 in GSocket::Detected_Write() () from /usr/lib64/libwx_baseu_net-2.8.so.0
No symbol table info available.
#5 0x00000035a262537f in ?? () from /usr/lib64/libgdk-x11-2.0.so.0
No symbol table info available.
#6 0x000000359d641e33 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
No symbol table info available.
#7 0x000000359d642610 in ?? () from /lib64/libglib-2.0.so.0
No symbol table info available.
#8 0x000000359d642c82 in g_main_loop_run () from /lib64/libglib-2.0.so.0
No symbol table info available.
#9 0x00000035a4f4b0b7 in gtk_main () from /usr/lib64/libgtk-x11-2.0.so.0
No symbol table info available.
#10 0x0000003a03be74f8 in wxEventLoop::Run() () from /usr/lib64/libwx_gtk2u_core-2.8.so.0
No symbol table info available.
#11 0x0000003a03c6499b in wxAppBase::MainLoop() () from /usr/lib64/libwx_gtk2u_core-2.8.so.0
No symbol table info available.
#12 0x00000035a56972ca in wxEntry(int&, wchar_t**) () from /usr/lib64/libwx_baseu-2.8.so.0
No symbol table info available.
#13 0x000000000062318a in main (argc=1, argv=0x7fffffffe0a8) at amule-gui.cpp:93
No locals.
(gdb) thread apply all bt
Thread 6 (Thread 0x7fffeaffd700 (LWP 4759)):
#0 0x000000359be0bc2e in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00000035a56e7e56 in wxConditionInternal::WaitTimeout(unsigned long) () from /usr/lib64/libwx_baseu-2.8.so.0
#2 0x00000035a56e8282 in wxSemaphoreInternal::WaitTimeout(unsigned long) () from /usr/lib64/libwx_baseu-2.8.so.0
#3 0x000000000073e0fc in CTimerThread::Entry (this=0x1bad110) at Timer.cpp:66
#4 0x00000035a56e8fe1 in wxThreadInternal::PthreadStart(wxThread*) () from /usr/lib64/libwx_baseu-2.8.so.0
#5 0x000000359be06d5b in start_thread () from /lib64/libpthread.so.0
#6 0x000000359b6e4a7d in clone () from /lib64/libc.so.6
Thread 3 (Thread 0x7fffebfff700 (LWP 4756)):
#0 0x000000359b63421e in __libc_sigaction () from /lib64/libc.so.6
#1 0x000000359b634029 in ssignal () from /lib64/libc.so.6
#2 0x00000035a6e23b0f in GSocket::Send_Stream(char const*, int) () from /usr/lib64/libwx_baseu_net-2.8.so.0
#3 0x00000035a6e246e8 in GSocket::Write(char const*, int) () from /usr/lib64/libwx_baseu_net-2.8.so.0
#4 0x00000035a6e1fb68 in wxSocketBase::_Write(void const*, unsigned int) () from /usr/lib64/libwx_baseu_net-2.8.so.0
#5 0x00000035a6e1fb9c in wxSocketBase::Write(void const*, unsigned int) () from /usr/lib64/libwx_baseu_net-2.8.so.0
#6 0x00000000006fdc38 in CSocketClientProxy::Write (this=0x332db20, buffer=0x2981970, nbytes=46) at Proxy.cpp:1309
#7 0x00000000004fad42 in CEncryptedStreamSocket::Write (this=0x332db20, lpBuf=0x2981970, nBufLen=46) at EncryptedStreamSocket.cpp:210
#8 0x00000000004f813a in CEMSocket::Send (this=0x332db20, maxNumberOfBytesToSend=1300, minFragSize=1300, onlyAllowedToSendControlPacket=true)
at EMSocket.cpp:572
#9 0x000000000049e766 in CEMSocket::SendControlData (this=0x332db20, maxNumberOfBytesToSend=20, minFragSize=1300) at EMSocket.h:69
#10 0x000000000049e356 in CClientTCPSocket::SendControlData (this=0x332db20, maxNumberOfBytesToSend=20, overchargeMaxBytesToSend=1300)
at ClientTCPSocket.cpp:2124
#11 0x00000000005b2dae in UploadBandwidthThrottler::Entry (this=0x1c6bed0) at UploadBandwidthThrottler.cpp:381
#12 0x00000035a56e8fe1 in wxThreadInternal::PthreadStart(wxThread*) () from /usr/lib64/libwx_baseu-2.8.so.0
#13 0x000000359be06d5b in start_thread () from /lib64/libpthread.so.0
#14 0x000000359b6e4a7d in clone () from /lib64/libc.so.6
Thread 1 (Thread 0x7ffff7fc4960 (LWP 4745)):
#0 0x000000359be09284 in pthread_mutex_lock () from /lib64/libpthread.so.0
#1 0x000000359d63e939 in ?? () from /lib64/libglib-2.0.so.0
#2 0x000000359d64074e in g_source_remove () from /lib64/libglib-2.0.so.0
#3 0x0000003a03be86d6 in GSocketGUIFunctionsTableConcrete::Uninstall_Callback(GSocket*, GSocketEvent) ()
from /usr/lib64/libwx_gtk2u_core-2.8.so.0
#4 0x00000035a6e234a7 in GSocket::Detected_Write() () from /usr/lib64/libwx_baseu_net-2.8.so.0
#5 0x00000035a262537f in ?? () from /usr/lib64/libgdk-x11-2.0.so.0
#6 0x000000359d641e33 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#7 0x000000359d642610 in ?? () from /lib64/libglib-2.0.so.0
#8 0x000000359d642c82 in g_main_loop_run () from /lib64/libglib-2.0.so.0
#9 0x00000035a4f4b0b7 in gtk_main () from /usr/lib64/libgtk-x11-2.0.so.0
#10 0x0000003a03be74f8 in wxEventLoop::Run() () from /usr/lib64/libwx_gtk2u_core-2.8.so.0
#11 0x0000003a03c6499b in wxAppBase::MainLoop() () from /usr/lib64/libwx_gtk2u_core-2.8.so.0
#12 0x00000035a56972ca in wxEntry(int&, wchar_t**) () from /usr/lib64/libwx_baseu-2.8.so.0
#13 0x000000000062318a in main (argc=1, argv=0x7fffffffe0a8) at amule-gui.cpp:93
Let me know if there are other tests you would like me to perform, or if I can do something else to help figure out this problem. Thanks for a great program! Alex.