This repository was archived by the owner on Nov 8, 2023. It is now read-only.
Commit 089f4d1
committed
exit(): add a lock.
POSIX hasn't accepted https://austingroupbugs.net/view.php?id=1845 yet,
but all the libc maintainers who've commented on
https://www.openwall.com/lists/libc-coord/2024/07/24/4 agree that this
is a good idea, with the only disagreement being whether or not the
mutex should be recursive.
I preferred the recursive mutex because suddenly disallowing exit() from
an atexit handler is an unnecessary behavior change that seemed likely
to trip someone up, and glibc found that they have existing examples of
exit() called from ELF destructors or atexit() handlers in test cases if
nothing else (https://sourceware.org/bugzilla/show_bug.cgi?id=31997).
So go with the recursive mutex option. The new test fails most of the
time without this fix, and runs fine with this fix.
Change-Id: I33c2229512e70113739e0dd9ffd2a745292ba8c31 parent 1e158af commit 089f4d1
2 files changed
+59
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| 38 | + | |
| 39 | + | |
37 | 40 | | |
38 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
39 | 45 | | |
40 | 46 | | |
41 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
650 | 651 | | |
651 | 652 | | |
652 | 653 | | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
653 | 706 | | |
654 | 707 | | |
655 | 708 | | |
| |||
0 commit comments