DynamoRIO / DynamoRIO/dynamorio

DynamoRIO fails to run trivial "clone" example on ARM

Open
#1,936 6 comments 0 reactions 0 assignees View on GitHub
Bug-DRCrash help wanted OpSys-AArch64 OpSys-ARM
Dominant language
C
Stars
3.2k
Forks
629
Avg merge
2d 18h
Merged PRs (30d)
30

Description

Here's the program. It seems to work natively on several Linux architectures, and under DynamoRIO on Intel, but not under DynamoRIO on ARM, where I got a segfault in is_thread_tls_initialized.

The program puts a garbage value in the child's TLS pointer, which is hardly acceptable in a C program, so imagine this program written in assembler, if you prefer. If you're not using the standard libraries you're presumably free to use the TLS pointer however you like.

```
#define _GNU_SOURCE 1
#include
#include
#include

int child(void *arg)
{
_exit(0);
}

int main()
{
char *stack = malloc(4096);
int flags = (CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
CLONE_THREAD | CLONE_SYSVSEM | CLONE_SETTLS |
CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID);
void *arg = 0;
pid_t parent_tid = 0;
void *tls = (void *)0x123;
pid_t child_tid = 0;

clone(child, stack + 4096, flags, arg, &parent_tid, tls, &child_tid);
_exit(0);
}
```

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.