Skip to content

Comments

i#5383: Fix macOS arm64 test build/run#7171

Merged
edeiana merged 10 commits intoDynamoRIO:masterfrom
ndrewh:i5383-macos-aarch64-tests1
Feb 28, 2025
Merged

i#5383: Fix macOS arm64 test build/run#7171
edeiana merged 10 commits intoDynamoRIO:masterfrom
ndrewh:i5383-macos-aarch64-tests1

Conversation

@ndrewh
Copy link
Contributor

@ndrewh ndrewh commented Dec 27, 2024

This makes tests build and run properly on macOS (14.4) arm64 (M3). Many tests do not pass, but you can at least run them now.

  • Disable selfmod tests due to build failures on M3
  • Fix macOS build for mangle_pauth test (test still fails for some reason)
  • Mark dump_ucontext as NYI on macOS
  • Disable reachable_client option by default on macOS
  • Fixes NULL sigcontext_t in os_forge_exception (the mangle_pauth test was hitting this)

Issue #5383
Issue #7296

- Disable selfmod tests due to build failures on M3
- Fix macOS build for mangle_pauth test (test still fails for some reason)
- Mark dump_ucontext as NYI on macOS

- Fixes NULL sigcontext_t in os_forge_exception
- Adds -vm_size 500M to client tests to avoid reachablity assert
@ndrewh
Copy link
Contributor Author

ndrewh commented Dec 27, 2024

only a64 failure is raw-zlib #5635, doesn't seem to be my fault

@ndrewh ndrewh changed the title i5383: Fix macOS arm64 test build/run i#5383: Fix macOS arm64 test build/run Dec 27, 2024
Copy link
Contributor

@edeiana edeiana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for improving MacOS tests!

Please add "Issue #5383" at the bottom of your PR description.

@edeiana edeiana requested a review from abhinav92003 January 7, 2025 19:46
edeiana pushed a commit that referenced this pull request Jan 16, 2025
This fixes several build and runtime issues under macOS on ARM64 on
macOS 14.4.1 (Sonoma).

- `FEATURE_PAUTH` is now detected on macOS using a sysctl (capability
MSRs cannot be read in userspace on M3 at least).
- In the preload library and os.c, `_init` needs
`__attribute__((constructor))` to be run by dyld.
- `PLATFORM_SUPPORTS_SCATTER_GATHER` is broken, disabled for now
on a64 macOS.
- Fixed sigcontext/mcontext conversion which assumes old `simd` size and
was failing on an assert.

Known issues that remain:
- VM allocation frequently but nondeterministically fails reachability
constraints. `-vm_size 500M` seems to fix this. #7171 adds this flag to
tests on macOS+ARM64. Another option is to make this the default on
macOS+ARM64.
- Sometimes some bookkeeping asserts in `vmh_exit` are reached upon
process exit.

The end result is that the `bbcount` tool works on a simple toy program
on macOS, in debug mode, without hitting any asserts:
```
bin64/drrun -debug -vm_size 500M -c api/bin/libbbcount.dylib -- ./main
```

Issue #5383
@ndrewh ndrewh requested a review from edeiana February 23, 2025 07:11
Copy link
Contributor

@edeiana edeiana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for filing #7296 , please add it to the PR description along with #5383.

Have a look at #7296 (comment). The rest LGTM.

@ndrewh ndrewh requested a review from edeiana February 26, 2025 17:40
Copy link
Contributor

@edeiana edeiana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you for contributing!

@edeiana edeiana merged commit 11ee87b into DynamoRIO:master Feb 28, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants