Branch: refs/heads/bbiiggppiigg/getgaprange-fix-v2
Home: https://github.com/dyninst/dyninst
Commit: a46985f17112beb0309e8a4a855b62d5fa200623
https://github.com/dyninst/dyninst/commit/a46985f17112beb0309e8a4a855b62d5fa200623
Author: wuxx1279 <bbiiggppiigg@xxxxxxxxx>
Date: 2026-06-20 (Sat, 20 Jun 2026)
Changed paths:
M parseAPI/src/Parser-speculative.C
M parseAPI/src/Parser.h
Log Message:
-----------
parseAPI: fix getGapRange via start-ordered extent index (replaces funcsByRange)
The #2290 optimization made getGapRange query region_data::funcsByRange. That
tree's IBSTree_fast::successor is keyed by interval high(), so for overlapping /
identical-code-folded extents it returns the smallest-high() extent rather than
the smallest start() strictly greater than curAddr that the gap algorithm needs.
On an ICF-heavy binary the two differ deterministically: gapEnd is set too far,
the scanner walks into already-parsed code, spuriously re-parses inside a live
function, and corrupts the CFG -- surfacing later as
liveness.C: Assertion `blockLiveInfo.find(block) != blockLiveInfo.end()'
during relocation. (Under threads this looked intermittent -- 6/10 -- because
the parallel parse fed getGapRange different extent orderings; with
OMP_NUM_THREADS=1 it fails 10/10.) The earlier successor(curAddr)->successor(
gapStart) patch could not fix this: IBSTree_fast::successor is inherently
high()-keyed and offers no "smallest start > X" query.
Restore the exact pre-#2290 semantics while keeping the speedup: getGapRange now
takes a start-ordered std::set<pair<start,end>> and does upper_bound on it --
byte-identical to the original logic. probabilistic_gap_parsing builds that set
ONCE from sorted_funcs and folds in gap-discovered functions after each parse_at,
instead of the original's per-call O(F) rebuild. Total O(F + gaps*log F). The gap
path no longer touches funcsByRange (and no longer calls finalize_ranges() from
inside getGapRange); funcs_to_ranges is drained up front and after each discovery
on the single-threaded gap loop, keeping funcsByRange current for other consumers.
Co-Authored-By: Claude Opus 4.8 <noreply@xxxxxxxxxxxxx>
To unsubscribe from these emails, change your notification settings at https://github.com/dyninst/dyninst/settings/notifications
|