aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: amule hangs  (Read 9725 times)

pmpfe

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
amule hangs
« on: December 30, 2004, 05:24:49 PM »

Hi there, and please excuse me if this is posted in the wrong section, as it is not actually a crash, but a hang.

My amule seems to hang sometimes, freezing. The 'ps' utility shows a parent amule on R ("on run queue") and a child amule on S ("sleeping").
When I tried to gdb the processes, the parent was blocked on a select and the child blocked on an "fts_children" function.

Does anyone have any hint on what may be going on?

Thanks in advance,
Paulo
« Last Edit: December 30, 2004, 05:25:51 PM by pmpfe »
Logged

deltaHF

  • Evil Admin
  • Former Developer
  • Hero Member
  • *****
  • Karma: 6
  • Offline Offline
  • Posts: 3920
  • .. Legends may sleep, but they never die ..
    • http://www.amule.org
Re: amule hangs
« Reply #1 on: December 30, 2004, 08:49:11 PM »

hi,

tell us more about your pc .. which wxgtk version etc. and maybe run your amule in gdb -> http://www.amule.org/wiki/index.php/Backtraces

cheers

pmpfe

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
Re: amule hangs
« Reply #2 on: December 30, 2004, 11:09:47 PM »

Quote
Originally posted by deltaHF
tell us more about your pc .. which wxgtk version etc. and maybe run your amule in gdb -> http://www.amule.org/wiki/index.php/Backtraces
cheers
wxgtk-2.4-config, wxbase-config and wx-config all yield version 2.4.2.

Here's the output of ldd on my amule binary.

I'll post a full gdb backtrace as soon as the freezing occurs again (I'll leave it running tonight and in the morning it will probably be frozen).

Thanks again,
Paulo
Logged

ken

  • Hero Member
  • *****
  • Karma: 4
  • Offline Offline
  • Posts: 825
Re: amule hangs
« Reply #3 on: December 31, 2004, 07:55:58 AM »

In the case of a freeze (as opposed to a crash), all threads may be of interest, so you might want to do:

thread apply all bt

Thanks for your help.
Logged

pmpfe

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
Re: amule hangs
« Reply #4 on: December 31, 2004, 08:18:23 AM »

Here's a bt of the child amule (bt full doesn't give extra information (it says no symbol table info available, even though my amule was compiled with debugging information. I assume it is because all functions in backtrace tree are not part of amule code.))

'thread apply all bt' does not seem to do anything, but I'll keep executing it before producing further backtraces.

(gdb) bt
#0  0x40aa27a2 in fts_children () from /lib/libc.so.6
#1  0x40aa286c in poll () from /lib/libc.so.6
#2  0x400319c0 in pthread_detach () from /lib/libpthread.so.0
#3  0x40aab037 in clone () from /lib/libc.so.6
(gdb)

The parent process bt is longer, so I've put it here. I should mention that "reloadaIPF", a function that is part of the backtrace, is a simple two liner I put in amuleDlg.cpp to handle the USR1 signal, so that I can have amule reload the filters at scheduled times.
Here's the code for the function.
Code: [Select]
void reloadaIPF(int i){
        theApp.ipfilter->Reload();
        theApp.clientlist->FilterQueues();
}

Is this wrong? Is there a problem with applying a filter reload like this? Please let me know if it was two naiv of me to think I could get by with something this simple.

Incidentally, an actual crashed occurred today, which might not even be related to this ipf reloading problem, the bt for which I've put here.

Sorry for the pile of confusion, and thanks again in advance for any hints you might have.

Paulo
Logged

GonoszTopi

  • The current man in charge of most things.
  • Administrator
  • Hero Member
  • *****
  • Karma: 169
  • Offline Offline
  • Posts: 2685
Re: amule hangs
« Reply #5 on: December 31, 2004, 11:11:23 AM »

Seems to me that your reloadIPF() function might be responsible for the hang.

A nicer, and "officially supported" way of reload ipfilter at scheduled times is with amulecmd, just issue "amulecmd -f -c reloadipf" from cron. Afaik it can be compiled with wxBase-2.4.2 too, you just have to add --enable-amulecmd to your configure flags.
Logged
concordia cum veritate

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Re: amule hangs
« Reply #6 on: December 31, 2004, 01:08:19 PM »

Do you call that function from a thread?
Logged

ken

  • Hero Member
  • *****
  • Karma: 4
  • Offline Offline
  • Posts: 825
Re: amule hangs
« Reply #7 on: December 31, 2004, 06:41:15 PM »

Quote
Originally posted by pmpfe
'thread apply all bt' does not seem to do anything, but I'll keep executing it before producing further backtraces.
Nevermind, then.  It shouldn't be executed "before" backtraces, it should produce the backtraces itself.  In other words, one would use it instead of just plain "bt".  However, if it does nothing, then it must be a difference between our versions of gdb.  Sorry about the blind alley.  ;)
Logged

pmpfe

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
Re: amule hangs
« Reply #8 on: December 31, 2004, 08:14:44 PM »

Quote
Originally posted by GonoszTopi
Seems to me that your reloadIPF() function might be responsible for the hang.
A nicer, and "officially supported" way of reload ipfilter at scheduled times is with amulecmd, just issue "amulecmd -f -c reloadipf" from cron. Afaik it can be compiled with wxBase-2.4.2 too, you just have to add --enable-amulecmd to your configure flags.
Unfortunately, as I understand, the reloadipf for amulecmd does not filter the queue after filter reload (which is something I need). The strange thing is that if I remove the queue filtering it seems to become a lot more stable (hasn't crashed or frozen for 13 straight hours now, though I remember it crashed in a former version where I did not have the queue filtering part).

ken: thanks for the hint anyways, if I happen to find myself debugging a threaded app one of these days it might come in handy :)

Quote
Originally posted by Kry
Do you call that function from a thread?
No, I install the function as a signal handler and it runs in response to shell kill commands. I have
Code: [Select]
signal(SIGUSR1, reloadaIPF); in amuleDlg.cpp just after the signal(SIGPIPE, SIG_IGN).

Paulo

EDIT: Happy new year :D
« Last Edit: December 31, 2004, 08:29:10 PM by pmpfe »
Logged

pmpfe

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
new bts
« Reply #9 on: January 01, 2005, 08:41:22 AM »

The hang occured again (this time without queue filtering on filter reload). The new bts are here.

Paulo
Logged