Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upObtain backtraces automatically from segfaults #11530
Conversation
highfive
commented
May 31, 2016
|
Heads up! This PR modifies the following files:
|
highfive
commented
May 31, 2016
|
Sample output:
|
|
r? @metajack |
highfive
commented
May 31, 2016
|
New code was committed to pull request. |
| fn CrashHard(&self) { | ||
| let p: *mut u32 = ptr::null_mut(); | ||
| unsafe { | ||
| *p = 0xdeadbeef |
This comment has been minimized.
This comment has been minimized.
|
FYI you can use rustc-demangle to demangle symbols: https://github.com/alexcrichton/rustc-demangle |
| @@ -659,6 +660,14 @@ impl WindowMethods for Window { | |||
| } | |||
|
|
|||
| #[allow(unsafe_code)] | |||
| fn CrashHard(&self) { | |||
| let p: *mut u32 = ptr::null_mut(); | |||
This comment has been minimized.
This comment has been minimized.
luser
May 31, 2016
Contributor
Did you sanity check that the optimizer doesn't do anything weird here? I don't know what LLVM does but in Breakpad's unit tests we had to jump through hoops to avoid GCC's optimizer optimizing away our crash function:
https://chromium.googlesource.com/breakpad/breakpad/+blame/master/src/client/linux/handler/exception_handler_unittest.cc#195
|
@bors-servo r- sig claims to be GPL-3.0 |
|
Can you put that crashing method in TestBinding? |
|
|
|
All comments addressed. Rather than a null pointer dereference, I went with writing to a pointer into read-only memory. |
highfive
commented
Jun 7, 2016
|
New code was committed to pull request. |
|
Reviewed 3 of 3 files at r1, 6 of 6 files at r2, 7 of 7 files at r3, 6 of 6 files at r4, 10 of 10 files at r5, 6 of 6 files at r6, 8 of 8 files at r7, 6 of 6 files at r8. Comments from Reviewable |
|
@bors-servo r+ |
|
|
Obtain backtraces automatically from segfaults <!-- Please describe your changes on the following line: --> This enables more meaningful output from observing hard crashes outside of GDB through the judicious use of a SIGSEGV signal handler. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #9371 (github issue number if applicable). - [X] There are tests for these changes OR <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11530) <!-- Reviewable:end -->
|
|
|
@bors-servo: r=metajack |
|
|
Obtain backtraces automatically from segfaults <!-- Please describe your changes on the following line: --> This enables more meaningful output from observing hard crashes outside of GDB through the judicious use of a SIGSEGV signal handler. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #9371 (github issue number if applicable). - [X] There are tests for these changes OR <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11530) <!-- Reviewable:end -->
|
|
|
@bors-servo retry |
Obtain backtraces automatically from segfaults <!-- Please describe your changes on the following line: --> This enables more meaningful output from observing hard crashes outside of GDB through the judicious use of a SIGSEGV signal handler. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #9371 (github issue number if applicable). - [X] There are tests for these changes OR <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11530) <!-- Reviewable:end -->
|
|
jdm commentedMay 31, 2016
•
edited by larsbergstrom
This enables more meaningful output from observing hard crashes outside of GDB through the judicious use of a SIGSEGV signal handler.
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is