aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: abnormal OS resources consumption  (Read 2870 times)

paksas

  • Newbie
  • Karma: 0
  • Offline Offline
  • Posts: 1
abnormal OS resources consumption
« on: October 31, 2006, 09:07:34 PM »

Hello

I'm currently using aMule 2.1.3, but the same thing's been happening on 2.1.0.

When running, aMule can suddenly consume up to 98% of CPU time, stalling all other processes. Sometimes it recovers after a few minutes, sometimes it needs to be restarted.

Could You please help me get to the bottom of this problem?

Thank You very much.
Logged
Peace,
Paksas

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: abnormal OS resources consumption
« Reply #1 on: November 06, 2006, 01:57:51 AM »

paksas,

Actually, you must help us to get to the bottom of this problem. Try running aMule inside gdb, and when you notice this abnormal cpu usage, stop it and see where it was in code with a backtrace.

Cheers!
Logged

zamb

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 16
Same problem?
« Reply #2 on: December 09, 2006, 12:33:11 AM »

I don't know if this is the same problem or not... But I'm having some trouble: about every two minutes aMule consume all the CPU power for a few seconds and then it drop back to normal 1~2% CPU consumption.

Here's a backtrace of aMule while in it's odd behaviour:
Code: [Select]
Program received signal SIGINT, Interrupt.
0xb736bc90 in g_type_check_instance_is_a () from /usr/lib/libgobject-2.0.so.0
(gdb) backtrace
#0  0xb736bc90 in g_type_check_instance_is_a () from /usr/lib/libgobject-2.0.so.0
#1  0xb7c55696 in wxWindow::GtkUpdate () from /usr/lib/libwx_gtk2u_core-2.6.so.0
#2  0xb7c556ab in wxWindow::GtkUpdate () from /usr/lib/libwx_gtk2u_core-2.6.so.0
#3  0xb7c556ab in wxWindow::GtkUpdate () from /usr/lib/libwx_gtk2u_core-2.6.so.0
#4  0xb7c55803 in wxWindow::OnInternalIdle () from /usr/lib/libwx_gtk2u_core-2.6.so.0
#5  0xb7c4db20 in wxTopLevelWindowGTK::OnInternalIdle () from /usr/lib/libwx_gtk2u_core-2.6.so.0
#6  0xb7cccca5 in wxAppBase::SendIdleEvents () from /usr/lib/libwx_gtk2u_core-2.6.so.0
#7  0xb7ccd15b in wxAppBase::ProcessIdle () from /usr/lib/libwx_gtk2u_core-2.6.so.0
#8  0xb7c28536 in wxapp_idle_callback () from /usr/lib/libwx_gtk2u_core-2.6.so.0
#9  0xb72d8a01 in g_idle_dispatch () from /usr/lib/libglib-2.0.so.0
#10 0xb72da781 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#11 0xb72dd7df in g_main_context_iterate () from /usr/lib/libglib-2.0.so.0
#12 0xb72ddb97 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#13 0xb7597151 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#14 0xb7c4211b in wxEventLoop::Run () from /usr/lib/libwx_gtk2u_core-2.6.so.0
#15 0xb7cccfbe in wxAppBase::MainLoop () from /usr/lib/libwx_gtk2u_core-2.6.so.0
#16 0xb7ccc661 in wxAppBase::OnRun () from /usr/lib/libwx_gtk2u_core-2.6.so.0
#17 0xb7a5e73a in wxEntry () from /usr/lib/libwx_baseu-2.6.so.0
#18 0xb7a5e7f6 in wxEntry () from /usr/lib/libwx_baseu-2.6.so.0
#19 0x08186290 in wxWindowBase::SetName ()
#20 0xb77c27c8 in __libc_start_main () from /lib/libc.so.6
#21 0x08069e31 in ?? ()
My system is ArchLinux updated to the latest packages (the latest stable released by the upstream developers. ArchLinux uses a "Rolling Release System" where they upload the latest packages as they are released by their respective developers).

Thanks.
(By the way, here's how I obtained the backtrace: I ran "gdb amule" and monitored the process using "top" until it settled and start to function normally, and once "amule" start to act-up, I immediately hit CTRL-C within gdb, this will stop the process from running. After that I typed "backtrace" and the output is what you see above. If you want I could compile aMule myself and leave the debugging symbols if that help you.  If my way of obtaining the backtrace is flawed tell me how to do it correctly and I'll be thankful.)

