]> sourceware.org Git - glibc.git/commit
stdlib: Allow concurrent quick_exit (BZ 31997)
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 5 Aug 2024 14:27:35 +0000 (11:27 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 5 Aug 2024 20:07:57 +0000 (17:07 -0300)
commitc6af8a9a3ce137a9704825d173be22a2b2d9cb49
treedaa57dfeb5ae6e1d1c61b7b414400b3bb28d3546
parent5097cd344fd243fb8deb6dec96e8073753f962f9
stdlib: Allow concurrent quick_exit (BZ 31997)

As for exit, also allows concurrent quick_exit to avoid race
conditions when it is called concurrently.  Since it uses the same
internal function as exit, the __exit_lock lock is moved to
__run_exit_handlers.  It also solved a potential concurrent when
calling exit and quick_exit concurrently.

The test case 'expected' is expanded to a value larger than the
minimum required by C/POSIX (32 entries) so at_quick_exit() will
require libc to allocate a new block.  This makes the test mre likely to
trigger concurrent issues (through free() at __run_exit_handlers)
if quick_exit() interacts with the at_quick_exit list concurrently.

This is also the latest interpretation of the Austin Ticket [1].

Checked on x86_64-linux-gnu.

[1] https://austingroupbugs.net/view.php?id=1845
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
stdlib/Makefile
stdlib/exit.c
stdlib/tst-concurrent-exit-skeleton.c [new file with mode: 0644]
stdlib/tst-concurrent-exit.c
stdlib/tst-concurrent-quick_exit.c [new file with mode: 0644]
This page took 0.041135 seconds and 5 git commands to generate.