All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Wolfgang Grandegger <wg@domain.hid>
Cc: xenomai-help <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] Oops when exiting Xenomai POSIX application
Date: Thu, 01 Jan 2009 15:11:56 +0100	[thread overview]
Message-ID: <495CCF2C.40008@domain.hid> (raw)
In-Reply-To: <495C80FB.7050501@domain.hid>

Wolfgang Grandegger wrote:
> Hello,
> 
> first a Happy New Year to everybody.
> 
> With the POSIX skin of Xenomai trunk I get the following Oops when I
> exit my application (with ^C) on my PowerPC :
> 
>  Xenomai: fatal: removing non-linked element, holder=c78e69c8, qslot=c7b03030 at kernel/xenomai/skins/posix/thread.c:52
> [ 4081.676346]  CPU  PID    PRI      TIMEOUT  STAT      NAME
> [ 4081.676356] >  0  0       -1      0        00500080  ROOT
> [ 4081.676366]    0  1128    37      0        00300380  UT1
> [ 4081.676376] Master time base: clock=137696806566
> [ 4081.676385] 
> [ 4081.722024] Call Trace:
> [ 4081.724515] [c7b19d40] [c0008088] show_stack+0x4c/0x1ac (unreliable)
> [ 4081.731030] [c7b19d80] [c0085670] thread_destroy+0x230/0x23c
> [ 4081.736823] [c7b19da0] [c0085c28] thread_delete_hook+0xf4/0xf8
> [ 4081.742781] [c7b19dc0] [c0053b74] xnpod_fire_callouts+0x48/0x94
> [ 4081.748845] [c7b19de0] [c005fa64] xnsched_zombie_hooks+0x5c/0xcc
> [ 4081.754982] [c7b19df0] [c005fb50] xnsched_finish_unlocked_switch+0x7c/0x9c
> [ 4081.762003] [c7b19e00] [c0054ad4] __xnpod_schedule+0x1f8/0x6e4
> [ 4081.767962] [c7b19e50] [c0055c34] xnpod_suspend_thread+0x3c0/0x54c
> [ 4081.774275] [c7b19e90] [c0064810] xnshadow_relax+0x90/0x23c
> [ 4081.779972] [c7b19eb0] [c00651c0] hisyscall_event+0x2a4/0x2cc
> [ 4081.785841] [c7b19ee0] [c004d850] __ipipe_dispatch_event+0xac/0x224
> [ 4081.792243] [c7b19f30] [c0009560] __ipipe_syscall_root+0x40/0xf0
> [ 4081.798383] [c7b19f40] [c0011118] DoSyscall+0x20/0x5c
> [ 4081.803556] --- Exception: c01 at 0xffaa1b0
> [ 4081.807823]     LR = 0xffaa18c
> 
> 
> Does that trigger a bell?

Wait, yes, this is bad, I think we should not execute
xnsched_finish_unlocked_switch at this point. Try this. This is a
temporary patch, we probably have to work out something better for SMP,
but it should at least show us if this is the reason for the problem you
have.

Index: ksrc/nucleus/pod.c
===================================================================
--- ksrc/nucleus/pod.c	(revision 4519)
+++ ksrc/nucleus/pod.c	(working copy)
@@ -2085,18 +2085,8 @@ void __xnpod_schedule(struct xnsched *sc

 	xnpod_switch_to(sched, prev, next);

-	switched = 1;
-	sched = xnsched_finish_unlocked_switch(sched);
-	/*
-	 * Re-read the currently running thread, this is needed
-	 * because of relaxed/hardened transitions.
-	 */
 	curr = sched->curr;

-	xnarch_trace_pid(xnthread_user_task(curr) ?
-			 xnarch_user_pid(xnthread_archtcb(curr)) : -1,
-			 xnthread_current_priority(curr));
-
 #ifdef CONFIG_XENO_OPT_PERVASIVE
 	/*
 	 * Test whether we are relaxing a thread. In such a case, we
@@ -2107,6 +2097,16 @@ void __xnpod_schedule(struct xnsched *sc
 		goto relax_epilogue;
 #endif /* CONFIG_XENO_OPT_PERVASIVE */

+	switched = 1;
+	sched = xnsched_finish_unlocked_switch(sched);
+	/*
+	 * Re-read the currently running thread, this is needed
+	 * because of relaxed/hardened transitions.
+	 */
+	xnarch_trace_pid(xnthread_user_task(curr) ?
+			 xnarch_user_pid(xnthread_archtcb(curr)) : -1,
+			 xnthread_current_priority(curr));
+
 	if (zombie)
 		xnpod_fatal("zombie thread %s (%p) would not die...",
 			    prev->name, prev);


-- 
					    Gilles.


  parent reply	other threads:[~2009-01-01 14:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-01  8:38 [Xenomai-core] Oops when exiting Xenomai POSIX application Wolfgang Grandegger
2009-01-01 12:16 ` Gilles Chanteperdrix
2009-01-01 14:11 ` Gilles Chanteperdrix [this message]
2009-01-01 14:26   ` Wolfgang Grandegger

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=495CCF2C.40008@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=wg@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.