Closed
Bug 1451292
Opened 8 years ago
Closed 8 years ago
GDB on ARM64 goes into infinite loop when hitting breakpoint instruction
Categories
(Core :: JavaScript Engine: JIT, enhancement)
Tracking
()
RESOLVED
FIXED
mozilla61
| Tracking | Status | |
|---|---|---|
| firefox61 | --- | fixed |
People
(Reporter: decoder, Assigned: lth)
Details
Attachments
(1 file)
|
1.09 KB,
patch
|
sstangl
:
review+
|
Details | Diff | Splinter Review |
On ARM64, I noticed that GDB just spins forever when it hits a breakpoint instruction. Our MacroAssembler emits breakpoint instructions for assertions, so we need to change this behavior on ARM64 to emit a NULL-deref instead to allow automated testing with GDB to work properly.
| Assignee | ||
Comment 1•8 years ago
|
||
Maybe slightly relevant, since symptoms are the same, even though the bug is reported for 32-bit ARM: https://sourceware.org/bugzilla/show_bug.cgi?id=22645
| Assignee | ||
Comment 2•8 years ago
|
||
This appears to be caused by the payload that we put into the Brk instruction, we can only assume this means something special to gdb. The instruction can carry a 16-bit immediate. MacroAssembler::breakpoint() starts with the code equal to 0xA77; it increments this code after emitting the instruction; and then the payload in the instruction is set to (code & 0xFFFF). When I change the code to zero, gdb stops as it's supposed to.
The current behavior dates back to the initial import of the arm64 support, nearly three years ago.
I did find the ability to have a code useful for some debugging work, but now that the back-end is up and running we can probably just pin it to zero. Should there be a need to emit a different code the underlying instruction emitter that takes an explicit code will still be available.
| Assignee | ||
Comment 3•8 years ago
|
||
Choose a breakpoint payload that makes gdb stop properly.
Attachment #8964919 -
Flags: review?(sstangl)
Updated•8 years ago
|
Attachment #8964919 -
Flags: review?(sstangl) → review+
Pushed by lhansen@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/236c11a47aa7
Better payload for arm64 breakpoint instruction. r=sstangl
Comment 5•8 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
You need to log in
before you can comment on or make changes to this bug.
Description
•