From: Philippe Gerum <rpm@xenomai.org>
To: Stephan Zimmermann <s.zimmermann@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Kernel crash during queue create/destroy
Date: Thu, 16 Nov 2006 14:26:52 +0100 [thread overview]
Message-ID: <1163683612.4962.66.camel@domain.hid> (raw)
In-Reply-To: <200611161359.23875.s.zimmermann@domain.hid>
On Thu, 2006-11-16 at 13:59 +0100, Stephan Zimmermann wrote:
> Am Donnerstag, 16. November 2006 12:57 schrieb Philippe Gerum:
> > On Wed, 2006-11-15 at 15:44 +0100, Stephan Zimmermann wrote:
> > > Am Mittwoch, 15. November 2006 14:19 schrieb Dmitry Adamushko:
> > > > Hello,
> > > >
> > > > I got some trouble with the native skin and queues, when creating /
> > > > deleting
> > > >
> > > > > queues, my Kernel sometimes (actually very often...) crashes, leading
> > > > > to a frozen system, with my Xenomai program continuing until it
> > > > > returns. I tried
> > > > > to isolate / reproduce the problem, which lead me to the following
> > > > > demo-code.
> >
> > [...]
> >
> > Cannot test it yet, but could you try out this patch? TIA,
>
> This is the moment I have to confess I'm somehow not familiar enough with
> patch command....
>
> I did download an fresh 1838 revision fron svn using "svn co -r 1838
> svn://svn.gna.org/svn/xenomai/trunk xenomai", saved your patch to a file and
> tried to apply it from within the xenomai directory like this "patch -p0 <
> filename" (worked somehow last time), which leads me to the following output:
> <patch putput>
> patching file ksrc/nucleus/registry.c
> Hunk #1 FAILED at 65.
> Hunk #2 FAILED at 104.
> Hunk #3 FAILED at 271.
> Hunk #4 FAILED at 335.
> Hunk #5 FAILED at 394.
> patch unexpectedly ends in middle of line
> Hunk #6 FAILED at 402.
> 6 out of 6 hunks FAILED -- saving rejects to file ksrc/nucleus/registry.c.rej
> </patch output>
>
> sorry, don't know how to fix that...
>
The paste© you did from the mail to get the patch code likely
failed, adding spurious linebreaks and such. Try asking your mail client
to write the mail to a file, remove the useless text, then apply the
patch from this file. patch -p0, as you did, is correct.
> > --- ksrc/nucleus/registry.c (revision 1838)
> > +++ ksrc/nucleus/registry.c (working copy)
> > @@ -65,10 +65,8 @@
> >
> > static void registry_proc_schedule(void *cookie);
> >
> > -static xnqueue_t registry_obj_exportq; /* Objects waiting for /proc
> > export. */ +static xnqueue_t registry_obj_procq; /* Objects waiting for
> > /proc handling. */
> >
> > -static xnqueue_t registry_obj_unexportq; /* Objects waiting for /proc
> > unexport. */ -
> > #ifndef CONFIG_PREEMPT_RT
> > static DECLARE_WORK(registry_proc_work, ®istry_proc_callback, NULL);
> > #endif /* !CONFIG_PREEMPT_RT */
> > @@ -106,8 +104,7 @@
> > return -ENOMEM;
> > }
> >
> > - initq(®istry_obj_exportq);
> > - initq(®istry_obj_unexportq);
> > + initq(®istry_obj_procq);
> > #endif /* CONFIG_XENO_EXPORT_REGISTRY */
> >
> > initq(®istry_obj_freeq);
> > @@ -274,16 +271,20 @@
> >
> > xnlock_get_irqsave(&nklock, s);
> >
> > - while ((holder = getq(®istry_obj_exportq)) != NULL) {
> > + while ((holder = getq(®istry_obj_procq)) != NULL) {
> > object = link2xnobj(holder);
> > pnode = object->pnode;
> > type = pnode->type;
> > + dir = pnode->dir;
> > + rdir = pnode->root->dir;
> > root = pnode->root->name;
> > +
> > + if (object->proc != XNOBJECT_PROC_RESERVED1)
> > + goto unexport;
> > +
> > ++pnode->entries;
> > object->proc = XNOBJECT_PROC_RESERVED2;
> > appendq(®istry_obj_busyq, holder);
> > - dir = pnode->dir;
> > - rdir = pnode->root->dir;
> >
> > xnlock_put_irqrestore(&nklock, s);
> >
> > @@ -334,19 +335,14 @@
> > object->pnode = NULL;
> > --pnode->entries;
> > }
> > - }
> >
> > - while ((holder = getq(®istry_obj_unexportq)) != NULL) {
> > - object = link2xnobj(holder);
> > - pnode = object->pnode;
> > - object->pnode = NULL;
> > + continue;
> > +
> > + unexport:
> > + entries = --pnode->entries;
> > entry = object->proc;
> > object->proc = NULL;
> > - type = pnode->type;
> > - dir = pnode->dir;
> > - rdir = pnode->root->dir;
> > - root = pnode->root->name;
> > - entries = --pnode->entries;
> > + object->pnode = NULL;
> >
> > if (entries <= 0) {
> > pnode->dir = NULL;
> > @@ -398,7 +394,7 @@
> > object->proc = XNOBJECT_PROC_RESERVED1;
> > object->pnode = pnode;
> > removeq(®istry_obj_busyq, &object->link);
> > - appendq(®istry_obj_exportq, &object->link);
> > + appendq(®istry_obj_procq, &object->link);
> > rthal_apc_schedule(registry_proc_apc);
> > }
> >
> > @@ -406,13 +402,13 @@
> > {
> > if (object->proc != XNOBJECT_PROC_RESERVED1) {
> > removeq(®istry_obj_busyq, &object->link);
> > - appendq(®istry_obj_unexportq, &object->link);
> > + appendq(®istry_obj_procq, &object->link);
> > rthal_apc_schedule(registry_proc_apc);
> > } else {
> > /* Unexporting before the lower stage has had a chance to
> > export. Move back the object to the busyq just like if no
> > export had been requested. */
> > - removeq(®istry_obj_exportq, &object->link);
> > + removeq(®istry_obj_procq, &object->link);
> > appendq(®istry_obj_busyq, &object->link);
> > object->pnode = NULL;
> > object->proc = NULL;
>
> _______________________________________________
> Xenomai-help mailing list
> Xenomai-help@domain.hid
> https://mail.gna.org/listinfo/xenomai-help
--
Philippe.
next prev parent reply other threads:[~2006-11-16 13:26 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-15 10:21 [Xenomai-help] Kernel crash during queue create/destroy Stephan Zimmermann
2006-11-15 13:19 ` Dmitry Adamushko
2006-11-15 14:44 ` Stephan Zimmermann
2006-11-15 21:01 ` Jan Kiszka
2006-11-15 22:22 ` Philippe Gerum
2006-11-15 22:36 ` Jan Kiszka
2006-11-15 22:43 ` Jan Kiszka
2006-11-15 22:46 ` Philippe Gerum
2006-11-15 22:52 ` Jan Kiszka
2006-11-15 22:44 ` Philippe Gerum
2006-11-16 11:57 ` Philippe Gerum
2006-11-16 12:59 ` Stephan Zimmermann
2006-11-16 13:26 ` Philippe Gerum [this message]
2006-11-16 15:35 ` Stephan Zimmermann
2006-11-16 15:44 ` Jan Kiszka
2006-11-17 12:38 ` Stephan Zimmermann
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=1163683612.4962.66.camel@domain.hid \
--to=rpm@xenomai.org \
--cc=s.zimmermann@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.