DynamoRIO / DynamoRIO/dynamorio

Externally-triggered detach auto-restart syscall skipping not working

Open
#7,616 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
3.2k
Forks
629
Avg merge
2d 18h
Merged PRs (30d)
30

Description

If the main thread is in a `futex` system call (for example in `pthread_join`) or in a `wait4` system call (for example in `wait`) then detach has no effect: it seems that DynamoRIO's signal handler is run but no other action is taken because the signal handler returns to the system call and the dispatch loop is never entered.

If the main thread is in a `read` system call then detach does not take effect until the system call returns.

If the main thread is in a `clock_nanosleep` system call (for example in `sleep`) then detach causes the system call to return prematurely.

However, detach works properly if the main thread is in an infinite loop with no system calls.

(This may be the reason for it not being possible to detach from some "real-life" multi-threaded applications.)

(All of this was tested on AArch64.)

Contributor guide

Open the contributing guide

Research direction

Reproduce the detach behavior on AArch64 while the main thread is in futex, wait4, read, and clock_nanosleep, then compare it with an infinite loop. Trace the signal handler through the system-call return path and dispatch loop. Done means externally triggered detach takes effect correctly without prematurely interrupting the affected system calls.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.