linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: Andreas Schwab <schwab@suse.de>,
	Michael Kerrisk <mtk.manpages@gmail.com>
Cc: David Miller <davem@davemloft.net>,
	libc-alpha@sourceware.org,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	linux-man@vger.kernel.org
Subject: Re: Race and segmentation fault in pthread_kill() vs thread teardown
Date: Wed, 2 Oct 2013 12:04:40 +0000 (UTC)	[thread overview]
Message-ID: <1497173819.27140.1380715480773.JavaMail.zimbra@efficios.com> (raw)
In-Reply-To: <mvm8uyc2itw.fsf@hawking.suse.de>

----- Original Message -----
> From: "Andreas Schwab" <schwab@suse.de>
> To: "Mathieu Desnoyers" <mathieu.desnoyers@efficios.com>
> Cc: "David Miller" <davem@davemloft.net>, libc-alpha@sourceware.org, "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> Sent: Wednesday, October 2, 2013 4:11:23 AM
> Subject: Re: Race and segmentation fault in pthread_kill() vs thread teardown
> 
> The POSIX spec is pretty clear:
> 
>  If an application attempts to use a thread ID whose lifetime has ended,
>  the behavior is undefined.
> 
> I'd suggest to file a bug report with the Austin group wrt to the
> wording in pthread_kill.

CCing man pages maintainers,

Interestingly enough, the specification has been updated:

http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_kill.html

to remove the ESRCH return value in

Issue 7
  Austin Group Interpretation 1003.1-2001 #142 is applied, removing the [ESRCH] error condition.

It looks like a discrepancy between the spec and the man page that causes this confusion. We might want to update pthread_kill(3), keeping ESRCH documented, but clearly marked as deprecated, and clarify that calling pthread_kill() on a non-existing thread is undefined.

We should probably remove this part entirely:

"      but error checking is still per‐
       formed; this can be used to check for the existence of a thread ID."

Thoughts ?

Thanks,

Mathieu




> 
> Andreas.
> 
> --
> Andreas Schwab, SUSE Labs, schwab@suse.de
> GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
> "And now for something completely different."
> 

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

       reply	other threads:[~2013-10-02 12:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <305581948.26980.1380684877897.JavaMail.zimbra@efficios.com>
     [not found] ` <675415986.27031.1380686764309.JavaMail.zimbra@efficios.com>
     [not found]   ` <mvm8uyc2itw.fsf@hawking.suse.de>
2013-10-02 12:04     ` Mathieu Desnoyers [this message]
2013-10-02 18:05       ` Race and segmentation fault in pthread_kill() vs thread teardown Roland McGrath
2013-12-28 13:11       ` Michael Kerrisk (man-pages)

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=1497173819.27140.1380715480773.JavaMail.zimbra@efficios.com \
    --to=mathieu.desnoyers@efficios.com \
    --cc=davem@davemloft.net \
    --cc=libc-alpha@sourceware.org \
    --cc=linux-man@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=schwab@suse.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).