|
From: Christian P. <tr...@ge...> - 2011-05-12 15:23:34
|
hi, i just found out, that my (life) running server process, running unter valgrind (because it's beta) is eating up 100% cpu, however, clients connecting to it are served just fine, in terms of speed / responsivity. As I should not just kill the process by now, I did an strace on it, to find out more, and saw, that it was actually *flooding* me with the following output. write(1018, "Y", 1) = 1 rt_sigprocmask(SIG_SETMASK, [], ~[ILL TRAP BUS FPE KILL SEGV STOP], 8) = 0 read(186, "", 558) = 0 rt_sigprocmask(SIG_SETMASK, ~[ILL TRAP BUS FPE KILL SEGV STOP], NULL, 8) = 0 gettid() = 30593 read(1017, "Y", 1) = 1 gettid() = 30593 write(1018, "Z", 1) = 1 rt_sigprocmask(SIG_SETMASK, [], ~[ILL TRAP BUS FPE KILL SEGV STOP], 8) = 0 read(155, "", 556) = 0 rt_sigprocmask(SIG_SETMASK, ~[ILL TRAP BUS FPE KILL SEGV STOP], NULL, 8) = 0 gettid() = 30593 read(1017, "Z", 1) = 1 gettid() = 30593 write(1018, "A", 1) = 1 rt_sigprocmask(SIG_SETMASK, [], ~[ILL TRAP BUS FPE KILL SEGV STOP], 8) = 0 read(179, "", 2830) = 0 rt_sigprocmask(SIG_SETMASK, ~[ILL TRAP BUS FPE KILL SEGV STOP], NULL, 8) = 0 gettid() = 30593 read(1017, "A", 1) = 1 gettid() = 30593 write(1018, "B", 1) = 1 rt_sigprocmask(SIG_SETMASK, [], ~[ILL TRAP BUS FPE KILL SEGV STOP], 8) = 0 read(163, "", 2950) = 0 rt_sigprocmask(SIG_SETMASK, ~[ILL TRAP BUS FPE KILL SEGV STOP], NULL, 8) = 0 gettid() = 30593 read(1017, "B", 1) = 1 gettid() = 30593 write(1018, "C", 1) = 1 rt_sigprocmask(SIG_SETMASK, [], ~[ILL TRAP BUS FPE KILL SEGV STOP], 8) = 0 read(162, "", 2952) = 0 rt_sigprocmask(SIG_SETMASK, ~[ILL TRAP BUS FPE KILL SEGV STOP], NULL, 8) = 0 gettid() = 30593 read(1017, "C", 1) = 1 gettid() = 30593 the file descriptors 1016, 1017 and 1018 belong to valgrind, and it looks like valgrind is very talkative to my app (or the other way around) with just a singe letter byte incrementing on each write()/read() to/from its pipe. What is that? How could that have happen, that it seems to be the reason, that my app is taking up to 100% CPU load? Thanks in advance, Christian Parpart. |
|
From: Julian S. <js...@ac...> - 2011-05-12 15:55:06
|
> write(1018, "C", 1) = 1 > rt_sigprocmask(SIG_SETMASK, [], ~[ILL TRAP BUS FPE KILL SEGV STOP], 8) = 0 > read(162, "", 2952) = 0 > rt_sigprocmask(SIG_SETMASK, ~[ILL TRAP BUS FPE KILL SEGV STOP], NULL, 8) = > 0 gettid() = 30593 > read(1017, "C", 1) = 1 > gettid() = 30593 > > the file descriptors 1016, 1017 and 1018 belong to valgrind, and it looks > like valgrind is very talkative to my app (or the other way around) with > just a singe letter byte incrementing on each write()/read() to/from its > pipe. > > What is that? How could that have happen, that it seems to be the reason, > that my app is taking up to 100% CPU load? That's normal. If those lines are being printed very fast, it means the virtual CPU is running fast. Why it is burning CPU, who knows, but I would understand this to mean that your server is requiring the virtual CPU to work hard. This is Valgrind talking to itself, not to your app. See coregrind/m_scheduler/sema.c To see the syscalls your app is doing, run with --trace-syscalls=yes. If you want to live dangerously :-), you can check out the valgrind svn trunk and use Philippe Waroquiers' new gdb server in Valgrind, so you can run your server on Valgrind and control it from GDB at the same time. J |