Skip to content

Cherry-pick commit that fixes a sanitizer bug on Apple Silicon#86

Merged
nikic merged 1 commit into
rust-lang:rustc/11.0-2020-10-12from
frewsxcv:apple-silicon-sanitizers
Dec 11, 2020
Merged

Cherry-pick commit that fixes a sanitizer bug on Apple Silicon#86
nikic merged 1 commit into
rust-lang:rustc/11.0-2020-10-12from
frewsxcv:apple-silicon-sanitizers

Conversation

@frewsxcv

Copy link
Copy Markdown

This is needed for rust-lang/rust#79883

Commit description:

[asan] Use dynamic shadow memory position on Apple Silicon macOS

This is needed because macOS on Apple Silicon has some reserved pages inside the "regular" shadow memory location, and mapping over that location fails.

Differential Revision: https://reviews.llvm.org/D82912

This is needed because macOS on Apple Silicon has some reserved pages inside the "regular" shadow memory location, and mapping over that location fails.

Differential Revision: https://reviews.llvm.org/D82912
@nikic nikic merged commit d5c516e into rust-lang:rustc/11.0-2020-10-12 Dec 11, 2020
@frewsxcv frewsxcv deleted the apple-silicon-sanitizers branch December 11, 2020 14:14
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 2, 2021
Enable ASan, TSan, UBSan for aarch64-apple-darwin.

I confirmed ASan, TSan, UBSan all work for me locally with `clang` on my new Macbook Air.

~This requires rust-lang/llvm-project#86
vext01 pushed a commit to vext01/llvm-project that referenced this pull request Oct 4, 2023
86: Fix bug in FixStackmapsSpillReloads pass. r=ltratt a=ptersilie



Co-authored-by: Lukas Diekmann <lukas.diekmann@gmail.com>
nikic pushed a commit to nikic/llvm-project that referenced this pull request Jun 8, 2026
…vm#201489)

Wire up the client (ProcessGDBRemote) side of the accelerator plugin
breakpoint protocol so the breakpoints requested by lldb-server
accelerator plugins are actually set, hit, and acted upon.

The below is a related packet sequence from the test could help to
better see things in action.
```
python3.12       < 104> send packet: $qSupported:xmlRegisters=i386,arm,mips,arc;multiprocess+;fork-events+;vfork-events+;swbreak+;hwbreak+#cd
python3.12       < 299> read packet: $PacketSize=131072;QStartNoAckMode+;qEcho+;native-signals+;QThreadSuffixSupported+;QListThreadsInStopReply+;qXfer:features:read+;QNonStop+;jMultiBreakpoint+;QPassSignals+;qXfer:auxv:read+;qXfer:libraries-svr4:read+;qXfer:siginfo:read+;accelerator-plugins+;multiprocess+;fork-events+;vfork-events+rust-lang#86
python3.12       <  32> send packet: $jAcceleratorPluginInitialize#50
python3.12       < 238> read packet: $[{"breakpoints":[{"by_address":null,"by_name":{"function_name":"mock_gpu_accelerator_initialize","shlib":null}],"identifier":1,"symbol_names":["mock_gpu_accelerator_compute"]}]],"identifier":1,"plugin_name":"mock","session_name":""}]]#2f
python3.12       < 104> send packet: $qSupported:xmlRegisters=i386,arm,mips,arc;multiprocess+;fork-events+;vfork-events+;swbreak+;hwbreak+#cd
python3.12       < 299> read packet: $PacketSize=131072;QStartNoAckMode+;qEcho+;native-signals+;QThreadSuffixSupported+;QListThreadsInStopReply+;qXfer:features:read+;QNonStop+;jMultiBreakpoint+;QPassSignals+;qXfer:auxv:read+;qXfer:libraries-svr4:read+;qXfer:siginfo:read+;accelerator-plugins+;multiprocess+;fork-events+;vfork-events+rust-lang#86
intern-state     < 314> send packet: $jAcceleratorPluginBreakpointHit:{"breakpoint":{"by_address":null,"by_name":{"function_name":"mock_gpu_accelerator_initialize","shlib":null}],"identifier":1,"symbol_names":["mock_gpu_accelerator_compute"]}],"plugin_name":"mock","symbol_values":[{"name":"mock_gpu_accelerator_compute","value":94768064848192}]]}]#ef
intern-state     < 360> read packet: ${"actions":{"breakpoints":[{"by_address":null,"by_name":{"function_name":"mock_gpu_accelerator_finish","shlib":"a.out"}],"identifier":3,"symbol_names":[]}],{"by_address":{"load_address":94768064848192}],"by_name":null,"identifier":2,"symbol_names":[]}]],"identifier":2,"plugin_name":"mock","session_name":""}],"auto_resume_native":false,"disable_bp":true}]rust-lang#44
intern-state     < 188> send packet: $jAcceleratorPluginBreakpointHit:{"breakpoint":{"by_address":{"load_address":94768064848192}],"by_name":null,"identifier":2,"symbol_names":[]}],"plugin_name":"mock","symbol_values":[]}]#fd
intern-state     < 220> send packet: $jAcceleratorPluginBreakpointHit:{"breakpoint":{"by_address":null,"by_name":{"function_name":"mock_gpu_accelerator_finish","shlib":"a.out"}],"identifier":3,"symbol_names":[]}],"plugin_name":"mock","symbol_values":[]}]#d7
satyajanga@devgpu011:llvm-project  (accelerator-plugin-handle-actions)$

```

Code changes: 

- GDBRemoteCommunicationClient learns the "accelerator-plugins+" feature
from qSupported and gains GetAcceleratorInitializeActions() and
AcceleratorBreakpointHit() to drive the jAcceleratorPluginInitialize and
jAcceleratorPluginBreakpointHit packets.
- ProcessGDBRemote::HandleAcceleratorActions() sets the requested
breakpoints as internal breakpoints with a synchronous callback. When a
callback fires it resolves any requested symbol values, notifies the
plugin, disables the breakpoint and/or auto-resumes the native process
per the response, and handles any further actions (e.g. new breakpoints)
the plugin returns. Initial actions are fetched in DidLaunchOrAttach.
- The mock accelerator plugin now sets its initialize breakpoint on a
dedicated "accelerator_initialize" hook (rather than "main") so it only
affects this test's inferior, and exercises all three breakpoint types:
by name, by name scoped to a shared library, and by address.
- Add an end-to-end API test that launches a real process and verifies
the breakpoints are set, hit, and chained, plus updated packet-level
coverage.
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.

3 participants