Repository navigation
proccontrol: restore the tinfo entry that makes pc_irpc post its IRPCs - #280
Conversation
runIRPCs() posts IRPCs by iterating the global tinfo map, and re-posts from that same map in the post_sequential path. tinfo is cleared at the top of every runIRPCs() call, so an entry has to be created for each user thread before the posting loop runs. PR #258 removed thread_info_t &t = tinfo[thr]; from the IRPC-creation loop as an unused variable. The variable was indeed unused, but the initializer was not: std::map::operator[] default-constructs and inserts the entry. Without it tinfo stays empty, the posting loop body never executes, and no IRPC is ever posted. runIRPCs() then spins forever in its wait loop -- has_pending_irpcs() is false because nothing was posted, while all_irpcs_completed() is false because the rpc_data_t objects exist in pinfo and none of them ever completes -- so while (!myerror) never exits. pc_irpc therefore hung on the first of its 64 configurations on every platform, producing no result rows at all. Verified on coriander (x86_64): 32/32 variants PASSED, 2048 configurations exercised, where before the test emitted a single "Running:" line and then spun. Create the entry explicitly with emplace(), after the isUser() check so that system threads stay out of tinfo (the post_sequential re-post loop iterates tinfo without an isUser() check of its own). Being a statement whose only purpose is the insertion, it can no longer be mistaken for a dead local. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ppc64le result: big improvement, but not a clean pass — separate pre-existing problems surfacePOWER9, Ubuntu 20.04, system gcc, dyninst master
So the fix does what it claims here too: the test gets off the ground instead of spinning on But ppc64le does not finish the matrix: Both failures are multithreaded create variants, and they fail before the test body runs: There are no I do not think these belong to this change. They were unreachable before it: with Summary of verification across the three architectures:
Happy to open a separate issue for the ppc64le multithreaded-create failure if that is 🤖 Generated with Claude Code |
The rest of it described the bug being fixed rather than the code, which is not useful once the fix is in place. That explanation lives in the commit message of the preceding commit, where it belongs. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Problem
pc_irpcnever completes. It hangs on the first of its 64 configurations and produceszero result rows, so it contributes no coverage on any platform. In isolated per-test
runs of current master it is recorded as HUNG on x86_64, aarch64 and ppc64le alike — it was
the one test hung on all four of our lab machines.
Root cause
runIRPCs()posts IRPCs by iterating the globaltinfomap:tinfois cleared at the top of everyrunIRPCs()call, so an entry has to be created foreach user thread before that loop runs. #258 removed the line that did it, from the
IRPC-creation loop:
Thread::ptr thr = *j; - thread_info_t &t = tinfo[thr]; if(!thr->isUser())The variable
twas genuinely unused and the warning was correct, but the initializer wasnot dead:
std::map::operator[]default-constructs and inserts the entry. With the linegone
tinfostays empty, the posting loop body never executes, and no IRPC is ever posted.runIRPCs()then cannot terminate:has_pending_irpcs()is false, because it only reports RPCs withposted && !completedand nothing was posted;
all_irpcs_completed()is false, because therpc_data_tobjects were created inpinfoand none of them ever completes;
while (has_pending_irpcs())is skipped, thebreakis never taken, thepost_sequentialre-post loop iterates the same emptytinfo, and the outerwhile (!myerror)spins on the CPU forever.Observed directly under gdb: the driver's main thread sits in
has_pending_irpcs()(
pc_irpc.C:117, called fromrunIRPCsat line 399) in stateR, while the mutatee isstopped under ptrace.
Fix
Create the entry explicitly, after the
isUser()check so that system threads stay out oftinfo— thepost_sequentialre-post loop iteratestinfowithout anisUser()check ofits own, which is what the checks added in 76402cb were meant to prevent. Being a statement
whose only purpose is the insertion, it can no longer be mistaken for a dead local.
Verification
Isolated runs (
test_driver -test pc_irpc -all) against dyninst master7e53b6c88:zero bad reps.
configurations exercised), but does not finish the matrix — the multithreaded create
variants fail in Group Setup and a later one still hangs. Details in the comment below.
Those failures were unreachable before this change and look like the platform's known
proccontrol thread-create weakness, not something this patch introduces.
On x86_64 and aarch64 all 32 variants pass: g++ and gcc, create and attach,
SPST/MPST/SPMT/MPMT, dynamic and static linkage. Only
pc_irpc.Cchanges, so no other testis affected.
🤖 Generated with Claude Code