From: Jan Kiszka <jan.kiszka@domain.hid>
To: Rodrigo Rosenfeld Rosas <lbocseg@domain.hid>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] [PATCH] Fixs doxygen doc on rt_queue_read in ksrc/native/queue.c (for SVN version)
Date: Tue, 11 Apr 2006 16:01:23 +0200 [thread overview]
Message-ID: <443BB6B3.8060601@domain.hid> (raw)
In-Reply-To: <443BA12F.9020505@domain.hid>
[-- Attachment #1.1: Type: text/plain, Size: 1195 bytes --]
[a few interruptions later]
Jan Kiszka wrote:
> Rodrigo Rosenfeld Rosas wrote:
>> BTW, please, could someone confirm the rt_task_delete(NULL) bug in SVN?
>
> Half-confirmed, there is something fishy. I'm struggling with the
> debugger ATM, not sure yet who's wrong ;). It tells me rt_task_delete of
> the skin module is entered with task != NULL...
...which turns out to be fine, just appears redundant to me when
comparing __rt_task_delete and rt_task_delete for the task=NULL case.
Anyway, leaving a native task with rt_task_delete(NULL) raises SIGKILL
to the whole process instead of just the task (pthread). This lets your
program terminate unexpectedly - I would say: a bug. And this doesn't
happen with 2.1?
I guess the easiest way to solve this is to catch NULL in userspace and
call pthread_exit() in favour of the skin service (the POSIX skin uses
pthread_exit anyway), see attached patch. Someone just has to confirm
that there will be no problem hidden by this approach.
Jan
PS: What's the reason for "if (err == -ESRCH) return 0" in
src/skins/native/task.c, rt_task_delete? Why is that error generate in
the first place if it is zeroed out here?
[-- Attachment #1.2: task-delete-null.patch --]
[-- Type: text/plain, Size: 456 bytes --]
Index: src/skins/native/task.c
===================================================================
--- src/skins/native/task.c (revision 923)
+++ src/skins/native/task.c (working copy)
@@ -212,7 +212,10 @@ int rt_task_delete (RT_TASK *task)
{
int err;
- if (task && task->opaque2) {
+ if (!task)
+ pthread_exit(NULL);
+
+ if (task->opaque2) {
err = pthread_cancel((pthread_t)task->opaque2);
if (err)
return -err;
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
next prev parent reply other threads:[~2006-04-11 14:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200604101640.04255.lbocseg@domain.hid>
2006-04-11 12:29 ` [Xenomai-core] [PATCH] Fixs doxygen doc on rt_queue_read in ksrc/native/queue.c (for SVN version) Jan Kiszka
2006-04-11 12:54 ` Rodrigo Rosenfeld Rosas
2006-04-11 14:01 ` Jan Kiszka [this message]
2006-04-11 20:25 ` Philippe Gerum
2006-04-11 20:41 ` Philippe Gerum
2006-04-11 21:27 ` Jan Kiszka
2006-04-16 10:27 ` [Xenomai-core] rt_task_delete() behaviour 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=443BB6B3.8060601@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=lbocseg@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.