aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: 20050813 - Crash of amule after while ...  (Read 4534 times)

sirius

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 18
20050813 - Crash of amule after while ...
« on: August 14, 2005, 11:11:01 PM »

aMule CVS using wxGTK2 v2.6.0 (Snapshot: Sat Aug 13 07:02:04 CEST 2005)

Opps post: http://forum.amule.org/thread.php?threadid=7086

Initialising aMule
Checking if there is an instance already running...
Loading temp files from /amule/temp.
Loading PartFile 2 of 123HTTP download thread end
Loading PartFile 123 of 123
All PartFiles Loaded.
ListenSocket: Ok.

*** TCP socket (ECServer) listening on 0.0.0.0:4512
*** Server UDP socket (TCP+3) at 0.0.0.0:4565
*** TCP socket (TCP) listening on 0.0.0.0:4562
*** Client UDP socket (extended eMule) at 0.0.0.0:4572
Adding file /amule/temp/093.part.met to shares
... (multiple repeats removed) ...
Adding file /amule/temp/047.part.met to shares

Empty dir /amule/incoming/text/ shared
Host: amule.sourceforge.net:80
URL: http://amule.sourceforge.net/lastversion
Response: 200 (Error: 0)
Download size: 6
HTTP download thread end
HTTP download thread end
Compatible client found with ET_COMPATIBLECLIENT of 0x28
... (multiple repeats removed) ...
Compatible client found with ET_COMPATIBLECLIENT of 0x28

aMule terminated after throwing an instance of 'std::bad_alloc'
        Version: aMule CVS using wxGTK2 v2.6.0 (Snapshot: Sat Aug 13 07:02:04 CEST 2005)
        what(): St9bad_alloc
        backtrace:
[2] ?? in /usr/lib/gcc-lib/i586-pc-linux-gnu/3.3.5-20050130/libstdc++.so.5 [0x4088e444]
[3] ?? in /usr/lib/gcc-lib/i586-pc-linux-gnu/3.3.5-20050130/libstdc++.so.5 [0x4088e481]
[4] __cxa_rethrow in /usr/lib/gcc-lib/i586-pc-linux-gnu/3.3.5-20050130/libstdc++.so.5[0x4088e65b]
[5] CKnownFile::CreateHashFromInput(CFileDataIO*, unsigned, unsigned char*, unsigned char*, CAICHHashTree*) const in :0
[6] CKnownFile::CreateHashFromFile(CFileDataIO*, unsigned, unsigned char*, CAICHHashTree*) const in :0
[7] CPartFile::HashSinglePart(unsigned short) in :0
[8] CPartFile::FlushBuffer(bool, bool, bool) in :0
[9] CPartFile::Process(unsigned, unsigned char) in :0
[10] CDownloadQueue::Process() in :0
[11] CamuleApp::OnCoreTimer(wxTimerEvent&) in :0
[12] wxAppConsole::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&), wxEvent&) const in /usr/lib/libwx_gtk2-2.6.so.0[0x4024c9a2]

Aborted
« Last Edit: August 21, 2005, 12:04:28 AM by sirius »
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: 20050813 - Crash of amule after while ...
« Reply #1 on: August 15, 2005, 01:13:27 AM »

Somehow, glibc could not allocate more memory. If you are having this a lot, please try to compile aMule yourself with debug info, maybe we can have a clearer picture of the problem. In the mean time, check to see that you have enough swap memory to run all the apps you have.

Cheers!
Logged

sirius

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 18
Compiled mule with DBUG - result
« Reply #2 on: August 19, 2005, 02:21:41 PM »

Hi, here are the answers:

Yes, there is enough memory - got 512 MB and it's mostly running amule and kde. I've compiled amule with debug, the output see below.

The crash happens around every 30 minutes, see attached log with debug info. for the moment I'm using a restart script and the log is cleaned of all the loading and adding (part)file lines ...

Also, it seems to happen always at the exact same location.

while running, amule spans three instances:

root      5598  5141  0 00:53 pts/1    00:00:00 /bin/sh ./amule-start.sh
root     23232  5598 12 14:24 pts/1    00:01:02 /usr/bin/amule
root     23237 23232  0 14:24 pts/1    00:00:00 /usr/bin/amule
root     23238 23237  0 14:24 pts/1    00:00:00 /usr/bin/amule

top - 14:36:04 up 13:46,  3 users,  load average: 0.42, 0.49, 0.50
Tasks:  87 total,   2 running,  85 sleeping,   0 stopped,   0 zombie
Cpu(s): 14.3% us,  5.0% sy,  0.0% ni, 75.3% id,  4.3% wa,  0.7% hi,  0.3% si
Mem:    514588k total,   508612k used,     5976k free,    26020k buffers
Swap:   257032k total,    54416k used,   202616k free,   417136k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND

23232 root      15   0  596m  37m  11m S 19.0  7.4   1:40.11 amule
23237 root      16   0  596m  37m  11m S  0.0  7.4   0:00.00 amule
23238 root      15   0  596m  37m  11m S  0.0  7.4   0:00.07 amule
 5598 root      16   0  2296  948  840 S  0.0  0.2   0:00.33 amule-start.sh
 
hope this helps, for more info, email me
Logged

ken

  • Hero Member
  • *****
  • Karma: 4
  • Offline Offline
  • Posts: 825
Re: 20050813 - Crash of amule after while ...
« Reply #3 on: August 19, 2005, 08:50:17 PM »

