DynamoRIO / DynamoRIO/dynamorio

Get external_detach_state tests working on x86

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

Description

The external_detach_state tests are currently AArch64 only even though they are based on the api.detach_state test which fully supports AArch64 and x86.

If you try to run the tests on x86 you get various assert failures:

```
core/stats.c:361 ks->node[ks->depth - 1].var == pv && "stop not matching TOS"
```

```
core/unix/signal.c:4048 extra_size == frame->uc.uc_mcontext.fpstate->sw_reserved.extended_size
```

There is also a change required to `thread_check_sigstate_from_handler()` in `detach_state_shared.c`. The external detach state tests rely on `runall.cmake` sending a `SIGTERM` signal to detect the detach has taken place so we need to make sure `SIGTERM` is unblocked during the signal handler. For some reason when we unblock it on x86 `api.detatch_state` (the internal detach state test) fails with this assert:

```
core/vmareas.c:8328 !ok || !TEST(MEMPROT_WRITE, prot2) || TEST(FRAG_SELFMOD_SANDBOXED, *flags) || !INTERNAL_OPTION(hw_cache_consistency)
```

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.