Search
Saturday, 10th of November 2018, 1:26:11 UTC
11:14:07
stassats
what if instead of unmapping the thread struct i'll just vm_prot_none it
12:04:36
stassats
vm_prot_none doesn't help, but, OS_VM_PROT_WRITE does end up with Received signal 11 in non-lisp thread 9219342400, resignalling to a lisp thread.
12:08:02
stassats
so, some OS thread is touching a thread corpse inappropriately
12:30:02
stassats
the foreign thread may actually be a newly dead lisp thread
12:45:17
stassats
ok, schedule_thread_post_mortem may be not right
12:46:19
stassats
or pthread_join will serialize that anyway
12:49:22
stassats
ok, i have a fault from a thread after it has been joined
12:56:53
stassats
pthread_join may be using a futex, so it wakes up the waiting thread, which destroys the stack and that futex call can't return?
13:17:07
stassats
and a test case: (loop repeat 1000 do (let ((sem (sb-thread:make-semaphore))) (loop repeat 10 collect (sb-thread:make-thread (lambda () (sb-thread:wait-on-semaphore sem)))) (sb-thread:signal-semaphore sem 10)))
13:17:21
stassats
i think i can translated it to C, but i'm a bit lazy (for it being C)
13:24:40
stassats
https://github.com/openbsd/src/blob/b66614995ab119f75167daaa7755b34001836821/lib/libc/thread/rthread.c#L153
Saturday, 10th of November 2018, 13:26:11 UTC