EDIT #1:
I don't think the above backtrace is very useful!  Running multible backtracess gave diffrent results almost each time.

Here are some that I think are useful:
Code: [Select]
Program received signal SIGINT, Interrupt.
[Switching to Thread -1225840944 (LWP 2696)]
0xb7eea410 in ?? ()
(gdb) backtrace
#0  0xb7eea410 in ?? ()
#1  0xbf849358 in ?? ()
#2  0x00000013 in ?? ()
#3  0x00000013 in ?? ()
#4  0xb77dda43 in poll () from /lib/libc.so.6
#5  0xb7ba2c06 in wxapp_poll_func () from /usr/lib/libwx_gtk2u_core-2.6.so.0
#6  0xb7258813 in g_main_context_iterate () from /usr/lib/libglib-2.0.so.0
#7  0xb7258b97 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#8  0xb7512151 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#9  0xb7bbd11b in wxEventLoop::Run () from /usr/lib/libwx_gtk2u_core-2.6.so.0
#10 0xb7c47fbe in wxAppBase::MainLoop () from /usr/lib/libwx_gtk2u_core-2.6.so.0
#11 0xb7c47661 in wxAppBase::OnRun () from /usr/lib/libwx_gtk2u_core-2.6.so.0
#12 0xb79d973a in wxEntry () from /usr/lib/libwx_baseu-2.6.so.0
#13 0xb79d97f6 in wxEntry () from /usr/lib/libwx_baseu-2.6.so.0
#14 0x08186290 in wxWindowBase::SetName ()
#15 0xb773d7c8 in __libc_start_main () from /lib/libc.so.6
#16 0x08069e31 in ?? ()
and
Code: [Select]
Program received signal SIGINT, Interrupt.
0xb7ec97f7 in pthread_mutex_lock () from /lib/libpthread.so.0
(gdb) backtrace
#0  0xb7ec97f7 in pthread_mutex_lock () from /lib/libpthread.so.0
#1  0xb6f23395 in _xcb_lock_io () from /usr/lib/libxcb.so.1
#2  0xb6f33752 in xcb_xlib_lock () from /usr/lib/libxcb-xlib.so.0
#3  0xb70db3ec in _XCBLockDisplay () from /usr/lib/libX11.so.6
#4  0xb70b33f5 in XDefineCursor () from /usr/lib/libX11.so.6
#5  0xb73bb1f3 in gdk_window_set_cursor () from /usr/lib/libgdk-x11-2.0.so.0
#6  0xb7c126ee in wxCheckBox::OnInternalIdle () from /usr/lib/libwx_gtk2u_core-2.6.so.0
#7  0xb7c47ca5 in wxAppBase::SendIdleEvents () from /usr/lib/libwx_gtk2u_core-2.6.so.0
#8  0xb7c47cde in wxAppBase::SendIdleEvents () from /usr/lib/libwx_gtk2u_core-2.6.so.0
#9  0xb7c47cde in wxAppBase::SendIdleEvents () from /usr/lib/libwx_gtk2u_core-2.6.so.0
#10 0xb7c4815b in wxAppBase::ProcessIdle () from /usr/lib/libwx_gtk2u_core-2.6.so.0
#11 0xb7ba3536 in wxapp_idle_callback () from /usr/lib/libwx_gtk2u_core-2.6.so.0
#12 0xb7253a01 in g_idle_dispatch () from /usr/lib/libglib-2.0.so.0
#13 0xb7255781 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#14 0xb72587df in g_main_context_iterate () from /usr/lib/libglib-2.0.so.0
#15 0xb7258b97 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#16 0xb7512151 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#17 0xb7bbd11b in wxEventLoop::Run () from /usr/lib/libwx_gtk2u_core-2.6.so.0
#18 0xb7c47fbe in wxAppBase::MainLoop () from /usr/lib/libwx_gtk2u_core-2.6.so.0
#19 0xb7c47661 in wxAppBase::OnRun () from /usr/lib/libwx_gtk2u_core-2.6.so.0
#20 0xb79d973a in wxEntry () from /usr/lib/libwx_baseu-2.6.so.0
#21 0xb79d97f6 in wxEntry () from /usr/lib/libwx_baseu-2.6.so.0
#22 0x08186290 in wxWindowBase::SetName ()
#23 0xb773d7c8 in __libc_start_main () from /lib/libc.so.6
#24 0x08069e31 in ?? ()
and
Code: [Select]
Program received signal SIGINT, Interrupt.
0xb7eea410 in ?? ()
(gdb) backtrace
#0  0xb7eea410 in ?? ()
#1  0xbf8490b0 in ?? ()
#2  0x00000001 in ?? ()
#3  0xbf84925c in ?? ()
#4  0xb77dffd2 in do_writev () from /lib/libc.so.6
#5  0xb77e009b in writev () from /lib/libc.so.6
#6  0xb6f235cd in _xcb_conn_wait () from /usr/lib/libxcb.so.1
#7  0xb6f23b46 in _xcb_out_send () from /usr/lib/libxcb.so.1
#8  0xb6f23c71 in _xcb_out_flush_to () from /usr/lib/libxcb.so.1
#9  0xb6f23dbf in xcb_flush () from /usr/lib/libxcb.so.1
#10 0xb70dc51e in _XSend () from /usr/lib/libX11.so.6
#11 0xb70dc65b in _XEventsQueued () from /usr/lib/libX11.so.6
#12 0xb70c5833 in XPending () from /usr/lib/libX11.so.6
#13 0xb73a516d in gdk_check_xpending () from /usr/lib/libgdk-x11-2.0.so.0
#14 0xb73a5261 in gdk_event_prepare () from /usr/lib/libgdk-x11-2.0.so.0
#15 0xb7257cdd in g_main_context_prepare () from /usr/lib/libglib-2.0.so.0
#16 0xb72584a5 in g_main_context_iterate () from /usr/lib/libglib-2.0.so.0
#17 0xb7258b97 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#18 0xb7512151 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#19 0xb7bbd11b in wxEventLoop::Run () from /usr/lib/libwx_gtk2u_core-2.6.so.0
#20 0xb7c47fbe in wxAppBase::MainLoop () from /usr/lib/libwx_gtk2u_core-2.6.so.0
#21 0xb7c47661 in wxAppBase::OnRun () from /usr/lib/libwx_gtk2u_core-2.6.so.0
#22 0xb79d973a in wxEntry () from /usr/lib/libwx_baseu-2.6.so.0
#23 0xb79d97f6 in wxEntry () from /usr/lib/libwx_baseu-2.6.so.0
#24 0x08186290 in wxWindowBase::SetName ()
#25 0xb773d7c8 in __libc_start_main () from /lib/libc.so.6
#26 0x08069e31 in ?? ()
I'm almost pretty sure the problem lays in libX11 and/or libxcb because befor some update to those packages I didn't have any problem with CPU consumption.

