Make more threading improvements

- ASAN memory morgue is now lockless
- Make C11 atomics header more portable
- Rewrote pthread keys support to be lockless
- Simplify Python's unicode table unpacking code
- Make crash report write(2) closer to being atomic
- Make it possible to strace/ftrace a single thread
- ASAN now checks nul-terminated strings fast and properly
- Windows fork() now restores TLS memory of calling thread
This commit is contained in:
Justine Tunney 2022-11-01 22:36:03 -07:00
parent d7b88734cd
commit e522aa3a07
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
189 changed files with 1363 additions and 1217 deletions

View file

@ -1,2 +0,0 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_enable_tls,0x13d1490a5300309e,globl,hidden

View file

@ -0,0 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
.scall sys_set_tls,0x13d1490a5300309e,globl,hidden

View file

@ -31,9 +31,9 @@
* short time period should say:
*
* void foo() {
* --__strace;
* strace_enabled(-1);
* bar();
* ++__strace;
* strace_enabled(+1);
* }
*
* This way you still have some flexibility to force syscall tracing, by
@ -41,4 +41,4 @@
* under normal circumstances, `__strace` should only be either zero or
* one.
*/
atomic_int __strace;
int __strace;

View file

@ -212,7 +212,7 @@ scall sys_modify_ldt 0xfffffffffffff09a globl # no wrapper
scall sys_pivot_root 0xfffffffffffff09b globl hidden
#scall prctl 0xfffffffffffff09d globl # wrapped manually
scall sys_arch_prctl 0x0a50a50a5ffff09e globl hidden # sysarch() on bsd
scall sys_enable_tls 0x13d1490a5300309e globl hidden # arch_prctl on linux, sysarch on freebsd, _lwp_setprivate on netbsd, __set_tcb on openbsd, _lwp_setprivate on netbsd, thread_fast_set_cthread_self on xnu
scall sys_set_tls 0x13d1490a5300309e globl hidden # arch_prctl on linux, sysarch on freebsd, _lwp_setprivate on netbsd, __set_tcb on openbsd, _lwp_setprivate on netbsd, thread_fast_set_cthread_self on xnu
scall sys_adjtimex 0xfffffffffffff09f globl # no wrapper
scall sys_swapon 0xffffff05520550a7 globl # no wrapper
scall sys_swapoff 0xffffff1a8ffff0a8 globl # no wrapper