DynamoRIO / DynamoRIO/dynamorio

CRASH with multiple native handlers after vfork child exits

Open
#5,898 5 comments 0 reactions 0 assignees View on GitHub
OpSys-UNIX
Dominant language
C
Stars
3.2k
Forks
629
Avg merge
2d 15h
Merged PRs (30d)
31

Description

DynamoRIO 9.0.1 and trunk crash with an error about "multiple native handlers", in cases involving a sigaction after a vfork or clone:
```
#include
#include
int main ()
{
int r;
static struct sigaction sa;
sigaction (SIGUSR1, 0, &sa);
r = vfork();
if (r == 0) _exit(1);
sigaction (SIGUSR1, &sa, 0);
return 0;
}
```
```
$ DynamoRIO-AArch64-Linux-9.0.1/bin64/drrun -- ./a.out

```
Signal 11 is SIGSEGV.
```
$ DynamoRIO-AArch64-Linux-9.0.1/bin64/drrun -debug -- ./a.out

<(1+x) Handling our fault in a TRY at 0x000000007137726c>

```
Signal 17 is SIGCHLD.

Looking at core/unix/signal.c, the comment around this failure refers to another comment:
```
... i#1921: To properly handle multiple separate signal handler thread groups
* within this single DR process domain, we would need a list of these, along with
* lists of threads within each. Since that is very rare, and requires either
* hardcoded maximums or complexities with exit-time heap, we currently do not
* support that and die if asked to deliver a native signal in such circumstances.
```
But that doesn't seem relevant to this test case, which was extracted from posix_spawn() in glibc.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.