mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Markus Wichmann <>
Subject: Re: [musl] Difference in pthread behavior between glibc and musl
Date: Tue, 11 Jul 2023 21:42:54 +0200	[thread overview]
Message-ID: <ZK2wvkyAU5WR6QKa@voyager> (raw)
In-Reply-To: <>

Am Tue, Jul 11, 2023 at 07:19:50PM +0000 schrieb Appelmans, Madeleine:
> Hello,
> There seems to be a difference in pthread behavior when compiling with
> glibc and using the musl-gcc wrapper. The attached snippet of code
> creates a destructor attribute which deletes a pthread key. The code
> never actually creates the pthread key. This code segfaults when
> compiled using musl-gcc, and does not segfault when compiled with gcc.

Undefined behavior is undefined. And it is undefined behavior to be
calling pthread_key_delete() with a key that was not previously acquired
from pthread_key_create(). POSIX encourages - but does not require -
implementations to detect invalid keys and return an error then. And
musl doesn't.


  reply	other threads:[~2023-07-11 19:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-11 19:19 Appelmans, Madeleine
2023-07-11 19:42 ` Markus Wichmann [this message]
2023-07-12  2:48 ` Rich Felker
2023-07-13  1:00   ` Gabriel Ravier
2023-07-13  1:50     ` Rich Felker
2023-07-13  2:02       ` Gabriel Ravier
2023-07-13 16:27         ` Markus Wichmann
2023-07-13 18:49           ` Gabriel Ravier

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZK2wvkyAU5WR6QKa@voyager \ \ \

* 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.
Code repositories for project(s) associated with this public inbox

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).