poelzi/ulatencyd

ulatencyd uses 100% CPU

DavidNielsen opened this issue · 9 comments

I am seeing ulatencyd (ppa on x86_64 Natty) using 100% after a while. As this is not in itself useful I would love to know how to extract some information as to what is going on.

Apport also catches some crashes but cannot report these problems automatically is this is a ppa and core repo package.

can you run ulatencyd on a console with:

ulatencyd -v 2

and paste the output when it starts to hang please. I never saw this before.

This one was much harder to cause in debug mode than I expect for some reason, but I finally manage to catch it in action.

I will keep the process in this state in case there is anything I can capture from it. It seems to be stuck updating the process for some reason.

http://ompldr.org/vNzUydw/ulatencyd-log.txt (~3 MB)

ok, that gives more hints.
you can do following
sudo gdb /path/to/ulatencyd

(gdb) attach [pid of ulatencyd]

(gdb) bt

i don't see where it could run wild except maybe libproc does something strange.
a backtrace should help more.

#0 0x00007f8d71090d27 in g_node_insert_before () from /lib/libglib-2.0.so.0
#1 0x0000000000407522 in u_proc_free ()
#2 0x00007f8d71075ae5 in ?? () from /lib/libglib-2.0.so.0
#3 0x00000000004080f6 in update_processes_run ()
#4 0x00000000004081ba in process_update_all ()
#5 0x000000000040890f in iterate ()
#6 0x00007f8d7108862b in ?? () from /lib/libglib-2.0.so.0
#7 0x00007f8d71086d0d in g_main_context_dispatch ()
from /lib/libglib-2.0.so.0
#8 0x00007f8d710874f8 in ?? () from /lib/libglib-2.0.so.0
#9 0x00007f8d71087b3a in g_main_loop_run () from /lib/libglib-2.0.so.0
#10 0x000000000040996d in main ()

thank you very much. there seems that a strange condition causes data corruption causing a process to be his own parent... :-)
i will look into that

i guess i fixed it in trunk. at least the program will exit instead going in an endless loop.

my best guess is that a kernel thread had a parent and then it didn't anymore and this caused the parent node not to be updated. but thats just a wild guess ;-)

That sounds like a good theory of what is happening. Once the PPA is updated I will run it overnight again to see if it is fixed.

i think this one is fixed

Confirmed, I ran ulatencyd overnight without triggering this issue using 0.4.6 from the ppa