From: Philippe Gerum <philippe.gerum@domain.hid>
To: Jan Kiszka <jan.kiszka@domain.hid>
Cc: Thomas Wiedemann <Thomas.Wiedemann@domain.hid>, xenomai@xenomai.org
Subject: Re: [Xenomai-core] [BUG?] registry usage + module removal causes kernel oops (xenomai native)
Date: Fri, 12 Jan 2007 10:11:38 +0100 [thread overview]
Message-ID: <1168593099.31022.18.camel@domain.hid> (raw)
In-Reply-To: <45A6C97A.4090406@domain.hid>
On Fri, 2007-01-12 at 00:34 +0100, Jan Kiszka wrote:
> Jan Kiszka wrote:
> > Thomas Wiedemann wrote:
> >> Another bug appeared for objects registered at the registry. When
> >> using xeno-native and xeno-rtdm, the order of removal seems to be
> >> important. I appended a small code sample to register a mutex at
> >> the registry. After the program exits, the modules can not be unloaded
> >> in the order
> >> 1) xeno-native
> >> 2) xeno-rtdm,
> >> but the other way around works fine. Instead, rmmod ends up with a
> >> segmentation fault, dmesg output appended.
> >>
> >> I tested this on xenomai 2.3.0/linux 2.6.19 and 2.2.5-svn/linux2.6.17.14.
> >>
> >
> > Looks like it's related to the left-over mutex in the registry. Probably
> > the other order just papers the issue. $Someone should give your code a
> > try, maybe I can check later with a debugger.
>
> Yet another reason to address auto-cleanup soon: I thought to remember
> the native skin keeps track of resources in a global list and kills them
> on rmmod, but that's only true for a few.
>
> Instead stalled named resources are kept in the registry. On
> unregistration of the last skin xnregistry_cleanup() is called. It tries
> to kill the stalled entries from proc but their roots may have already
> been removed (here: the native skin's proc root).
>
> Philippe, this makes the sweep loop in xnregistry_cleanup rather fragile
> and of questionable use.
It has never been meant as something skins should rely on or "use".
Interfaces that do not cleanup their place before leaving are just ugly
examples of unleashed procrastination, and it happens that I wrote one
of them. The cleanup loop in the registry unload code is solely a best
effort that may, or may not work depending on the setup (i.e. modular vs
static), this is _not_ an exported or exportable "feature".
> I guess all skins have to handle this on their
> own, and we should just bark loudly here if something remained.
Yes. The registry has to maintain the basic information and likely
provide a simple mechanism over that which would allow the skins to
cleanup properly, but the skins would have to trigger this cleanup on
their own. I'm working on this.
--
Philippe.
prev parent reply other threads:[~2007-01-12 9:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-11 17:44 [Xenomai-core] [BUG?] registry usage + module removal causes kernel oops (xenomai native) Thomas Wiedemann
2007-01-11 18:05 ` Jan Kiszka
2007-01-11 23:34 ` Jan Kiszka
2007-01-12 9:11 ` Philippe Gerum [this message]
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=1168593099.31022.18.camel@domain.hid \
--to=philippe.gerum@domain.hid \
--cc=Thomas.Wiedemann@domain.hid \
--cc=jan.kiszka@domain.hid \
--cc=rpm@xenomai.org \
--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.