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

Author Topic: aMule hogs memory and dies (bug 0001248)  (Read 11722 times)

JuhaManninen

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
aMule hogs memory and dies (bug 0001248)
« on: January 27, 2008, 10:42:01 AM »

Now I got some output from gdb:

Program received signal SIGILL, Illegal instruction.
[Switching to Thread 0xb6c91a00 (LWP 2351)]
0x09301f01 in ?? ()
(gdb) bt
#0  0x09301f01 in ?? ()
#1  0xb8091096 in ?? ()
#2  0xb7c14817 in ?? () from /usr/lib/libwx_gtk2u_core-2.8.so.0
#3  0xb7306c4f in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#4  0x09301ef8 in ?? ()
#5  0x00000051 in ?? ()
#6  0xb71ebd2d in ?? () from /usr/lib/libglib-2.0.so.0
#7  0xb4c01bf8 in ?? ()
#8  0x00000004 in ?? ()
#9  0xb71bc5d6 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#10 0xb71bf972 in ?? () from /usr/lib/libglib-2.0.so.0
#11 0x0887be58 in ?? ()
#12 0x00000000 in ?? ()
(gdb) bt full
#0  0x09301f01 in ?? ()
No symbol table info available.
#1  0xb8091096 in ?? ()
No symbol table info available.
#2  0xb7c14817 in ?? () from /usr/lib/libwx_gtk2u_core-2.8.so.0
No symbol table info available.
#3  0xb7306c4f in ?? () from /usr/lib/libgdk-x11-2.0.so.0
No symbol table info available.
#4  0x09301ef8 in ?? ()
No symbol table info available.
#5  0x00000051 in ?? ()
No symbol table info available.
#6  0xb71ebd2d in ?? () from /usr/lib/libglib-2.0.so.0
No symbol table info available.
#7  0xb4c01bf8 in ?? ()
No symbol table info available.
#8  0x00000004 in ?? ()
No symbol table info available.
#9  0xb71bc5d6 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
No symbol table info available.
#10 0xb71bf972 in ?? () from /usr/lib/libglib-2.0.so.0
No symbol table info available.
#11 0x0887be58 in ?? ()
No symbol table info available.
#12 0x00000000 in ?? ()
No symbol table info available.
(gdb) thread apply all bt

Thread 4 (Thread 0xb55a5b90 (LWP 2361)):
#0  0xffffe410 in __kernel_vsyscall ()
#1  0xb7f1a7ec in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0xb7a3d6cc in wxConditionInternal::WaitTimeout () from /usr/lib/libwx_baseu-2.8.so.0
#3  0xb7a3d72f in wxCondition::WaitTimeout () from /usr/lib/libwx_baseu-2.8.so.0
#4  0xb7a3e3e5 in wxSemaphoreInternal::WaitTimeout () from /usr/lib/libwx_baseu-2.8.so.0
#5  0xb7a3e46f in wxSemaphore::WaitTimeout () from /usr/lib/libwx_baseu-2.8.so.0
#6  0x083474e8 in CTimerThread::Entry (this=0x88eefb0) at Timer.cpp:63
#7  0xb7a3ea38 in wxThreadInternal::PthreadStart () from /usr/lib/libwx_baseu-2.8.so.0
#8  0xb7a3eaad in wxPthreadStart () from /usr/lib/libwx_baseu-2.8.so.0
#9  0xb7f16192 in start_thread () from /lib/libpthread.so.0
#10 0xb77aa02e in clone () from /lib/libc.so.6

