Skip to content

[seekdb][lib] Fix lbt addr2line for non-PIE executables#931

Open
hnwyllmm wants to merge 2 commits into
masterfrom
task/2026062400116954150
Open

[seekdb][lib] Fix lbt addr2line for non-PIE executables#931
hnwyllmm wants to merge 2 commits into
masterfrom
task/2026062400116954150

Conversation

@hnwyllmm

Copy link
Copy Markdown
Member

Task Description

Fix the lbt utility's address calculation so that stack trace addresses printed in logs can be correctly resolved using addr2line when the seekdb executable is built with -no-pie (disabling Position Independent Executables).

Solution Description

Previously, lbt always subtracted the process load base address, assuming the executable was a PIE (ET_DYN type). When built with -no-pie, the executable type becomes ET_EXEC. The fix detects the executable type by reading the ELF header from /proc/self/exe during initialization. For ET_EXEC (non-PIE) executables, the raw backtrace addresses are printed without modification. For ET_DYN (PIE) executables, the load bias is still subtracted as before to produce addresses usable by addr2line.

Passed Regressions

  • Rebuilt seekdb and verified lbt output addresses resolve correctly via addr2line -pCfe ./bin/seekdb <addrs> on a running process (tested with gdb).

Upgrade Compatibility

No impact.

Other Information

  • Fixed branch: master
  • Workaround for old builds: Manually add back the load base address when using addr2line.
  • Internal reference: DIMA-2026062400116954150
  • Development branch: task/2026062400116954150

Release Note

Fix: The lbt utility now correctly prints stack trace addresses for addr2line resolution when seekdb is built with the -no-pie compiler flag.

@hnwyllmm

Copy link
Copy Markdown
Member Author

The mapping Dima issue is a stack address error.

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