All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Jan Kiszka <jan.kiszka@domain.hid>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] [Xenomai-git] common: do not let u_mode exceptional cases leak out of current.[ch]
Date: Tue, 09 Mar 2010 14:41:51 +0100	[thread overview]
Message-ID: <4B96501F.3000701@domain.hid> (raw)
In-Reply-To: <4B953986.3030107@domain.hid>

Gilles Chanteperdrix wrote:
> Gilles Chanteperdrix wrote:
>> Jan Kiszka wrote:
>>> So why this fallback? Does it simplify something else that I miss ATM?
>> After the TSD cleanup is run, the TSD are set to NULL. Actually, I
>> assumed that when doing this change. I need to check.
> 
> That is the way I implemented it in the kernel-space skin. But reading
> the spec again, I may have been overzealous:
> http://www.opengroup.org/onlinepubs/000095399/functions/pthread_key_create.html

>From the results of the following test case:

#include <stdio.h>
#include <pthread.h>

pthread_key_t key;
pthread_key_t other_key;

void dest(void *foo)
{
	if ((long)foo == 1) {
		printf("other tsd, self == 0x%016lx, first pass: %p\n",
		       pthread_self(), pthread_getspecific(other_key));
		pthread_setspecific(key, (void *)2L);
	} else
		printf("other tsd, self == 0x%016lx, second pass: %p\n",
		       pthread_self(), pthread_getspecific(other_key));
}

void *thread(void *cookie)
{
	pthread_setspecific(key, (void *)1L);
	pthread_setspecific(other_key, (void *)1L);
	return cookie;
}

int main(void)
{
	pthread_t tid;

	pthread_key_create(&key, dest);
	pthread_key_create(&other_key, NULL);

	pthread_create(&tid, NULL, thread, NULL);
	pthread_join(tid, NULL);
	
	return 0;
}

It appears that the glibc I run here is implemented the same way as I
implemented it in xenomai kernel-space posix skin.

So, we still have this issue.

-- 
					    Gilles.


  reply	other threads:[~2010-03-09 13:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.4538.1268063562.8399.xenomai-git@xenomai.org>
2010-03-08 16:38 ` [Xenomai-core] [Xenomai-git] common: do not let u_mode exceptional cases leak out of current.[ch] Jan Kiszka
2010-03-08 17:00   ` Gilles Chanteperdrix
2010-03-08 17:08     ` Jan Kiszka
2010-03-08 17:14       ` Jan Kiszka
2010-03-08 17:17         ` Gilles Chanteperdrix
2010-03-08 17:53           ` Gilles Chanteperdrix
2010-03-09 13:41             ` Gilles Chanteperdrix [this message]
2010-03-09 14:20         ` Gilles Chanteperdrix
2010-03-09 14:49           ` Jan Kiszka
2010-03-09 15:16             ` Gilles Chanteperdrix
2010-03-08 16:50 ` [Xenomai-core] [Xenomai-git] common: modify leak warning Jan Kiszka
2010-03-08 17:01   ` 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=4B96501F.3000701@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --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.