musl - an implementation of the standard library for Linux-based systems
Go to file
Rich Felker b470030f83 overhaul cancellation to fix resource leaks and dangerous behavior with signals
this commit addresses two issues:

1. a race condition, whereby a cancellation request occurring after a
syscall returned from kernelspace but before the subsequent
CANCELPT_END would cause cancellable resource-allocating syscalls
(like open) to leak resources.

2. signal handlers invoked while the thread was blocked at a
cancellation point behaved as if asynchronous cancellation mode wer in
effect, resulting in potentially dangerous state corruption if a
cancellation request occurs.

the glibc/nptl implementation of threads shares both of these issues.

with this commit, both are fixed. however, cancellation points
encountered in a signal handler will not be acted upon if the signal
was received while the thread was already at a cancellation point.
they will of course be acted upon after the signal handler returns, so
in real-world usage where signal handlers quickly return, it should
not be a problem. it's possible to solve this problem too by having
sigaction() wrap all signal handlers with a function that uses a
pthread_cleanup handler to catch cancellation, patch up the saved
context, and return into the cancellable function that will catch and
act upon the cancellation. however that would be a lot of complexity
for minimal if any benefit...
2011-03-24 14:18:00 -04:00
arch overhaul cancellation to fix resource leaks and dangerous behavior with signals 2011-03-24 14:18:00 -04:00
crt cleanup comment cruft in startup code 2011-02-21 22:27:35 -05:00
dist document in config.mak sample that x86_64 is supported 2011-02-17 18:30:41 -05:00
include syscall overhaul part two - unify public and internal syscall interface 2011-03-19 21:36:10 -04:00
lib new solution for empty lib dir (old one had some problems) 2011-02-17 17:12:52 -05:00
src overhaul cancellation to fix resource leaks and dangerous behavior with signals 2011-03-24 14:18:00 -04:00
tools use -L/...../ -lgcc instead of /...../libgcc.a in musl-gcc wrapper 2011-03-01 12:04:36 -05:00
COPYING initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00
COPYRIGHT some docs fixes for x86_64 2011-02-15 14:52:11 -05:00
INSTALL some docs fixes for x86_64 2011-02-15 14:52:11 -05:00
Makefile various changes in preparation for dynamic linking support 2011-02-24 16:37:21 -05:00
README initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00
WHATSNEW document changes for 0.7.1 2011-03-18 09:59:20 -04:00

musl libc - a new standard library to power a new generation of
Linux-based devices. musl is lightweight, fast, simple, free, and
strives to be correct in the sense of standards-conformance and
safety.

musl is an alternative to glibc, eglibc, uClibc, dietlibc, and klibc.
For reasons why one might prefer musl, please see the FAQ and libc
comparison chart on the project website,

    http://www.etalabs.net/musl/

For installation instructions, see the INSTALL file.

Please refer to the COPYRIGHT file for details on the copyright status
of code included in musl, and the COPYING file for the license (LGPL)
under which the library as a whole is distributed.



Greetings libc hackers!

This package is an _alpha_ release of musl, intended for the curious
and the adventurous. While it can be used to build a complete small
Linux system (musl is self-hosted on the system I use to develop it),
at this point doing so requires a lot of manual effort. Nonetheless, I
hope low-level Linux enthusiasts will try out building some compact
static binaries with musl using the provided gcc wrapper (which allows
you to link programs with musl on a "standard" glibc Linux system),
find whatever embarassing bugs I've let slip through, and provide
feedback on issues encountered building various software against musl.

Please visit #musl on Freenode IRC or contact me via email at dalias
AT etalabs DOT net for bug reports, support requests, or to get
involved in development. As this has been a one-person project so far,
mailing lists will be setup in due time on an as-needed basis.

Thank you for trying out musl.

Cheers,

Rich Felker / dalias