Thread 2 (Thread 0xb65f2b90 (LWP 2359)):
#0  0xffffe410 in __kernel_vsyscall ()
#1  0xb7f1d846 in nanosleep () from /lib/libpthread.so.0
#2  0xb7a44218 in wxMicroSleep () from /usr/lib/libwx_baseu-2.8.so.0
#3  0xb7a44241 in wxMilliSleep () from /usr/lib/libwx_baseu-2.8.so.0
#4  0xb7a3ce2d in wxThread::Sleep () from /usr/lib/libwx_baseu-2.8.so.0
#5  0x081b117f in UploadBandwidthThrottler::Entry (this=0x8e23cf0) at UploadBandwidthThrottler.cpp:324
#6  0xb7a3ea38 in wxThreadInternal::PthreadStart () from /usr/lib/libwx_baseu-2.8.so.0
#7  0xb7a3eaad in wxPthreadStart () from /usr/lib/libwx_baseu-2.8.so.0
#8  0xb7f16192 in start_thread () from /lib/libpthread.so.0
#9  0xb77aa02e in clone () from /lib/libc.so.6

Thread 1 (Thread 0xb6c91a00 (LWP 2351)):
#0  0x09301f01 in ?? ()
#1  0xb8091096 in ?? ()
#2  0xb7c14817 in ?? () from /usr/lib/libwx_gtk2u_core-2.8.so.0
#3  0xb7306c4f in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#4  0x09301ef8 in ?? ()
#5  0x00000051 in ?? ()
#6  0xb71ebd2d in ?? () from /usr/lib/libglib-2.0.so.0
#7  0xb4c01bf8 in ?? ()
#8  0x00000004 in ?? ()
#9  0xb71bc5d6 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#10 0xb71bf972 in ?? () from /usr/lib/libglib-2.0.so.0
#11 0x0887be58 in ?? ()
#12 0x00000000 in ?? ()
Logged

hopelessone

  • Full Member
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 107
  • Ubuntu 8.04
Re: aMule hogs memory and dies (bug 0001248)
« Reply #1 on: January 27, 2008, 01:22:16 PM »

Hi,

I had  this at one stage and fixed it by getting the latest wxWidgets... 2.8.7 from
http://wiki.wxpython.org/InstallingOnUbuntuOrDebian

and the latest CVS aMule...
http://forum.amule.org/index.php?topic=13700.0

also try limiting yer uploads to 80% and give good bandwith allocation...IIC check 'Upload Full chunks' is enabled..

HTH..
Logged

Xaignar

  • Admin and Code Junky
  • Hero Member
  • *****
  • Karma: 19
  • Offline Offline
  • Posts: 1103
Re: aMule hogs memory and dies (bug 0001248)
« Reply #2 on: January 27, 2008, 01:23:18 PM »

But please try to create a full backtrace first!
Logged

Festor

  • Hero Member
  • *****
  • Karma: 79
  • Offline Offline
  • Posts: 935
  • Offline -> Studying...
Re: aMule hogs memory and dies (bug 0001248)
« Reply #3 on: January 27, 2008, 01:33:35 PM »

Hi,

I had  this at one stage and fixed it by getting the latest wxWidgets... 2.8.7 from
http://wiki.wxpython.org/InstallingOnUbuntuOrDebian

I packaging with wxWidgets 2.8.4  of ubuntu repository... I do not know if you have problems using 2.8.7

JuhaManninen

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
Re: aMule hogs memory and dies (bug 0001248)
« Reply #4 on: January 27, 2008, 03:22:34 PM »

Hi,

I had  this at one stage and fixed it by getting the latest wxWidgets... 2.8.7 from
http://wiki.wxpython.org/InstallingOnUbuntuOrDebian

and the latest CVS aMule...
http://forum.amule.org/index.php?topic=13700.0

also try limiting yer uploads to 80% and give good bandwith allocation...IIC check 'Upload Full chunks' is enabled..

HTH..

Please see my bug report 0001248. I compiled the latest wxWidgets 2.8.7 from sources with unicode support and then compiled the latest aMule CVS version from day before yesterday.
I don't use Ubuntu or Debian packages because I have OpenSuse 10.3.

I will look at the upload settings. I must say I don't know much of the details of this aMule program.

Quote
But please try to create a full backtrace first!

How to do it? I followed the instructions at http://www.amule.org/wiki/index.php/Backtraces.

Juha Manninen
Logged

phoenix

  • Evil respawning bird from aMule Dev Team
  • Developer
  • Hero Member
  • *****
  • Karma: 44
  • Offline Offline
  • Posts: 2503
  • The last shadow you'll ever see
Re: aMule hogs memory and dies (bug 0001248)
« Reply #5 on: January 27, 2008, 06:08:45 PM »

Quote
But please try to create a full backtrace first!

How to do it? I followed the instructions at http://www.amule.org/wiki/index.php/Backtraces.

Juha Manninen

Your backtrace is fine, the problem is probably not in the code, look:
Quote
Program received signal SIGILL, Illegal instruction.
This means memory corruption in the CODE segment. It can be a bad compiler (unlikely), a faulty HD, faulty memory chips, overheated CPU, etc.

Try running memtest on your system for some time and look at the logs to see if there is a problem in the disk subsystem.
Logged

JuhaManninen

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
Re: aMule hogs memory and dies (bug 0001248)
« Reply #6 on: January 27, 2008, 10:35:47 PM »

Your backtrace is fine, the problem is probably not in the code, look:
Quote
Program received signal SIGILL, Illegal instruction.
This means memory corruption in the CODE segment. It can be a bad compiler (unlikely), a faulty HD, faulty memory chips, overheated CPU, etc.

Try running memtest on your system for some time and look at the logs to see if there is a problem in the disk subsystem.

Everything is possible, sure, but this machine has been very reliable and I haven't experienced similar problems with any other program. The extensive memory hogging hasn't happened with other programs either. I didn't see in what situation the "Illegal instruction" error came but I guess all memory was eaten again.

I compiled wxwidgets and aMule following the instructions in the other thread. Now the new version has been running few hours already inside gdb. Let's see if it will die...
There was --enable-geoip included and I had to install geoip package. Could that missing package have been a problem earlier? Maybe not.

Juha Manninen
Logged

phoenix

  • Evil respawning bird from aMule Dev Team
  • Developer
  • Hero Member
  • *****
  • Karma: 44
  • Offline Offline
  • Posts: 2503
  • The last shadow you'll ever see
Re: aMule hogs memory and dies (bug 0001248)
« Reply #7 on: January 28, 2008, 12:03:41 AM »

Quote
Could that missing package have been a problem earlier? Maybe not.
Unlikely.

Ilegal instruction means that somehow the CPU has been fed with a wrong byte to execute. There are many ways that this can happen, most involve some sort of hardware failure. An exception is a compiler generating wrong code, which is very unlikely too.

My experience with using distribution conpiled wx libraries is very bad.

Lets see what will happen now.
Logged

JuhaManninen

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
Re: aMule hogs memory and dies (bug 0001248)
« Reply #8 on: January 28, 2008, 05:55:00 PM »

Now I got this:

Program terminated with signal SIGKILL, Killed.
The program no longer exists.
(gdb) bt
No stack.


-------------

This "No stack" is weird because I compiled both wxWidgets and aMule with all debug information.
I started debugging with "gdb /usr/local/bin/amule". Before that I had installed aMule as root. Is that a problem?
Earlier I got at least some output from gdb.
Anyway, at night I heard the hard drive running which means the memory was completely used again. The program always dies after it but the error message seems to be different ("Killed" or "Illegal instruction" or "Segmentation fault" or something).

Damn!

Juha Manninen
Logged

JuhaManninen

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
Re: aMule hogs memory and dies (bug 0001248)
« Reply #9 on: January 28, 2008, 06:23:38 PM »

Wow, now I started aMule and stopped it quite soon normally (with up-right "X"). This is the output from gdb. It says among other things: "There were memory leaks."
Yes!!!

-------------------------------

(gdb) run
Starting program: /usr/local/bin/amule
[Thread debugging using libthread_db enabled]
[New Thread 0xb6c196d0 (LWP 7745)]
Checkpoint set on app init for memory debug
Initialising aMule
Checking if there is an instance already running...
No other instances are running.
[New Thread 0xb67b0b90 (LWP 7755)]
Loading temp files from /Extra/aMule/Temp.
Loading PartFile 54 of 54
All PartFiles Loaded.
ListenSocket: Ok.