Thanks.
« Last Edit: December 09, 2006, 02:22:55 AM by zamb »
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: abnormal OS resources consumption
« Reply #3 on: December 09, 2006, 04:00:05 AM »

zamb,

Your process of obtaining the backtrace is all right. And your conclusion seems to be all right too. None of the backtraces you posted is code inside aMule. Seems like for some unknown reason, gtk is hogging the CPU. You both are not the first ones to report this behaviour.

Unfortunately, it does not happen here in my computer. But even if it did happen, from your backtraces, it seems that there would be little for me to do. Except, pehaps, recompiling gtk. Maybe use an older version?
Logged

zamb

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 16
Solved...
« Reply #4 on: December 10, 2006, 04:27:09 PM »

I solved the problem by recompiling wxGTK (I used the just released wxGTK 2.8.0rc3) and the newest CVS aMule (2006-12-09) and everything works OK.  (By the way, UPnP is working great! Also: No crashing when closing a tab or clearing the search.)

Thanks for your hard work and your quick response.
(To the original poster: I'm sorry for hi-jacking the thread for myself. I hope an upgrade to a new version of wxGTK/wxWidgets will solve your problem as well.)
Ziyad.
« Last Edit: December 10, 2006, 05:49:49 PM by zamb »
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: abnormal OS resources consumption
« Reply #5 on: December 11, 2006, 01:40:56 AM »

Nice! Congratulations zamb! :)
Logged