Fix GC borrow hazards triggered by LoadBlocker::terminate#34122
Fix GC borrow hazards triggered by LoadBlocker::terminate#34122jdm merged 5 commits intoservo:mainfrom
Conversation
1c5828c to
845bcdf
Compare
| if let Some(this) = blocker.borrow().as_ref() { | ||
| let load_data = this.load.clone().unwrap(); | ||
| this.doc.finish_load(load_data, can_gc); | ||
| } | ||
| *blocker = None; | ||
| *blocker.borrow_mut() = None; |
There was a problem hiding this comment.
Let's write this as:
let Some(mut this) = blocker.borrow_mut().take() else { return };
this.doc.finish_load(this.load.take().unwrap(), can_gc);This resets the value to None before calling finish_load, unlike the current implementation, but that should not make a difference as far as I can tell.
| request.blocker = DomRefCell::new(Some(LoadBlocker::new( | ||
| &document, | ||
| LoadType::Image(url.clone()), | ||
| ))); |
There was a problem hiding this comment.
| request.blocker = DomRefCell::new(Some(LoadBlocker::new( | |
| &document, | |
| LoadType::Image(url.clone()), | |
| ))); | |
| *request.blocker.borrow_mut() = Some(LoadBlocker::new( | |
| &document, | |
| LoadType::Image(url.clone()), | |
| )); |
845bcdf to
23d3887
Compare
|
Do I allow this? |
|
Oh, interesting. That's subtle! Let's stick with the code that you wrote instead of my suggestion. |
Alright, no problem! |
23d3887 to
b6b35a5
Compare
* Fix GC borrow hazards triggered by LoadBlocker::terminate Signed-off-by: taniishkaaa <[email protected]> * Fix clippy warnings Signed-off-by: taniishkaaa <[email protected]> * Use borrow_mut() Signed-off-by: taniishkaaa <[email protected]> * Revert to previous code due to crown unrooted error Signed-off-by: taniishkaaa <[email protected]> --------- Signed-off-by: taniishkaaa <[email protected]>
|
Seems to affect Range tests: https://github.com/servo/servo/actions/runs/11669312577 |
Should I remove the respective files to update test expectations? |
|
I don't know if it's expected or not to affect these tests. But if so, you can update the expectations like |
Signed-off-by: taniishkaaa <[email protected]>
Signed-off-by: taniishkaaa <[email protected]>
Signed-off-by: taniishkaaa <[email protected]>
Signed-off-by: taniishkaaa <[email protected]>
Signed-off-by: taniishkaaa <[email protected]>
b6b35a5 to
be1febc
Compare
The logic in LoadBlocker::terminate was modified in servo#34122 to `clone` the LoadBlocker's inner `load` member instead of `take`ing it. However, this member serves as a flag so that `LoadBlocker`'s Drop impl can avoid calling `doc.finish_load` on already terminated loads. The change in unnecessary 'unknown completed load' warnings when Servo is run with logging enabled. Signed-off-by: Mukilan Thiyagarajan <[email protected]>
The logic in LoadBlocker::terminate was modified in servo#34122 to `clone` the LoadBlocker's inner `load` member instead of `take`ing it. However, this member serves as a flag so that `LoadBlocker`'s Drop impl can avoid calling `doc.finish_load` on already terminated loads. The change in unnecessary 'unknown completed load' warnings when Servo is run with logging enabled. This patch also updates the expectations for tests which started passing after the change in servo#34122, but now fail again with this change. These test failures will be investigated in servo#36561. Signed-off-by: Mukilan Thiyagarajan <[email protected]>
The logic in LoadBlocker::terminate was modified in servo#34122 to `clone` the LoadBlocker's inner `load` member instead of `take`ing it. However, this member serves as a flag so that `LoadBlocker`'s Drop impl can avoid calling `doc.finish_load` on already terminated loads. The change in unnecessary 'unknown completed load' warnings when Servo is run with logging enabled. This patch also updates the expectations for tests which started passing after the change in servo#34122, but now fail again with this change. These test failures will be investigated in servo#36561. Signed-off-by: Mukilan Thiyagarajan <[email protected]>
The logic in LoadBlocker::terminate was modified in servo#34122 to `clone` the LoadBlocker's inner `load` member instead of `take`ing it. However, this member serves as a flag so that `LoadBlocker`'s Drop impl can avoid calling `doc.finish_load` on already terminated loads. The change in unnecessary 'unknown completed load' warnings when Servo is run with logging enabled. This patch also updates the expectations for tests which started passing after the change in servo#34122, but now fail again with this change. These test failures will be investigated in servo#36561. Signed-off-by: Mukilan Thiyagarajan <[email protected]>
…36508) The logic in LoadBlocker::terminate was modified in #34122 to `clone` the LoadBlocker's inner `load` member instead of `take`ing it. However, this member serves as a flag so that `LoadBlocker`'s Drop impl can avoid calling `doc.finish_load` on already terminated loads. The change results in unnecessary 'unknown completed load' warnings when Servo is run with logging enabled. Signed-off-by: Mukilan Thiyagarajan <[email protected]> Signed-off-by: Mukilan Thiyagarajan <[email protected]>
Fixes GC borrow hazards triggered by LoadBlocker::terminate
./mach build -ddoes not report any errors./mach test-tidydoes not report any errors