External connections disabled in config file
*** Server UDP socket (TCP+3) at 0.0.0.0:4665
*** TCP socket (TCP) listening on 0.0.0.0:4662
*** Client UDP socket (extended eMule) at 0.0.0.0:4672
Adding file /Extra/aMule/Temp/033.part.met to shares
Adding file /Extra/aMule/Temp/036.part.met to shares
Adding file /Extra/aMule/Temp/055.part.met to shares
Adding file /Extra/aMule/Temp/093.part.met to shares
Adding file /Extra/aMule/Temp/132.part.met to shares
Adding file /Extra/aMule/Temp/162.part.met to shares
Adding file /Extra/aMule/Temp/001.part.met to shares
Adding file /Extra/aMule/Temp/002.part.met to shares
Adding file /Extra/aMule/Temp/003.part.met to shares
Adding file /Extra/aMule/Temp/005.part.met to shares
Adding file /Extra/aMule/Temp/007.part.met to shares
Adding file /Extra/aMule/Temp/008.part.met to shares
Adding file /Extra/aMule/Temp/012.part.met to shares
Adding file /Extra/aMule/Temp/021.part.met to shares
Adding file /Extra/aMule/Temp/023.part.met to shares
Adding file /Extra/aMule/Temp/024.part.met to shares
Adding file /Extra/aMule/Temp/025.part.met to shares
Adding file /Extra/aMule/Temp/032.part.met to shares
[New Thread 0xb5f64b90 (LWP 7756)]
[New Thread 0xb5763b90 (LWP 7757)]
[Thread 0xb5f64b90 (LWP 7756) exited]
[Thread 0xb67b0b90 (LWP 7755) exited]
Shutting down aMule...
aMule dialog destroyed
[Thread 0xb5763b90 (LWP 7757) exited]
Now, exiting main app...
aMule OnExit: Terminating core.
Saving PartFile 54 of 54
All PartFiles Saved.
aMule shutdown completed.
Memory debug results for aMule exit:
***************Stats**************
----- Memory statistics of aMule at Mon Jan 28 19:14:07 2008 -----
102 objects of class wxEvent, total size 3672
2 objects of class CServerSocket, total size 2024
2 objects of class wxDatagramSocket, total size 648
11 objects of class wxBitmap, total size 88
259 objects of class wxMask, total size 3108
1 objects of class wxFont, total size 8
16 objects of class wxPen, total size 128
5 objects of class wxBrush, total size 40
3 objects of class wxColour, total size 24
1 objects of class wxXPMHandler, total size 24
1 objects of class wxTGAHandler, total size 24
1 objects of class wxANIHandler, total size 24
1 objects of class wxCURHandler, total size 24
1 objects of class wxICOHandler, total size 24
1 objects of class wxPCXHandler, total size 24
1 objects of class wxPNMHandler, total size 24
1 objects of class wxGIFHandler, total size 24
1 objects of class wxTIFFHandler, total size 24
1 objects of class wxJPEGHandler, total size 24
1 objects of class wxPNGHandler, total size 24
1 objects of class wxCursor, total size 8
4 objects of class wxList, total size 112
1940 objects of class nonobject, total size 60375

Number of object items: 417
Number of non-object items: 1940
Total allocated size: 70499


There were memory leaks.

