Skip to content

fix crash on functions missing a gprof call graph entry - #118

Open
nvxbug wants to merge 1 commit into
jrfonseca:mainfrom
nvxbug:gprof-missing-callgraph-entry
Open

nvxbug wants to merge 1 commit into
jrfonseca:mainfrom
nvxbug:gprof-missing-callgraph-entry

Conversation

@nvxbug

@nvxbug nvxbug commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

gprof can list a function that its static call graph analysis discovered but that never got its own call graph entry. When GprofParser.parse meets one of those as a child it builds a placeholder Function, but writes the self time and call count onto the caller (function[TIME], function.called) instead of the placeholder, so the caller's real numbers are wiped and the placeholder goes in with no TIME event. profile.ratio(TIME_RATIO, TIME) then trips its assert on that placeholder and the whole run dies; AXEParser.parse holds a copy of the same code with the same misassignment.

Point both assignments at the placeholder (missing) so it carries the events it needs and the caller keeps its own. AXE functions also hold a total-time ratio, so the placeholder there gets TOTAL_TIME_RATIO too, which the later call-weight pass reads. The branch only runs for functions with no entry, so profiles that never reach it come out unchanged.

@codecov

codecov Bot commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.34%. Comparing base (5cbab29) to head (00ebcd4).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #118      +/-   ##
==========================================
+ Coverage   86.03%   86.34%   +0.30%     
==========================================
  Files           1        1              
  Lines        2342     2343       +1     
==========================================
+ Hits         2015     2023       +8     
+ Misses        327      320       -7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nvxbug

nvxbug commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

any update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant