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 upAssert fail #18439 #23021
Assert fail #18439 #23021
Conversation
highfive
commented
Mar 13, 2019
|
Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @ferjm (or someone else) soon. |
highfive
commented
Mar 13, 2019
|
Heads up! This PR modifies the following files:
|
highfive
commented
Mar 13, 2019
|
|
This looks like what I expected to see :) |
| if !thread::panicking() { | ||
| debug_assert!(self.load.is_none()); | ||
| if let Some(script_thread) = self.load.take() { | ||
| self.doc.finish_load(script_thread); |
This comment has been minimized.
This comment has been minimized.
jdm
Mar 14, 2019
Member
We should do Some(load) instead of Some(script_thread); the value inside the Option isn't related to the script thread.
| .docs_with_no_blocking_loads | ||
| .borrow_mut() | ||
| .insert(Dom::from_ref(doc)); | ||
| } |
This comment has been minimized.
This comment has been minimized.
jdm
Mar 14, 2019
Member
Let's scope the unsafe block a little bit narrower:
SCRIPT_THREAD_ROOT.with(|root| {
if let Some(script_thread) = root.get() {
let script_thread = unsafe { &*script_thread };
script_thread
.docs_with_no_blocking_loads
.borrow_mut()
.insert(Dom::from_ref(doc));
}
});
This comment has been minimized.
This comment has been minimized.
ejmg
Mar 14, 2019
Author
Contributor
thank you! I didn't know I could deref the bound value in an if let like that.
|
I've spent a bunch of time trying to write an automated test that tickles this problem, but I have not been able to do so. |
- removed unused import in document_loader.rs - limit unsafe block in mark_document_with_no_blocked_loads in script_thread.rs - changed name of if let value to load in Drop for LoadBlocker in document_loader.rs
|
I've made the changes requested so far and rebased them such that there are only three commits, the first two are the actual changes required for the issue (one per file change) and the last one combines all requested changes from code review. Let me know if this works and or if there are more changes desired |
|
testing a release build with my edits and I have been unable to replicate the crashes mentioned in #18439. |
|
@bors-servo r+ |
|
|
Assert fail #18439 <!-- Please describe your changes on the following line: --> This PR addresses #18439 by removing an assert statement that forces a panic whenever `LoadBlocker` is dropped during a GC sweep and receives a `None` `SCRIPT_THREAD_ROOT` value from `mark_document_with_no_blocked_loads()`. Instead of panicking on the assert, we remove it and let the None value pass silently. --- <!-- 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 #18439 <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- 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="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23021) <!-- Reviewable:end -->
|
|
|
@bors-servo retry |
Assert fail #18439 <!-- Please describe your changes on the following line: --> This PR addresses #18439 by removing an assert statement that forces a panic whenever `LoadBlocker` is dropped during a GC sweep and receives a `None` `SCRIPT_THREAD_ROOT` value from `mark_document_with_no_blocked_loads()`. Instead of panicking on the assert, we remove it and let the None value pass silently. --- <!-- 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 #18439 <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- 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="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23021) <!-- Reviewable:end -->
|
|
|
@bors-servo retry |
Assert fail #18439 <!-- Please describe your changes on the following line: --> This PR addresses #18439 by removing an assert statement that forces a panic whenever `LoadBlocker` is dropped during a GC sweep and receives a `None` `SCRIPT_THREAD_ROOT` value from `mark_document_with_no_blocked_loads()`. Instead of panicking on the assert, we remove it and let the None value pass silently. --- <!-- 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 #18439 <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- 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="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23021) <!-- Reviewable:end -->
|
|
ejmg commentedMar 13, 2019
•
edited by SimonSapin
This PR addresses #18439 by removing an assert statement that forces a panic whenever
LoadBlockeris dropped during a GC sweep and receives aNoneSCRIPT_THREAD_ROOTvalue frommark_document_with_no_blocked_loads(). Instead of panicking on the assert, we remove it and let the None value pass silently../mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is