----- Memory dump -----
non-object data at 0x8F670F8, size 40
non-object data at 0x8F6B828, size 36
wxMask at 0x8F6B880, size 12
non-object data at 0x8F6B8C0, size 32
non-object data at 0x8F6AEB8, size 36
wxMask at 0x8F6AF10, size 12
non-object data at 0x8F6AF50, size 32
non-object data at 0x8F676B8, size 36
wxMask at 0x8F6B970, size 12
non-object data at 0x8F6B9B0, size 32
non-object data at 0x8F6BA60, size 36
wxMask at 0x8F6BAB8, size 12
non-object data at 0x8F6AC98, size 32
non-object data at 0x8F6AD48, size 36
wxMask at 0x8F6ADA0, size 12
non-object data at 0x8F6ADE0, size 32
non-object data at 0x8F67458, size 36
wxMask at 0x8F674B0, size 12
non-object data at 0x8F674F0, size 32
non-object data at 0x8F67630, size 36
wxMask at 0x8F6A5D8, size 12
non-object data at 0x8F6A618, size 32
non-object data at 0x8F6A6C8, size 36
wxMask at 0x8F6A720, size 12
non-object data at 0x8F6A760, size 32
non-object data at 0x8F6A810, size 36
wxMask at 0x8F6A868, size 12
non-object data at 0x8F6A8A8, size 32
non-object data at 0x8F6A958, size 36
wxMask at 0x8F6A9B0, size 12
non-object data at 0x8F6A9F0, size 32
non-object data at 0x8F6AAA0, size 36
wxMask at 0x8F6AAF8, size 12
non-object data at 0x8F6AB38, size 32
non-object data at 0x8F6ABE8, size 36
wxMask at 0x8F6AC40, size 12
non-object data at 0x8F6BE28, size 32
non-object data at 0x8F6BED8, size 36
wxMask at 0x8F6BF30, size 12
non-object data at 0x8F6BF70, size 32
non-object data at 0x8F6C020, size 36

... many many similar lines. Exceeded 20000 characters limit ...

wxMask at 0x8F8A2A8, size 12
non-object data at 0x8F8A2E8, size 32
non-object data at 0x8F8A398, size 36
wxMask at 0x8F8A3F0, size 12
non-object data at 0x8F8A430, size 32
non-object data at 0x8F8A4E0, size 36
wxMask at 0x8F8A538, size 12
non-object data at 0x8F8A578, size 32
non-object data at 0x8F8A628, size 36
wxMask at 0x8F8A680, size 12
non-object data at 0x8F8A6C0, size 32
non-object data at 0x8F8A770, size 36
wxMask at 0x8F8A7C8, size 12
non-object data at 0x8F8A808, size 32
non-object data at 0x8F8A8B8, size 36
wxMask at 0x8F8A910, size 12
non-object data at 0x8F8A950, size 32
CServerSocket at 0x8A4E708, size 1012
non-object data at 0x8986D80, size 28
non-object data at 0x92C2FB0, size 28
non-object data at 0x9202590, size 152
non-object data at 0x8A48BE8, size 76
CServerSocket at 0x92BF228, size 1012
non-object data at 0x8A4E3A0, size 28
non-object data at 0x92B65E0, size 28
non-object data at 0x8FBF000, size 152
non-object data at 0x8FE0718, size 76
non-object data at 0x903EEE8, size 28
non-object data at 0x9069EF8, size 82
non-object data at 0x8EDE9D0, size 12
non-object data at 0x91E3958, size 17
non-object data at 0x906C8E8, size 14
non-object data at 0x92D31C0, size 390
non-object data at 0x8A4BFF8, size 390
non-object data at 0x8A4D080, size 630
non-object data at 0x8A4BEE0, size 90
non-object data at 0x9061720, size 17
non-object data at 0x92CE968, size 390
non-object data at 0x92D38A0, size 630
non-object data at 0x8A4BD78, size 90
non-object data at 0x92C9298, size 390
non-object data at 0x92D3B48, size 630
non-object data at 0x8A4D3B0, size 90
non-object data at 0x92CF0A8, size 19
non-object data at 0x92D3FA0, size 390
non-object data at 0x8A3A858, size 14
non-object data at 0x92D4710, size 390
non-object data at 0x92D4B68, size 630
non-object data at 0x92B54F8, size 11
non-object data at 0x91E8E50, size 14
non-object data at 0x90C4008, size 90
non-object data at 0x92C9450, size 390
non-object data at 0x92D4E10, size 630
non-object data at 0x92CF4D0, size 90
non-object data at 0x92D48C8, size 390
non-object data at 0x9072CC8, size 16
non-object data at 0x9071E18, size 14
non-object data at 0x92D50B8, size 630
non-object data at 0x92CF560, size 90
non-object data at 0x9030070, size 4
non-object data at 0x92B0378, size 14
non-object data at 0x8F8F618, size 9
non-object data at 0x8A4E628, size 14
non-object data at 0x8FFE0E0, size 6
non-object data at 0x92E6FE8, size 14