Well, the other possibility is that the requested allocation is ridiculously huge.  Out of curiosity, are you downloading a very large file (larger than 2GB or 4GB)?

The origin of the exception is obscured because it was caught and re-thrown.  It would be helpful if we could see the original place from which it was thrown.

Can you run aMule in gdb and do the following.  When gdb starts up, type "catch throw" to set a catchpoint every place where an exception is throw.  Then "run".  When a catchpoint is hit, we don't know if it's the one we're interested in, so do a "bt" to get a backtrace and then "cont" to let aMule continue running.  Eventually, the crash will happen as it has been.  The last couple of backtraces before the crash are the ones we're interested in.
Logged

sirius

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 18
yes, large file
« Reply #4 on: August 19, 2005, 09:20:20 PM »

Quote
Originally posted by ken
Well, the other possibility is that the requested allocation is ridiculously huge.  Out of curiosity, are you downloading a very large file (larger than 2GB or 4GB)?

yes, I'm downloading a 2.6 GB file and while mule is running, I'm getting some hash error messages for exactly this file ...

Quote
Can you run aMule in gdb and do the following.  When gdb starts up, type "catch throw" to set a catchpoint every place where an exception is throw.  Then "run".  When a catchpoint is hit, we don't know if it's the one we're interested in, so do a "bt" to get a backtrace and then "cont" to let aMule continue running.  Eventually, the crash will happen as it has been.  The last couple of backtraces before the crash are the ones we're interested in.

well, could do, but don't know what gdb is or how to launch amule with it ...

gdb ... something like GNU deBugger?
Logged

ken

  • Hero Member
  • *****
  • Karma: 4
  • Offline Offline
  • Posts: 825
Re: 20050813 - Crash of amule after while ...
« Reply #5 on: August 19, 2005, 09:32:38 PM »

Yes, GNU debugger.

Assuming you have it installed, you launch it from the command line like this:

gdb /path/to/amule

For example, if the amule executable is in /usr/local/bin/amule, you would type:

gdb /usr/local/bin/amule

Gdb will print a bunch of startup messages and eventually give you a prompt: "(gdb)".  There you type the "catch throw" command, and then type "run" to start amule.  Eventually, when amule throws the exception, gdb will stop it and you will have a "(gdb)" prompt again.  Type "bt" to get a backtrace, then type "cont" to let amule continue running.  Repeat this (bt and cont each time gdb stops amule) until you get "aMule terminated after throwing an instance of 'std::bad_alloc'" message.  aMule will abort and control will return to gdb again.  At that point you can just give the "quit" command.  Copy the last two backtraces and post them here.
Logged

sirius

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 18
Function "__cxa_throw" not defined.
« Reply #6 on: August 20, 2005, 05:24:25 PM »

OK, I tried o do so, but I get the following error:

gdb /usr/bin/amule
GNU gdb 6.0
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i586-pc-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".

(gdb) catch throw
Function "__cxa_throw" not defined.
(gdb)


is this likely to be a problem of my gdb or he compiled amule cvs?
I compiled amule-cvs on gentoo like this:


[ebuild   R   ] net-p2p/amule-cvs-2  +X +amuled +debug +gtk2 +kad +nls -nosystray +optimize +remote +remote-gui +stats -unicode 0 kB [2]


cheers
« Last Edit: August 20, 2005, 05:33:25 PM by sirius »
Logged

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Re: 20050813 - Crash of amule after while ...
« Reply #7 on: August 20, 2005, 06:23:22 PM »

ARRRRRRRRRRRRRRRRRRRRGGGGGGGGGGGGGGGGG colours!
Logged

sirius

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 18
Re: 20050813 - Crash of amule after while ...
« Reply #8 on: August 21, 2005, 12:02:20 AM »

Quote
Originally posted by Kry
ARRRRRRRRRRRRRRRRRRRRGGGGGGGGGGGGGGGGG colours!

Yes, I'm the evil COLOR MONNSTER  *grin*
Logged

sirius

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 18
Seems to work now ...
« Reply #9 on: August 21, 2005, 12:10:09 AM »

Hey guy's, just complied the latest CVS version (aMule CVS using wxGTK2 v2.6.0 (Snapshot: Sat Aug 20 07:02:07 CEST 2005)) and it seems to be fine now ... no crashing any more .... did you change something?

Will keep watching for a few day's, but if it's really the large file ... well, hat's finished now. But I could add another one for debugging purposes ... just tell me.

Oh, and I'll check if the amuled now works again ...

And any ideas about the gdb poblem?

Cheers from Berlin

P.s. Ken: Thanks for he detailed gdb description, even so I could not use it yet.
« Last Edit: August 21, 2005, 12:12:31 AM by sirius »
Logged

ken

  • Hero Member
  • *****
  • Karma: 4
  • Offline Offline
  • Posts: 825
Re: 20050813 - Crash of amule after while ...
« Reply #10 on: August 21, 2005, 09:56:36 AM »

You're welcome.  Thanks for trying to do what I asked.  :)

I don't know what the problem with gdb is.  It might be that gdb hasn't yet loaded the symbols from the C++ library at that point.  You could try the following initial commands:

tb CamuleApp::OnInit
run
(... wait for gdb to stop at the breakpoint ...)
catch throw
cont

And from here, you would do the "bt" and "cont" until the crash.

However, since you no longer have this crash, there's no point now.  ;)
Logged