musl - an implementation of the standard library for Linux-based systems
Go to file
Rich Felker 84d061d5a3 fix deletion of pthread tsd keys that still have non-null values stored
per POSIX, deletion of a key for which some threads still have values
stored is permitted, and newly created keys must initially hold the
null value in all threads. these properties were not met by our
implementation; if a key was deleted with values left and a new key
was created in the same slot, the old values were still visible.

moreover, due to lack of any synchronization in pthread_key_delete,
there was a TOCTOU race whereby a concurrent pthread_exit could
attempt to call a null destructor pointer for the newly orphaned
value.

this commit introduces a solution based on __synccall, stopping the
world to zero out the values for deleted keys, but only does so lazily
when all key slots have been exhausted. pthread_key_delete is split
off into a separate translation unit so that static-linked programs
which only create keys but never delete them will not pull in the
__synccall machinery.

a global rwlock is added to synchronize creation and deletion of keys
with dtor execution. since the dtor execution loop now has to release
and retake the lock around its call to each dtor, checks are made not
to call the nodtor dummy function for keys which lack a dtor.
2018-09-18 11:44:27 -04:00
arch fix broken atomic store on powerpc[64] 2018-09-14 10:47:16 -04:00
crt define and use internal macros for hidden visibility, weak refs 2018-09-05 14:05:14 -04:00
dist add another example option to dist/config.mak 2012-04-24 16:49:11 -04:00
include define MAX_HANDLE_SZ for use with name_to_handle_at 2018-09-13 11:46:46 -04:00
ldso overhaul internally-public declarations using wrapper headers 2018-09-12 14:34:33 -04:00
src fix deletion of pthread tsd keys that still have non-null values stored 2018-09-18 11:44:27 -04:00
tools fix musl-gcc wrapper to be compatible with default-pie gcc toolchains 2018-08-02 19:15:48 -04:00
.gitignore remove obsolete gitignore rules 2016-07-06 00:21:25 -04:00
configure configure: only try -Qunused-arguments for clang 2018-09-12 22:43:38 -04:00
COPYRIGHT update authors/contributors list 2018-02-21 14:19:01 -05:00
dynamic.list allow interposition/replacement of allocator (malloc) 2018-04-18 14:22:49 -04:00
INSTALL add powerpc64 and s390x to list of supported archs in INSTALL file 2017-08-29 20:48:02 -04:00
Makefile overhaul internally-public declarations using wrapper headers 2018-09-12 14:34:33 -04:00
README update version reference in the README file 2014-06-25 14:16:53 -04:00
VERSION release 1.1.20 2018-09-04 13:17:19 -04:00
WHATSNEW fix mistake/cruft in 1.1.20 release notes 2018-09-04 19:27:15 -04:00

    musl libc

musl, pronounced like the word "mussel", is an MIT-licensed
implementation of the standard C library targetting the Linux syscall
API, suitable for use in a wide range of deployment environments. musl
offers efficient static and dynamic linking support, lightweight code
and low runtime overhead, strong fail-safe guarantees under correct
usage, and correctness in the sense of standards conformance and
safety. musl is built on the principle that these goals are best
achieved through simple code that is easy to understand and maintain.

The 1.1 release series for musl features coverage for all interfaces
defined in ISO C99 and POSIX 2008 base, along with a number of
non-standardized interfaces for compatibility with Linux, BSD, and
glibc functionality.

For basic installation instructions, see the included INSTALL file.
Information on full musl-targeted compiler toolchains, system
bootstrapping, and Linux distributions built on musl can be found on
the project website:

    http://www.musl-libc.org/