----- Memory statistics -----
2 objects of class CServerSocket, total size 2024
248 objects of class wxMask, total size 2976
543 objects of class nonobject, total size 25231

Number of object items: 250
Number of non-object items: 543
Total allocated size: 30231



Program exited normally.
(gdb)
Logged

phoenix

  • Evil respawning bird from aMule Dev Team
  • Developer
  • Hero Member
  • *****
  • Karma: 44
  • Offline Offline
  • Posts: 2503
  • The last shadow you'll ever see
Re: aMule hogs memory and dies (bug 0001248)
« Reply #10 on: January 29, 2008, 01:42:06 AM »

JuhaManninen,

Never run any program as root if you don't absolutely need to. In particular, it is not a good idea to do that with a program that you suspect that is misbehaving like aMule is.

Those memory leaks are normal, they are not related to your problem. You will get them even if you do nothing. wxStuff. The only interesting informatio regarding aMule is that there seems to have been a leak of "2 objects of class CServerSocket, total size 2024".

By now you have a fully debug aMule/wxWidgets, you should be able to generate nice backtraces.
Logged

JuhaManninen

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
Re: aMule hogs memory and dies (bug 0001248)
« Reply #11 on: January 29, 2008, 09:39:14 AM »

JuhaManninen,

Never run any program as root if you don't absolutely need to. In particular, it is not a good idea to do that with a program that you suspect that is misbehaving like aMule is.

Those memory leaks are normal, they are not related to your problem. You will get them even if you do nothing. wxStuff. The only interesting informatio regarding aMule is that there seems to have been a leak of "2 objects of class CServerSocket, total size 2024".

By now you have a fully debug aMule/wxWidgets, you should be able to generate nice backtraces.


I  _installed_  aMule as root, with "su" and then "make install" and then "exit". I didn't run it as root. My question was about if that installation with a different user makes any problem for debugging.

The last time the program died, gdb said "No stack". I don't understand why because I really should have all debug information now.

Now the program has been running a long time without problems. The only difference is that I limited the connection bandwith for upload. It was suggested earlier and it may have an effect.
Logged

phoenix

  • Evil respawning bird from aMule Dev Team
  • Developer
  • Hero Member
  • *****
  • Karma: 44
  • Offline Offline
  • Posts: 2503
  • The last shadow you'll ever see
Re: aMule hogs memory and dies (bug 0001248)
« Reply #12 on: January 29, 2008, 10:48:55 AM »

Ok, installing as root is fine, though not strictly necessary.

Also, if the program died with SIGKILL and you did not explicitly "kill -9" it, then you have a very strange behaving system. "No stack" is equally strange, but is not related to having or not full debug information. It means that some serious error happened and gdb was not able to locate the stack.

Limiting upload speed is important so that you can use your system while aMule is running. If you don't do that and aMule saturates the uplink, you will not be able to even use an internet browser. But in theory has nothing to do with crashing, aMule should not crash even with full upload speed.
Logged

hopelessone

  • Full Member
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 107
  • Ubuntu 8.04
Re: aMule hogs memory and dies (bug 0001248)
« Reply #13 on: January 29, 2008, 12:04:57 PM »

from what i read it a wxWidgets bug as it tries to calculate each block to upload and consumes memory until you have none left...thats why i limited mine and had no further out of memory problems...so it's not aMule just wxWidgets..check that [Upload full Chunks} is enables also...

HTH..
Logged

Xaignar

  • Admin and Code Junky
  • Hero Member
  • *****
  • Karma: 19
  • Offline Offline
  • Posts: 1103
Re: aMule hogs memory and dies (bug 0001248)
« Reply #14 on: January 29, 2008, 03:50:49 PM »

Where did you read that?
Logged
Pages: [1] 2