Draft
Conversation
Member
Author
|
@copilot Please check the C++ failures with this dispatcher! |
Contributor
3 tasks
…post-exit ThreadInfoHolder segfault (#165) * ... * Initial plan * Fix LuvDispatcher crash: use shutdownLoop instead of stopLoop before freeLoop The Ubuntu CI job failed with: uv__queue_done: Assertion `uv__has_active_reqs(req->loop)' failed. Root cause: the main thread freed the libuv loop (via freeLoop) while a worker thread was still executing uv__queue_done cleanup after its work callback. The old stopLoop/freeLoop sequence left async close callbacks and work-completion callbacks unprocessed. Fix: replace stopLoop(loop) with shutdownLoop(loop), which calls uv_walk (closes any remaining handles) then uv_run(UV_RUN_DEFAULT) to drain all pending callbacks (onAfter for work items, close callbacks for async handles) before the loop is freed. Calling stopLoop would set stop_flag=1, causing uv_run in shutdownLoop to exit immediately without processing callbacks, so it must be removed. Co-authored-by: Simn <634365+Simn@users.noreply.github.com> * Fix LuvDispatcher shutdown: use drainLoop (no uv_walk, no GCFreeZone) and blocking pool shutdown Co-authored-by: Simn <634365+Simn@users.noreply.github.com> * Revert Setup.hx to use shutdownLoop; keep pool.shutDown(true) fix Co-authored-by: Simn <634365+Simn@users.noreply.github.com> * install gdb * sudo * Fix LuvDispatcher crash: run work directly on loop thread, not via Work.queue Co-authored-by: Simn <634365+Simn@users.noreply.github.com> * Revert "Fix LuvDispatcher crash: run work directly on loop thread, not via Work.queue" This reverts commit 6178fd7. * manually shutdown libuv library on test completion --------- Co-authored-by: Simon Krajewski <simon@haxe.org> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Simn <634365+Simn@users.noreply.github.com> Co-authored-by: Aidan Lee <aidan.lee@evcam.com>
Simn
commented
Mar 1, 2026
| scheduler.shutDown(); | ||
| shutDownDispatcher(dispatcher); | ||
| cpp.luv.Luv.stopLoop(loop); | ||
| cpp.luv.Luv.shutdownLoop(loop); |
Member
Author
There was a problem hiding this comment.
I still think a stopLoop should be sufficient if we are diligent with our handles, but that's not very important right now.
Member
Author
|
Oh no, it segfaulted again... |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Let's finally find out what's with it!