From: Bo Yang on
Hi,
One of my process changes to state 'D' which means uninterrupt
sleep. I want to check out in which system call this process stay.
But I can't strace it because the strace program will be 'D' too. And
I can't use gdb to attach it, because an uninterrupt sleeping process
can't deal with any signal. How can check out the system call my
process sleep in?
I am using Linux system, thanks!
Regards!
Bo
From: Pascal J. Bourguignon on
Bo Yang <struggleyb(a)gmail.com> writes:

> Hi,
> One of my process changes to state 'D' which means uninterrupt
> sleep. I want to check out in which system call this process stay.
> But I can't strace it because the strace program will be 'D' too. And
> I can't use gdb to attach it, because an uninterrupt sleeping process
> can't deal with any signal. How can check out the system call my
> process sleep in?
> I am using Linux system, thanks!

Launch again the process with strace.

Otherwise, the WCHAN may give a hint, but it's probable that several
syscalls will lead to the same address here.


--
__Pascal Bourguignon__
From: Alan Curry on
In article <87bpii3ix5.fsf(a)galatea.local>,
Pascal J. Bourguignon <pjb(a)informatimago.com> wrote:
>Bo Yang <struggleyb(a)gmail.com> writes:
>
>> Hi,
>> One of my process changes to state 'D' which means uninterrupt
>> sleep. I want to check out in which system call this process stay.
>> But I can't strace it because the strace program will be 'D' too. And
>> I can't use gdb to attach it, because an uninterrupt sleeping process
>> can't deal with any signal. How can check out the system call my
>> process sleep in?
>> I am using Linux system, thanks!
>
>Launch again the process with strace.
>
>Otherwise, the WCHAN may give a hint, but it's probable that several
>syscalls will lead to the same address here.

SysRq+T or Ctrl+ScrollLock on the console shows a full kernel backtrace for
each process, more informative than just WCHAN.

--
Alan Curry
From: Bo Yang on
On 12ÔÂ2ÈÕ, ÉÏÎç6ʱ01·Ö, pac...(a)kosh.dhis.org (Alan Curry) wrote:
> In article <87bpii3ix5....(a)galatea.local>,
> Pascal J. Bourguignon <p...(a)informatimago.com> wrote:
>
> >Bo Yang <struggl...(a)gmail.com> writes:
>
> >> Hi,
> >> One of my process changes to state 'D' which means uninterrupt
> >> sleep. I want to check out in which system call this process stay.
> >> But I can't strace it because the strace program will be 'D' too. And
> >> I can't use gdb to attach it, because an uninterrupt sleeping process
> >> can't deal with any signal. How can check out the system call my
> >> process sleep in?
> >> I am using Linux system, thanks!
>
> >Launch again the process with strace.
>
> >Otherwise, the WCHAN may give a hint, but it's probable that several
> >syscalls will lead to the same address here.
>
> SysRq+T or Ctrl+ScrollLock on the console shows a full kernel backtrace for
> each process, more informative than just WCHAN.

Yeah, SysRq is really what I need, thanks a lot!
But I find that I can't use SysRq in SSH... Should SysRq can only be
used in a real console?

Regards!
Bo
From: Bo Yang on
On 12ÔÂ2ÈÕ, ÉÏÎç6ʱ01·Ö, pac...(a)kosh.dhis.org (Alan Curry) wrote:
> In article <87bpii3ix5....(a)galatea.local>,
> Pascal J. Bourguignon <p...(a)informatimago.com> wrote:
>
> >Bo Yang <struggl...(a)gmail.com> writes:
>
> >> Hi,
> >> One of my process changes to state 'D' which means uninterrupt
> >> sleep. I want to check out in which system call this process stay.
> >> But I can't strace it because the strace program will be 'D' too. And
> >> I can't use gdb to attach it, because an uninterrupt sleeping process
> >> can't deal with any signal. How can check out the system call my
> >> process sleep in?
> >> I am using Linux system, thanks!
>
> >Launch again the process with strace.
>
> >Otherwise, the WCHAN may give a hint, but it's probable that several
> >syscalls will lead to the same address here.
>
> SysRq+T or Ctrl+ScrollLock on the console shows a full kernel backtrace for
> each process, more informative than just WCHAN.

And for another question, can I generate a core dump for a uninterrupt
sleep process since it accept no signal at all?

Regards!
Bo