* [Xenomai-core] Oops when exiting Xenomai POSIX application @ 2009-01-01 8:38 Wolfgang Grandegger 2009-01-01 12:16 ` Gilles Chanteperdrix 2009-01-01 14:11 ` Gilles Chanteperdrix 0 siblings, 2 replies; 4+ messages in thread From: Wolfgang Grandegger @ 2009-01-01 8:38 UTC (permalink / raw) To: xenomai-help 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? Thanks, Wolfgang. ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Xenomai-core] Oops when exiting Xenomai POSIX application 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 1 sibling, 0 replies; 4+ messages in thread From: Gilles Chanteperdrix @ 2009-01-01 12:16 UTC (permalink / raw) To: Wolfgang Grandegger; +Cc: xenomai-help 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? One possible explanation could be that thread_destroy is called twice, could you check if this is what happens ? -- Gilles. ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Xenomai-core] Oops when exiting Xenomai POSIX application 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 2009-01-01 14:26 ` Wolfgang Grandegger 1 sibling, 1 reply; 4+ messages in thread From: Gilles Chanteperdrix @ 2009-01-01 14:11 UTC (permalink / raw) To: Wolfgang Grandegger; +Cc: xenomai-help 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. ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Xenomai-core] Oops when exiting Xenomai POSIX application 2009-01-01 14:11 ` Gilles Chanteperdrix @ 2009-01-01 14:26 ` Wolfgang Grandegger 0 siblings, 0 replies; 4+ messages in thread From: Wolfgang Grandegger @ 2009-01-01 14:26 UTC (permalink / raw) To: Gilles Chanteperdrix; +Cc: xenomai-help Gilles Chanteperdrix wrote: > 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); With this patch, I do not get an Oops any more :-). Wolfgang. ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-01-01 14:26 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 2009-01-01 14:26 ` Wolfgang Grandegger
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.