aMule Forum
English => aMule crashes => Topic started by: Stu Redman on January 08, 2011, 06:22:55 PM

We are getting lots of out of memory crashes since a recent Kernel update, mostly in Ubuntu 10.10 Maverick. I'd like to join the facts in this thread since they are scattered across several threads in 3 boards (don't get me started on our forum structure... ::)). First post will be updated with new facts.
 Same with 2.2.6 and SVN
 Problem occurs since 2.6.3523.41, 2.6.3522 worked (here (http://forum.amule.org/index.php?topic=18464.msg100423#msg100423) here (http://forum.amule.org/index.php?topic=18144.msg100493#msg100493))
 There's also a report (http://forum.amule.org/index.php?topic=18409.msg100024#msg100024) for Fedora 12 2.6.32.23170.fc12.x86_64
 Problem is related to high traffic (here (http://forum.amule.org/index.php?topic=18506.msg100735#msg100735))
 Kad is not involved (http://forum.amule.org/index.php?topic=18546.msg100779#msg100779)
 interesting info here (http://forum.amule.org/index.php?topic=18546.msg100775#msg100775)
 not related to 32/64 bit (below)
 related to download limit! Setting download to max works around the problem. (Maybe explains why not more people complain. ;) )
This patch (http://forum.amule.org/index.php?topic=18506.msg101158#msg101158) fixes the problem. It has to be applied to wxWidgets, not to aMule! If you have the problem please try and post your results here.
Better: Use wxWidgets 2.8.12 which ships with Kry's patch.

Here is a patch (for current SVN) for you to try. It simply adds a log entry to the upload thread with sizes of various queues and the total number of sockets. Let's see if something hits the roof here when an oom crash occurs.

Anybody getting the crash in a 32 bit system ?
Please run aMule with gdb and check if it it crashes before wasting all the memory or after.

I can't run any more tests right now, but I'm 100% sure that turning off the download speed limit resolves the problem. My aMule has been running all day with no crashes :)
BTW, I'm on a 32 bit system.

I've compiled the latest SVN with the patch you provided and it seems that something did hit the roof. Here's the last minute before my system became unresponsive and I had to do a hard reset:
20110121 00:46:02: UBT: t 0 CQ 0 CQF 0 TCQ 0 TCQF 0 SO 6 EMS 43
20110121 00:46:04: UBT: t 0 CQ 0 CQF 0 TCQ 0 TCQF 0 SO 6 EMS 44
20110121 00:46:07: UBT: t 1 CQ 0 CQF 0 TCQ 0 TCQF 0 SO 6 EMS 45
20110121 00:46:09: UBT: t 1 CQ 0 CQF 0 TCQ 0 TCQF 0 SO 6 EMS 45
20110121 00:46:12: UBT: t 0 CQ 0 CQF 0 TCQ 0 TCQF 0 SO 6 EMS 45
20110121 00:46:14: UBT: t 0 CQ 0 CQF 0 TCQ 0 TCQF 0 SO 6 EMS 47
20110121 00:46:17: UBT: t 0 CQ 0 CQF 0 TCQ 0 TCQF 0 SO 6 EMS 47
20110121 00:46:19: UBT: t 0 CQ 0 CQF 0 TCQ 0 TCQF 0 SO 6 EMS 48
20110121 00:46:22: UBT: t 1 CQ 4 CQF 0 TCQ 1 TCQF 0 SO 6 EMS 48
20110121 00:46:24: UBT: t 0 CQ 0 CQF 0 TCQ 0 TCQF 0 SO 6 EMS 48
20110121 00:46:27: UBT: t 0 CQ 0 CQF 0 TCQ 0 TCQF 0 SO 6 EMS 47
20110121 00:46:29: UBT: t 0 CQ 0 CQF 0 TCQ 0 TCQF 0 SO 6 EMS 49
20110121 00:46:32: UBT: t 0 CQ 0 CQF 0 TCQ 0 TCQF 0 SO 6 EMS 50
20110121 00:46:34: UBT: t 1 CQ 0 CQF 0 TCQ 0 TCQF 0 SO 6 EMS 49
20110121 00:46:37: UBT: t 0 CQ 0 CQF 0 TCQ 0 TCQF 0 SO 6 EMS 47
20110121 00:46:39: UBT: t 1 CQ 0 CQF 0 TCQ 0 TCQF 0 SO 6 EMS 46
20110121 00:46:42: UBT: t 0 CQ 0 CQF 0 TCQ 0 TCQF 0 SO 6 EMS 49
20110121 00:46:44: UBT: t 0 CQ 0 CQF 0 TCQ 0 TCQF 0 SO 6 EMS 46
20110121 00:46:47: UBT: t 1 CQ 0 CQF 0 TCQ 0 TCQF 0 SO 6 EMS 45
20110121 00:46:49: UBT: t 1 CQ 0 CQF 0 TCQ 0 TCQF 0 SO 6 EMS 45
20110121 00:46:52: UBT: t 0 CQ 0 CQF 0 TCQ 0 TCQF 0 SO 6 EMS 45
20110121 00:46:54: UBT: t 1 CQ 0 CQF 0 TCQ 0 TCQF 0 SO 6 EMS 47
20110121 00:46:57: UBT: t 0 CQ 0 CQF 0 TCQ 0 TCQF 0 SO 6 EMS 45
20110121 00:46:59: UBT: t 0 CQ 0 CQF 0 TCQ 0 TCQF 0 SO 6 EMS 45
20110121 00:47:02: UBT: t 0 CQ 0 CQF 0 TCQ 0 TCQF 0 SO 6 EMS 48
20110121 00:47:04: UBT: t 0 CQ 0 CQF 0 TCQ 0 TCQF 31 SO 6 EMS 47
20110121 00:47:06: UBT: t 2 CQ 0 CQF 0 TCQ 0 TCQF 130 SO 6 EMS 48
20110121 00:47:09: UBT: t 6 CQ 0 CQF 0 TCQ 0 TCQF 225 SO 6 EMS 51
20110121 00:47:11: UBT: t 6 CQ 0 CQF 0 TCQ 0 TCQF 315 SO 6 EMS 51
20110121 00:47:14: UBT: t 9 CQ 0 CQF 0 TCQ 0 TCQF 409 SO 6 EMS 52
20110121 00:47:16: UBT: t 9 CQ 0 CQF 0 TCQ 0 TCQF 504 SO 6 EMS 52
20110121 00:47:19: UBT: t 16 CQ 0 CQF 0 TCQ 0 TCQF 604 SO 6 EMS 52

Olhado, try disabling the download limit (set it to 0) and see if the crash persists.
By the way we should merge all threads about this problem and maybe post a sticky/known bug disclaimer?

Olhado, try disabling the download limit (set it to 0) and see if the crash persists.
I've already tried that. The problem disappears completely after I disable the download limit.

The Ubuntu kernel has been updated to version 25 a few days ago and I can't reproduce the crash anymore. The download limit is set, there are big and popular files in the queue, but aMule keeps running. Can anyone else confirm this?

Well indeed IMO there are several changes will could fix this bug.
I'm putting my mule under load again and I'll see what happens.

Well, as soon as I hit the Post button amule went OOM again. :( So it is reproducible for me:
Linux crysis 2.6.3525generic #44Ubuntu SMP Fri Jan 21 17:40:44 UTC 2011 x86_64 GNU/Linux
Olhado, add a lot of files and set the download limit to something like 8Kb/s and let me know if you can reproduce it.

Well, I ran into the crash even without changing any settings, so yes, it's still there, but it seems to have gotten less frequent  my aMule has been running for three days (not continuously) before it finally crashed.
I can run aMule with gdb and do some more testing but someone would have to tell me what to do (at least roughly) since I've never done this before.

The next thing to try now is Kry's wx patch (http://forum.amule.org/index.php?topic=18506.msg101034#msg101034).
Btkaos, did you try it?

I'll try it as soon as I can.
In the meantime, here's another log  this time I let aMule crash completely:
20110205 13:06:42: UBT: t 1 CQ 0 CQF 0 TCQ 1 TCQF 0 SO 8 EMS 71
20110205 13:06:46: UBT: t 1 CQ 2 CQF 2 TCQ 0 TCQF 0 SO 8 EMS 74
20110205 13:06:51: UBT: t 1 CQ 0 CQF 0 TCQ 2 TCQF 0 SO 8 EMS 71
20110205 13:06:56: UBT: t 0 CQ 0 CQF 0 TCQ 2 TCQF 0 SO 8 EMS 70
20110205 13:07:01: UBT: t 0 CQ 0 CQF 0 TCQ 2 TCQF 0 SO 8 EMS 70
20110205 13:07:06: UBT: t 0 CQ 0 CQF 0 TCQ 1 TCQF 0 SO 8 EMS 67
20110205 13:07:11: UBT: t 0 CQ 0 CQF 0 TCQ 1 TCQF 0 SO 8 EMS 63
20110205 13:07:17: UBT: t 0 CQ 0 CQF 0 TCQ 1 TCQF 0 SO 8 EMS 65
20110205 13:07:22: UBT: t 0 CQ 1 CQF 0 TCQ 0 TCQF 0 SO 8 EMS 66
20110205 13:07:27: UBT: t 1 CQ 0 CQF 0 TCQ 0 TCQF 0 SO 8 EMS 61
20110205 13:07:31: UBT: t 0 CQ 0 CQF 0 TCQ 0 TCQF 0 SO 8 EMS 53
20110205 13:07:36: UBT: t 0 CQ 1 CQF 0 TCQ 0 TCQF 0 SO 8 EMS 51
20110205 13:07:42: UBT: t 0 CQ 0 CQF 0 TCQ 0 TCQF 33 SO 8 EMS 50
20110205 13:07:47: UBT: t 2 CQ 0 CQF 0 TCQ 0 TCQF 126 SO 9 EMS 49
20110205 13:07:52: UBT: t 2 CQ 0 CQF 0 TCQ 0 TCQF 218 SO 9 EMS 50
20110205 13:07:57: UBT: t 7 CQ 0 CQF 0 TCQ 0 TCQF 300 SO 9 EMS 52
20110205 13:08:03: UBT: t 8 CQ 0 CQF 0 TCQ 1 TCQF 394 SO 9 EMS 54
20110205 13:08:08: UBT: t 7 CQ 0 CQF 0 TCQ 0 TCQF 492 SO 9 EMS 53
20110205 13:08:13: UBT: t 15 CQ 0 CQF 0 TCQ 0 TCQF 580 SO 9 EMS 57
20110205 13:08:18: UBT: t 15 CQ 0 CQF 0 TCQ 0 TCQF 674 SO 9 EMS 60
20110205 13:08:24: UBT: t 21 CQ 0 CQF 0 TCQ 0 TCQF 774 SO 9 EMS 66
20110205 13:08:29: UBT: t 22 CQ 0 CQF 0 TCQ 0 TCQF 887 SO 9 EMS 70
20110205 13:08:35: UBT: t 27 CQ 0 CQF 0 TCQ 1 TCQF 992 SO 8 EMS 75
20110205 13:08:40: UBT: t 32 CQ 0 CQF 0 TCQ 0 TCQF 1101 SO 8 EMS 80
20110205 13:08:45: UBT: t 31 CQ 0 CQF 0 TCQ 1 TCQF 1216 SO 8 EMS 84
20110205 13:08:50: UBT: t 41 CQ 0 CQF 0 TCQ 0 TCQF 1310 SO 8 EMS 86
20110205 13:08:56: UBT: t 38 CQ 2 CQF 0 TCQ 3 TCQF 1425 SO 8 EMS 94
20110205 13:09:01: UBT: t 30 CQ 0 CQF 0 TCQ 5 TCQF 1524 SO 8 EMS 96

Kry lastest patch solves the issue and after a closer look it completely makes sense, maybe you'd like to edit the sticky topic STU?

After passing the Cerberus at the registration in the 8th attempt, please allow me to offer my extreme solution: I use aMule for some years already, and this bug or a bug like this was around for something like years too. I really can't live without aMule, but when it crashes every two hours it's of little use. So I tried to see what was the problem with valgrind, but it reported something of an order of a million errors, so I really couldn't find my way there. Finally I wrote a simple script that enabled me to use aMule again:
#!/bin/bash
MAXPERC=20
while true ;
do
PERC=$(ps C amule o %mem=)
echo amule is using $PERC% of the physical memory. We kill it at $MAXPERC%.
#if [[ $PERC > 20 ]]
if [[ $(echo "r=0;if($PERC>$MAXPERC)r=1;r"  bc) == 1 ]]
then
killall KILL amule
sleep 10
echo amule display :0  at now
fi ;
sleep 5
done
So I check if aMule takes more than 20% of the total physical memory once in five seconds, and if it does, I kill it, wait 10 seconds, and then start it again.
I know, it's terrible... But I can start many downloads, use the bandwidth fully, go to sleep, and the next day aMule is still downloading.

Look at the first post for a patch that fixes the problem.

As explained here: http://forum.amule.org/index.php?topic=18687
I get the same problem on my gentoo ~amd64 system. I applied the patch in the first post using portage on wxGTK2.8.11.0.
Amule is working fine now.

It's happend in Kubuntu 10.10 64 bits
I ams my own compiled amule
= BACKTRACE FOLLOWS: =
Current version is: aMule 2.2.6 using wxGTK2 v2.8.11
Running on: Linux 2.6.3527generic x86_64
[2] CamuleApp::OnFatalException() in amule.cpp:1289
[3] wxFatalSignalHandler in /usr/lib/libwx_baseu2.8.so.0[0x7fa38cedd72c]
[4] ?? in /lib/libpthread.so.0[0x7fa38e82ab40]
[5] pthread_mutex_lock in /lib/libpthread.so.0[0x7fa38e824634]
[6] ?? in /lib/libglib2.0.so.0[0x7fa389a6904f]
[7] g_source_remove in /lib/libglib2.0.so.0[0x7fa389a6b90e]
[8] GSocketGUIFunctionsTableConcrete::Uninstall_Callback(GSocket*, GSocketEvent) in /usr/lib/libwx_gtk2u_core2.8.so.0[0x7fa38d546c56]
[9] GSocket::Detected_Write() in /usr/lib/libwx_baseu_net2.8.so.0[0x7fa38d16a5a7]
[10] ?? in /usr/lib/libgdkx112.0.so.0[0x7fa38b82799f]
[11] g_main_context_dispatch in /lib/libglib2.0.so.0[0x7fa389a69342]
[12] ?? in /lib/libglib2.0.so.0[0x7fa389a6d2a8]
[13] g_main_loop_run in /lib/libglib2.0.so.0[0x7fa389a6d7b5]
[14] gtk_main in /usr/lib/libgtkx112.0.so.0[0x7fa38bbe63e7]
[15] wxEventLoop::Run() in /usr/lib/libwx_gtk2u_core2.8.so.0[0x7fa38d545578]
[16] wxAppBase::MainLoop() in /usr/lib/libwx_gtk2u_core2.8.so.0[0x7fa38d5cab1b]
[17] wxEntry(int&, wchar_t**) in /usr/lib/libwx_baseu2.8.so.0[0x7fa38ce7f695]
[18] main in amulegui.cpp:95
[19] __libc_start_main in /lib/libc.so.6[0x7fa38c2f2d8e]
[20] _start in :0

Please try the patch mentioned in the first post.

Hi, I'am having crashes (bad alloc) too.
I run aMule 2.2.6 using wxGTK2 v2.8.10 OS ubuntu 10.04, I've added this repo: http://apt.wxwidgets.org/lucidwx in order to have the latest wxwidgets 2.8.12.10, what do I have to do now? Install new wxwidgets, uninstall amule, and...
thanks

No idea about that repo. In theory replacing the wx libs should be enough. But Ubuntu still has no 2.8.12, not even in 11.10 last time I checked.
I would compile wx and aMule myself as described in the wiki. And you can also try the 2.3.1.rc2 while you're at it. :)