GeezerVison is showing github.com — Use scopeguard for start_the_world in faulthandler dump_all_threads · RustPython/RustPython@6ed555e
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: Cargo.lock +1Lines changed: 1 addition & 0 deletions Collapse file
Copy file name to clipboardExpand all lines: crates/stdlib/Cargo.toml +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -52,6 +52,7 @@ num_enum = { workspace = true } |
52 | 52 | parking_lot = { workspace = true } |
53 | 53 | phf = { workspace = true, default-features = true, features = ["macros"] } |
54 | 54 | rapidhash = { workspace = true } |
| 55 | +scopeguard = { workspace = true } |
55 | 56 |
|
56 | 57 | memchr = { workspace = true } |
57 | 58 | base64 = { workspace = true } |
|
Collapse file
Copy file name to clipboardExpand all lines: crates/stdlib/src/faulthandler.rs +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -332,8 +332,9 @@ mod decl { |
332 | 332 | { |
333 | 333 | use core::sync::atomic::Ordering; |
334 | 334 | let current_tid = rustpython_vm::stdlib::_thread::get_ident(); |
335 | | - vm.state.stop_the_world.stop_the_world(vm); |
336 | 335 | { |
| 336 | + vm.state.stop_the_world.stop_the_world(vm); |
| 337 | + scopeguard::defer! { vm.state.stop_the_world.start_the_world(vm); } |
337 | 338 | let registry = vm.state.thread_frames.lock(); |
338 | 339 | #[expect( |
339 | 340 | clippy::iter_over_hash_type, |
@@ -348,7 +349,6 @@ mod decl { |
348 | 349 | puts(fd, "\n"); |
349 | 350 | } |
350 | 351 | } |
351 | | - vm.state.stop_the_world.start_the_world(vm); |
352 | 352 |
|
353 | 353 | // Now dump current thread from its live frame chain. |
354 | 354 | write_thread_id(fd, current_tid, true); |
|
Collapse file
Copy file name to clipboardExpand all lines: crates/vm/src/vm/mod.rs +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -2230,7 +2230,7 @@ impl VirtualMachine { |
2230 | 2230 | thread::update_thread_exception(self.topmost_exception()); |
2231 | 2231 | } |
2232 | 2232 |
|
2233 | | - /// Restore an exc_info slot value saved by `with_frame_impl`, skipping the |
| 2233 | + /// Restore an exc_info slot value saved by `with_frame`, skipping the |
2234 | 2234 | /// store when the slot is unchanged. `saved` is a strong reference taken |
2235 | 2235 | /// at save time, so the object it points to cannot have been freed and |
2236 | 2236 | /// its address reused while the frame ran; pointer identity therefore |
|