LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 41049 - [ARM64] Debugging Arm64 debug binary gives memory access error when accessing local variables
Summary: [ARM64] Debugging Arm64 debug binary gives memory access error when accessing...
Status: RESOLVED FIXED
Alias: None
Product: clang
Classification: Unclassified
Component: C++ (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P enhancement
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-12 15:36 PDT by Alexander Woolf
Modified: 2019-10-16 18:23 PDT (History)
10 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Woolf 2019-03-12 15:36:43 PDT
Here are my repro steps. I believe this holds for any amd64 debug program.

1) Create test.cpp whose contents are simply:

int main() {
  int x = 1;
}

2) Build the exe with clang-cl.exe --target=arm64-windows /Zi /Od test.cpp

3) Deploy test.exe / test.pdb to arm64 machine

4) Open exe under debugger, and break into code (windbg.exe test.exe, then bp test!main in command line)

5) step into function and try to observe value of local variable.
expected: local variable value displays
actual: memory access error reported

No repro on amd64.
With arm64 retail (/O2 instead of /Od), no issue except for volatile variables, which also have memory access error.
Comment 1 dmajor 2019-05-06 14:55:04 PDT
We're seeing this in Firefox Nightly builds as well. Unlike comment 0, we use /O2 but still have problems with locals. 

Here's a real-world build if it helps, although starting with the simpler reproducer from the original report may be a better idea:

1. Unpack https://archive.mozilla.org/pub/firefox/nightly/2019/05/2019-05-06-13-03-08-mozilla-central/firefox-68.0a1.en-US.win64-aarch64.zip
2. windbg.exe firefox\firefox.exe
3. .sympath+ https://symbols.mozilla.org
4. bp firefox!wmain; g
5. Single-step a few times while watching the Locals window

Results:

Locals not available, and this message often appears in the debug output:
CvRegToMachine(arm64) conversion failure for 0x1
Comment 2 Tom Tan 2019-06-03 15:30:15 PDT
This should be resolved by rL362280 (https://reviews.llvm.org/rL362280)
Comment 3 dmajor 2019-06-03 15:37:01 PDT
That's great, thanks for the pointer! I'll try to confirm this the next time I build for arm (which isn't too often anymore).