Repository navigation
Suppress the fork-orphaned IoLoop thread block in nightly Valgrind - #1121
Merged
Merged
Conversation
…t reach The registration-phase test forks the test process. The child inherits the heap but only the forking thread, so the state block of a std::thread that a long-lived IoLoop (the shared TimeoutScheduler in test_chat_origin) still owns at the fork is referenced from nowhere in the child and Valgrind reports it definitely lost at the child's _exit. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01No1Nzo5wbYPDDynGBphgqj
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.
#1093 Valgrind memcheck
Root cause (reproduced the mechanism locally, not the CI classification). The three failing processes are not the test suite itself: they are the
fork()children oftests/test_registration_phase.cpp(runRegistrarInChild), one per "control" case, and the child's_exittriggers a leak check. A child inherits the parent's heap but only the forking thread. Earlier in the runtest_chat_origin.cpphad created a staticTimeoutSchedulerwhoseIoLoopthread is still running; the 24-bytestd::threadstate block it owns is referenced only from that thread's stack, which the child does not have. Nothing in the child can reach it, so Valgrind 3.22 (CI) reports it definitely lost. The library does not leak: in the parent the thread frees the block, and a run of the chat-origin tests alone and of all[chat]tests under the CI flags is clean (0 bytes in use at exit).Fix. A suppression in
cmake/valgrind.supp, narrowed to the three-frame stackoperator new/std::thread::thread<...IoLoop...>/IoLoop::IoLoop, with the reasoning in a comment. Frames are matched by mangled name (demangled patterns did not match; verified).Evidence.
--order lexof the chat-origin test plus[registration-phase]forks six children; in each, the same stack and 24-byte block exists (classified "still reachable" locally by Valgrind 3.25.1, "definitely lost" on CI's 3.22).definite,reachable,-sreportsused_suppression: 1 ioloop_thread_state_orphaned_by_fork ... suppressed: 24 bytes in 1 blocksin each of the six children. So the frames match the block. The suppression as committed (definiteonly) is therefore expected to silence CI's report.Not verified. I could not reproduce the "definitely lost" classification here (Arch host, Valgrind 3.25.1; needed
DEBUGINFOD_URLSfor ld.so symbols), so the before/after on the committed suppression is inferred from the widened control, not observed on 3.22. I did not run the whole suite under Valgrind (15-60 min).#1089 all optional features: no change
On current master (4e99bac), gcc-debug with NET, QT, QT_QUICK, LADDER=all and EXAMPLES on, built target
lims_gallery_render_smokeand ran it withQT_QPA_PLATFORM=offscreen:(no
needs N pxmessage). The nightly ran on 2f2b4a0, before #1112, which changedsrc/qt_quick/table.cpp,widget.cppand others. This is not a fix of mine and not proof it is fixed in CI: the nightly uses Qt 6.8.1 and clang+gcc, the local run used the system Qt on gcc only, and row heights depend on font metrics. So #1089 is not closed here; the next nightly on master decides.Review (inline): the only change is a suppression entry; it matches only definite leaks with an IoLoop thread-state allocation stack.
Closes #1093
🤖 Generated with Claude Code
https://claude.ai/code/session_01No1Nzo5wbYPDDynGBphgqj