From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Philippe Gerum <rpm@xenomai.org>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-core] xenomai 2.5.3/native, kernel 2.6.31.8 and fork()
Date: Mon, 23 Aug 2010 01:34:54 +0200 [thread overview]
Message-ID: <4C71B41E.6020006@domain.hid> (raw)
In-Reply-To: <1282490032.1961.31.camel@domain.hid>
Philippe Gerum wrote:
> On Sat, 2010-08-21 at 19:36 +0200, Gilles Chanteperdrix wrote:
>> Gilles Chanteperdrix wrote:
>>> There are other issues to consider, such as detecting that a private
>>> mutex created in the father continues to be used in the child.
>> A simple fix for this would be to keep a list of mutexes in the native
>> and posix skin, and nullify their magic/opaque pointer at fork. The
>> problem is that there is no more room in pthread_mutex_t, so we will
>> have to malloc at pthread_mutex_init time.
>>
>
> Please simply issue a warning as you suggested once when a potentially
> dangerous situation arises upon fork regarding mutexes. Piling up
> non-trivial code to prevent an obviously broken application from
> misbehaving even more is way too expensive if such code could introduce
> more overhead, and potentially secondary mode switches.
>
> IIUC, we are discussing about apps using in a child context some private
> mutexes which were initially created in the parent context, right? If
> so, then a warning upon detection should suffice to have the author go
> back to the drawing board, and optionally run "man pthread_mutex_init"
> as well.
Ok. Detection is not that easy with fastsyncs, so here what I set up to do:
- for mutexes going through the syscall path, return EPERM (the
documented error for that case), and print a message inn the console.
- for mutexes going through fastsync, cause a segmentation fault to kill
the application by setting up an inaccessible mapping where the private
heap was, this is better than potential silent memory corruption (the
current situation). But needs be documented.
--
Gilles.
next prev parent reply other threads:[~2010-08-22 23:34 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-17 12:25 [Xenomai-core] xenomai 2.5.3/native, kernel 2.6.31.8 and fork() Krzysztof Błaszkowski
2010-08-17 12:33 ` Gilles Chanteperdrix
2010-08-17 12:34 ` Krzysztof Błaszkowski
2010-08-17 12:40 ` Gilles Chanteperdrix
2010-08-17 12:54 ` Krzysztof Błaszkowski
2010-08-17 13:06 ` Gilles Chanteperdrix
2010-08-17 13:19 ` Krzysztof Błaszkowski
2010-08-17 13:27 ` Gilles Chanteperdrix
2010-08-17 13:57 ` Krzysztof Błaszkowski
2010-08-17 14:08 ` Gilles Chanteperdrix
2010-08-17 14:12 ` Krzysztof Błaszkowski
2010-08-17 14:17 ` Gilles Chanteperdrix
2010-08-17 16:07 ` Krzysztof Błaszkowski
2010-08-17 12:35 ` Krzysztof Błaszkowski
2010-08-17 12:40 ` Gilles Chanteperdrix
2010-08-17 14:41 ` Philippe Gerum
2010-08-17 16:09 ` Krzysztof Błaszkowski
2010-08-17 22:59 ` Gilles Chanteperdrix
2010-08-18 10:22 ` Krzysztof Błaszkowski
2010-08-18 11:00 ` Gilles Chanteperdrix
2010-08-18 11:40 ` Krzysztof Błaszkowski
2010-08-18 12:00 ` Gilles Chanteperdrix
2010-08-18 12:17 ` Krzysztof Błaszkowski
2010-08-18 12:37 ` Gilles Chanteperdrix
2010-08-18 12:55 ` Krzysztof Błaszkowski
2010-08-18 13:39 ` Gilles Chanteperdrix
2010-08-18 14:04 ` Krzysztof Błaszkowski
2010-08-18 14:10 ` Gilles Chanteperdrix
2010-08-18 14:25 ` Krzysztof Błaszkowski
2010-08-18 14:30 ` Gilles Chanteperdrix
2010-08-18 15:09 ` Krzysztof Błaszkowski
2010-08-18 15:13 ` Gilles Chanteperdrix
2010-08-18 15:16 ` Krzysztof Błaszkowski
2010-08-18 15:43 ` Gilles Chanteperdrix
2010-08-18 16:30 ` Krzysztof Błaszkowski
2010-08-18 16:51 ` Krzysztof Błaszkowski
2010-08-18 17:17 ` Krzysztof Błaszkowski
2010-08-20 9:47 ` Krzysztof Błaszkowski
2010-08-20 9:54 ` Gilles Chanteperdrix
2010-08-20 15:50 ` Krzysztof Błaszkowski
2010-08-21 17:06 ` Gilles Chanteperdrix
2010-08-21 17:36 ` Gilles Chanteperdrix
2010-08-22 15:13 ` Philippe Gerum
2010-08-22 23:34 ` Gilles Chanteperdrix [this message]
2010-08-18 15:13 ` Krzysztof Błaszkowski
2010-08-18 11:05 ` Gilles Chanteperdrix
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=4C71B41E.6020006@domain.hid \
--to=gilles.chanteperdrix@xenomai.org \
--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.