Skip to content

fix(executor): filter debug-section labels from SymbolTable#801

Open
Oppen wants to merge 1 commit into
mainfrom
fix/symbol_table_confusions
Open

fix(executor): filter debug-section labels from SymbolTable#801
Oppen wants to merge 1 commit into
mainfrom
fix/symbol_table_confusions

Conversation

@Oppen

@Oppen Oppen commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • SymbolTable::try_parse ignored st_shndx, letting debug-section local labels (.L0, .Lline_table_start*) in as fake functions
  • these alias real .text addresses (assembler local-label reuse), so profiler lookups tied to a real symbol resolved to whichever entry sorted last
  • reject symbols outside SHF_ALLOC sections and names starting with .

Illustration (recursion single-query profile, top functions by cycle count)

Before:

rank      cycles        %  function
   1   5200919000   99.37%  .L0
   2     12916576    0.25%  block_buffer::BlockBuffer<...>::digest_blocks::<...Keccak256Core...>
   3      5377972    0.10%  compiler_builtins::mem::memcpy
   4      5377972    0.10%  memcpy
   5      1576597    0.03%  memset

After:

rank      cycles        %  function
   1   3448394124   65.89%  keccak::keccak_p::<u64>
   2    433623582    8.29%  math::fft::bowers_fft::process_triple_fused_block::<...>
   3    317752655    6.07%  <sha3::Keccak256Core as digest::core_api::FixedOutputCore>::finalize_fixed_core
   4    238753357    4.56%  compiler_builtins::mem::memcpy
   5    219807702    4.20%  math::fft::bowers_fft::process_ifft_triple_fused_block::<...>

Test plan

  • make test-profile-recursion-single — real functions now appear instead of .L0
  • make lint
  • make test — all pass except the 2 expected GPU test failures (no CUDA lib on this host)

SymbolTable::try_parse ignored st_shndx, so debug-section local
labels (.L0, .Lline_table_start*) leaked in as fake functions and
collided with real symbols sharing the same address, misattributing
profiler cycles to whichever symbol sorted last in the tie.

Reject symbols outside SHF_ALLOC sections and names starting with
'.', restricting resolution to real .text function symbols.
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