Skip to content

elfehframe: dynamically detect entry stub#573

Merged
fabled merged 4 commits intoopen-telemetry:mainfrom
fabled:musl-amd64-entry
Jul 2, 2025
Merged

elfehframe: dynamically detect entry stub#573
fabled merged 4 commits intoopen-telemetry:mainfrom
fabled:musl-amd64-entry

Conversation

@fabled
Copy link
Copy Markdown
Contributor

@fabled fabled commented Jul 1, 2025

Earlier we synthesized STOP delta for FDE ending at the entry point. This does not work reliably: 1. in some cases there is no FDE preceding the entry point and 2. often the musl entry code's second portion of code immediately following the CALL which has an FDE that will invalidate the STOP delta.

To better handle the situation this will dynamically match the entry code against known stubs when needed and mark the whole stub with STOP overriding any FDEs.

@fabled fabled force-pushed the musl-amd64-entry branch 2 times, most recently from 8508db2 to c4bde22 Compare July 1, 2025 16:04
@fabled fabled changed the title elfehframe: better detection for musl entry stub on amd64 elfehframe: dynamically detect entry stub Jul 1, 2025
@fabled fabled force-pushed the musl-amd64-entry branch 2 times, most recently from 93f4eea to 469ecb5 Compare July 1, 2025 17:22
Earlier we synthesized STOP delta for FDE ending at the entry
point. This does not work reliably: 1. in some cases there is
no FDE preceding the entry point and 2. often the musl entry
code's second portion of code immediately following the CALL
which has an FDE that will invalidate the STOP delta.

To better handle the situation this will dynamically match
the entry code against known stubs when needed and mark the whole
stub with STOP overriding any FDEs.
@fabled fabled force-pushed the musl-amd64-entry branch from 469ecb5 to c798010 Compare July 1, 2025 17:33
@fabled fabled marked this pull request as ready for review July 1, 2025 17:42
@fabled fabled requested review from a team as code owners July 1, 2025 17:42
Copy link
Copy Markdown
Member

@christos68k christos68k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread nativeunwind/elfunwindinfo/elfehframe_aarch64.go Outdated
Comment thread nativeunwind/elfunwindinfo/elfehframe_aarch64.go Outdated
Comment thread nativeunwind/elfunwindinfo/stackdeltaextraction.go Outdated
Copy link
Copy Markdown
Member

@florianl florianl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great to see these error frame gone 😅

Comment thread nativeunwind/elfunwindinfo/elfehframe_x86.go Outdated
Comment thread nativeunwind/elfunwindinfo/elfehframe_aarch64.go Outdated
@fabled fabled requested a review from florianl July 2, 2025 08:22
Copy link
Copy Markdown
Member

@florianl florianl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the update 🙏

@fabled fabled merged commit 3c82c64 into open-telemetry:main Jul 2, 2025
27 checks passed
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.

3 participants