You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The CLONE_CHILD_CLEARTID flag to clone turns the return value into a futex that is signalled on thread exit. We should intercept this and register the futex location with the lthread library so that it can be zeroed and sent a wakeup when the underlying lthread exits. We need to also intercept set_tid_address in the same way.
The text was updated successfully, but these errors were encountered:
Once #259 is merged, this should be possible. We need to:
Add a field on the lthread structure to store the exit futex location.
On thread_destroy_host, check that field and, if it is non-null, zero the value at that address and wake the futex.
Add an interceptor for the clone system call that sets this field in the newly created futex.
Add an interceptor for set_tid_address, which does the same thing.
Carrying the value between the clone interceptor and thread_create_host is non-trivial. The simplest thing to do is to store the value in the stack. The distance between the sp value and sp-128 is the red zone, but anything after that is fair game according to the ABI. We can store the futex address (or 0) at sp-136 and then check this in thread_create_host.
The
CLONE_CHILD_CLEARTID
flag toclone
turns the return value into a futex that is signalled on thread exit. We should intercept this and register the futex location with the lthread library so that it can be zeroed and sent a wakeup when the underlying lthread exits. We need to also interceptset_tid_address
in the same way.The text was updated successfully, but these errors were encountered: