Skip to content

Use elfutils to generate stack traces on linux#2027

Open
Igigog wants to merge 1 commit intoOpenXRay:devfrom
Igigog:dev2
Open

Use elfutils to generate stack traces on linux#2027
Igigog wants to merge 1 commit intoOpenXRay:devfrom
Igigog:dev2

Conversation

@Igigog
Copy link
Contributor

@Igigog Igigog commented Jan 1, 2026

This changes the way engine stack traces are captured on Linux. Here's the comparison (commit f70e397, build type: Debug):

Before:
image

After:
Screenshot From 2026-01-01 15-35-15

A few important things:

  • These color codes are printed to the log file as a mess of escape characters, though you can filter them out manually afterwards. I think that's fine, given that they help a lot and it's only the case on Linux.
  • We'll need to update Wiki page to add new dependency. It's elfutils-dev on Alpine, libdw-dev on Ubuntu and elfutils-devel on Fedora (when in doubt, check CI file)

@Xottab-DUTY
Copy link
Member

I think introducing new low-level dependency is suboptimal.
Could you make it optional and not include it into CI builds?

Talking about desired future changes, it's waay better to use https://github.com/jeremy-rifkin/libassert. Under the hood it uses https://github.com/jeremy-rifkin/cpptrace which supports generating stack traces using several backends, so we don't need to support the code ourselves.
Could you research if we can use cpptrace directly?
I also can't find any elfutils usage in cpp trace, so maybe we can send a PR with new backend support (I'm not sure if it's needed).

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

Projects

Status: To do

Development

Successfully merging this pull request may close these issues.

2 participants