Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 11 Jul 2023 21:42:54 +0200
From: Markus Wichmann <nullplan@....net>
To: musl@...ts.openwall.com
Subject: Re: Difference in pthread behavior between glibc and musl

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.

Ciao,
Markus

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.