From: "M. Koehrer" <mathias_koehrer@domain.hid>
To: jan.kiszka@domain.hid, dmitry.adamushko@domain.hid
Cc: xenomai@xenomai.org
Subject: Re: Re: [Xenomai-help] Xenomai Bug: rt_intr_create with NULL-name leads
Date: Wed, 10 Jan 2007 15:19:38 +0100 (CET) [thread overview]
Message-ID: <27256731.1168438778663.JavaMail.ngmail@domain.hid> (raw)
In-Reply-To: <45A4F18A.4040209@domain.hid>
Hi,
one more comment on this issue:
Regarding to the API documentation it is not required to use a static allocated
string for the name parameter
(API docu: "When non-NULL and non-empty, this string is copied to a safe place into the descriptor").
However, when I use a name variable that is created on the stack (using sprintf), I see
that the /proc/xenomai/registry/native/interrupts/xxx name is fine, however the name in
/proc/xenomai/irq is not valid.
I.e. I have to use a static name variable to pass to rt_inter_create() as the name pointer
seems to be used without a copy action in /proc/xenomai/irq.
Regards
Mathias
> > Hi,
> >
> > I suppose, one more thing was missed. intr_reg.patch is to address it.
> >
> > intr_swap.patch - to be safe with xnintr_t::name in all cases. In
> > particular, the reported crash should disappear without other
> > additional patches.
> >
> >
> >
> > ------------------------------------------------------------------------
> >
> > --- ./ksrc/skins/native/intr.c 2006-06-15 14:15:44.000000000 +0200
> > +++ ./ksrc/skins/native/intr-new.c 2007-01-10 14:45:26.320565000 +0100
> > @@ -223,6 +223,7 @@ static xnpnode_t __intr_pnode = {
> > *
> > * - Kernel module initialization/cleanup code
> > * - Kernel-based task
> > + * - User-space task
> > *
> > * Rescheduling: possible.
> > *
> > @@ -262,11 +263,21 @@ int rt_intr_create(RT_INTR *intr,
> > /* <!> Since xnregister_enter() may reschedule, only register
> > complete objects, so that the registry cannot return handles to
> > half-baked objects... */
> > + if (!err && name) {
> > + xnpnode_t *pnode = &__intr_pnode;
> >
> > - if (!err)
> > - err =
> > - xnregistry_enter(intr->name, intr, &intr->handle,
> > - &__intr_pnode);
> > + if (!*name) {
> > + /* Since this is an anonymous object (empty name on entry)
>
> Isn't a NULL name representing an anonymous object as well?
>
> > + * from user-space, it gets registered under an unique
> > + * internal name but is not exported through /proc. */
> > + xnobject_create_name(intr->name, sizeof(intr->name),
> > + (void *)intr);
> > + pnode = NULL;
> > + }
> > +
> > + err = xnregistry_enter(intr->name, intr, &intr->handle, pnode);
> > + }
> > +
> > #endif /* CONFIG_XENO_OPT_REGISTRY */
> >
> > if (err)
> >
> >
> > ------------------------------------------------------------------------
> >
> > --- ./ksrc/skins/native/intr-new.c 2007-01-10 14:45:26.320565000 +0100
> > +++ ./ksrc/skins/native/intr-new2.c 2007-01-10 14:46:08.319442000 +0100
> > @@ -242,8 +242,8 @@ int rt_intr_create(RT_INTR *intr,
> > if (xnpod_asynch_p())
> > return -EPERM;
> >
> > - xnintr_init(&intr->intr_base, name, irq, isr, iack, mode);
> > xnobject_copy_name(intr->name, name);
> > + xnintr_init(&intr->intr_base, intr->name, irq, isr, iack, mode);
>
> This will set xnintr_t::name to "" if name is NULL - intentionally?
>
> Jan
>
>
--
Mathias Koehrer
mathias_koehrer@domain.hid
Viel oder wenig? Schnell oder langsam? Unbegrenzt surfen + telefonieren
ohne Zeit- und Volumenbegrenzung? DAS TOP ANGEBOT JETZT bei Arcor: günstig
und schnell mit DSL - das All-Inclusive-Paket für clevere Doppel-Sparer,
nur 44,85 inkl. DSL- und ISDN-Grundgebühr!
http://www.arcor.de/rd/emf-dsl-2
next prev parent reply other threads:[~2007-01-10 14:19 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-10 11:59 [Xenomai-help] Xenomai Bug: rt_intr_create with NULL-name leads to Kernel oops in /proc/xenomai/irq M. Koehrer
2007-01-10 12:35 ` Jan Kiszka
2007-01-10 13:49 ` Dmitry Adamushko
2007-01-10 14:00 ` Jan Kiszka
2007-01-10 14:19 ` M. Koehrer [this message]
2007-01-10 14:35 ` Re: [Xenomai-help] Xenomai Bug: rt_intr_create with NULL-name leads Dmitry Adamushko
2007-01-10 14:21 ` [Xenomai-help] Xenomai Bug: rt_intr_create with NULL-name leads to Kernel oops in /proc/xenomai/irq Dmitry Adamushko
2007-01-10 14:29 ` Dmitry Adamushko
2007-01-10 14:35 ` Jan Kiszka
2007-01-10 14:55 ` Dmitry Adamushko
2007-01-10 15:13 ` Jan Kiszka
2007-01-10 15:58 ` Dmitry Adamushko
2007-01-10 15:59 ` Dmitry Adamushko
2007-01-10 16:32 ` M. Koehrer
2007-01-11 19:19 ` Philippe Gerum
2007-01-11 20:49 ` Jan Kiszka
2007-01-11 21:01 ` Philippe Gerum
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=27256731.1168438778663.JavaMail.ngmail@domain.hid \
--to=mathias_koehrer@domain.hid \
--cc=dmitry.adamushko@domain.hid \
--cc=jan.kiszka@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.