All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: Daniel Schnell <daniel.schnell@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Debugging in Xenomai
Date: Thu, 23 Nov 2006 16:57:20 +0100	[thread overview]
Message-ID: <4565C4E0.8000502@domain.hid> (raw)
In-Reply-To: <DD39B5C3F4963040ADC9768BE7E430CB015D5270@domain.hid>

[-- Attachment #1: Type: text/plain, Size: 3270 bytes --]

Daniel Schnell wrote:
> Hi,
>  
> our application deadlocks from time to time. 
>  
> To isolate which of the threads are deadlocked, I look into
> /proc/xenomai/stat. Here I can see if there are context switches
> happening or not. Further I can see which threads have which PID and
> which task state they are into. One of the task states that is not clear
> to me btw is the state "X" or "relaxed shadow". Anybody ?

Thread is pending in secondary mode on some Linux resource.

>  
> So after gathering that I have some basic idea which of the threads is
> having a deadlock and now the question is, how to continue ?
>  
> One of the next steps would be finding out which actual function back
> trace the suspicious thread has. So I execute gdb and try to attach to
> the appropriate process, which works. Problem: sending Ctrl-C doesn't
> work, independant of if gdb is executed via ssh or serial console. So I
> cannot stop the actual program beeing debugged, rendering the gdb
> approach useless. Also sending SIGINT to the GDB process doesn't work.
> It seems to be simply ignored. As I understand CTRL-C is effectively
> sending SIGINT and is sent to GDB itself and not to the underlying appl.

I would say there is a bug, either in gdb or in Xenomai. Does debugging
in general work on your box, i.e. without Xenomai? Does it fail with any
trivial Xenomai application? What version? On PPC? If there is a bug
/wrt Xenomai, it has to be fixed.

>  
> Of course I always can insert logger output strings. I even wrote a
> logger that doesn't force to switch the process into secondary mode. I
> just thought we might have something that gives a developer a more
> effective way of fastly finding out which task has which actual back
> trace.

Already tried strace? It may help to understand more if your thread
hangs in secondary mode.

Beyond that, we are all desperately waiting for LTTng... :)

>  
> Under VxWorks there is a very elegant way of debugging with the help of
> the userLib. Of course this is possible here because VxWorks makes no
> distinction between user and kernel space and the shell itself is
> running as a task having access to symbol tables etc. You can say "i"
> which gives a similar output as /proc/xenomai/stat but with much more
> informations like stack size, actual stack consumption, actual executed
> function pointer, etc. "b" gives you a global breakpoint for any
> function. One can get stack traces without the help of gdb via "tt",
> etc. etc.
>  
> In Xenomai I suppose the actual stack execution pointer, stack size,
> etc. of a task has to be available to the kernel as well, so
> principially it should be possible to provide more informations than
> what /proc/xenomai/stat or /proc/xenomai/sched provide. Those migrating
> from VxWorks (and many others probably as well) would certainly like
> that.
>  
> How do the Xenomai veterans debug their application in case of deadlocks
> / synchronization errors, crashes etc. ?

Log message instrumentation (we also have such a RT-safe mechanism),
meditating on the code (better: let someone else meditate that looks at
it from a different angle), gdb (at least on x86 we had no problems so far).

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

  reply	other threads:[~2006-11-23 15:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-23 15:25 [Xenomai-help] Debugging in Xenomai Daniel Schnell
2006-11-23 15:57 ` Jan Kiszka [this message]
2006-11-23 17:23 ` Philippe Gerum
2006-11-23 17:56 ` Gilles Chanteperdrix
2006-11-24  9:20 ` Peter Soetens
2006-11-24 10:41   ` Jan Kiszka
2006-11-24 11:09     ` Philippe Gerum
2006-11-24 12:10       ` Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4565C4E0.8000502@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=daniel.schnell@domain.hid \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.