diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-06-20 20:08:50 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-20 20:08:50 -0500 |
commit | 2c4c2d8779a185a2da264f1ac11eb68b0d492fd0 (patch) | |
tree | 61c197875a600e0ebeeefe453f859a3ccfe54022 /components/script/dom | |
parent | 993df6a359a197daa003f7d0956b8512495227fa (diff) | |
parent | 99e436eb05577f28712e0e0731be72b8d391716f (diff) | |
download | servo-2c4c2d8779a185a2da264f1ac11eb68b0d492fd0.tar.gz servo-2c4c2d8779a185a2da264f1ac11eb68b0d492fd0.zip |
Auto merge of #11530 - jdm:sigsegv, 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 -->
Diffstat (limited to 'components/script/dom')
-rw-r--r-- | components/script/dom/testbinding.rs | 9 | ||||
-rw-r--r-- | components/script/dom/webidls/TestBinding.webidl | 5 |
2 files changed, 14 insertions, 0 deletions
diff --git a/components/script/dom/testbinding.rs b/components/script/dom/testbinding.rs index 95341751780..bbbbc8aa5d6 100644 --- a/components/script/dom/testbinding.rs +++ b/components/script/dom/testbinding.rs @@ -571,6 +571,15 @@ impl TestBindingMethods for TestBinding { fn FuncControlledAttributeEnabled(&self) -> bool { false } fn FuncControlledMethodDisabled(&self) {} fn FuncControlledMethodEnabled(&self) {} + + #[allow(unsafe_code)] + fn CrashHard(&self) { + static READ_ONLY_VALUE: i32 = 0; + unsafe { + let p: *mut u32 = &READ_ONLY_VALUE as *const _ as *mut _; + ptr::write_volatile(p, 0xbaadc0de); + } + } } impl TestBinding { diff --git a/components/script/dom/webidls/TestBinding.webidl b/components/script/dom/webidls/TestBinding.webidl index cdfb9fd18ae..eb6e5a9ae7b 100644 --- a/components/script/dom/webidls/TestBinding.webidl +++ b/components/script/dom/webidls/TestBinding.webidl @@ -456,3 +456,8 @@ interface TestBinding { [Func="TestBinding::condition_satisfied"] const unsigned short funcControlledConstEnabled = 0; }; + +partial interface TestBinding { + [Pref="dom.testable_crash.enabled"] + void crashHard(); +}; |