-
Notifications
You must be signed in to change notification settings - Fork 4
fix: prevent SIGURG preemption live-lock by hooking write, guarding monitor signal dispatch, and adding sigurg_handler safety net #439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
d36d080
fix: put preempted Syscall(Executing) coroutines back in ready queue …
Copilot 5581cff
fix: handle Syscall(Executing) in try_resume and check_ready instead …
Copilot df1da46
Merge branch 'master' into copilot/fix-coroutine-scheduler-bug
loongs-zhang 9ecd4ea
fix: reorder change_state to log before notifying MonitorListener
Copilot a0a79f0
fix: translate change_state comment to bilingual Chinese/English
Copilot 87d47a6
fix compile
loongs-zhang fac1168
clean code
loongs-zhang 726199b
fix: conditionally reorder change_state to prevent both live-lock and…
Copilot 4675117
fix: hook write with re-entrancy guard to prevent preemption during l…
Copilot ca70cd7
refactor: use impl_hook! for write and implement special facade in wr…
Copilot 4384994
fix: reorder impl_facade! to transition state before logging, revert …
Copilot c49454d
move code
loongs-zhang 7e7f4f5
refactor: move IN_FACADE re-entrancy guard from mod.rs to write.rs
Copilot dd487c2
fix: prevent SIGURG preemption live-lock by hooking write and reorder…
Copilot 56f1551
revert: rollback all scheduler.rs changes per reviewer feedback
Copilot b0d1948
reorder
loongs-zhang adf7498
fix: bypass all layers (io_uring/NIO) in WriteSyscallFacade for stdou…
Copilot 95378a2
code polish
loongs-zhang d0ff4dd
fix: add early bypass in write() dispatcher for stdout/stderr and rev…
Copilot 3b8cf28
clean code
loongs-zhang f2a219a
clean code
loongs-zhang 5ddf2ef
fix: conditionally reorder change_state for →Running to prevent live-…
Copilot 6ad23ff
fix: skip SIGURG preemption for Syscall-state coroutines to prevent d…
Copilot 0178f4e
fix: move Syscall guard from sigurg_handler to monitor_thread_main, c…
Copilot 38e9537
fix: replace logically-wrong contains() with two-phase snapshot appro…
Copilot 438c29e
perf: pre-allocate expired Vec outside monitor loop to avoid per-iter…
Copilot c62a624
enhance stability
loongs-zhang 6ac5bf1
enhance stability
loongs-zhang b364319
Merge branch 'master' into copilot/fix-coroutine-scheduler-bug
loongs-zhang 61c06af
fix: revert change_state conditional reorder and sigurg_handler Sysca…
Copilot 3b2f5d2
fix: restore sigurg_handler Syscall state check to match master, prev…
Copilot 570c679
fix: revert impl_facade!/WriteSyscallFacade reorder to match master —…
Copilot c2a87c9
less syscall
loongs-zhang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot The code looks very strange. Wouldn't everything be included in
notify_queue? Cause we arefor node in notify_queue.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 438c29e. Replaced the logically-wrong
contains()insidefor node in notify_queuewith a two-phase approach: first collect expired nodes into a pre-allocated snapshot Vec, then re-checknotify_queue.contains(node)against the live queue beforepthread_kill. Between the collection and the re-check,on_state_changedmay have removed the node (coroutine entered Syscall state), socontains()returns false and the signal is skipped.