Skip to content

fix: gracefully locate python ELF when core executable is a script (e.g. shebang) - #364

Closed
Gracy769 wants to merge 1 commit into
bloomberg:mainfrom
Gracy769:fix-core-shebang
Closed

Gracy769 wants to merge 1 commit into
bloomberg:mainfrom
Gracy769:fix-core-shebang

Conversation

@Gracy769

Copy link
Copy Markdown

Fixes #187

When a core file is generated from a Python script executed directly via a shebang, \extract_executable()\ returns the path to the script (which is not an ELF file). Previously, Pystack would only check the first map with a path to see if it was an ELF. If it wasn't, Pystack failed with \InvalidExecutable.

This PR iterates through the maps to find the first map that is a valid ELF file, successfully locating the underlying python interpreter.

Copilot AI lite review requested due to automatic review settings September 22, 2026 15:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@godlygeek

Copy link
Copy Markdown
Contributor

#187 was no longer a valid issue; it looks like the problem being reported there was fixed long ago and we missed closing the issue. This PR would only change the behavior if the executable is some mapping other than the first one, but I don't believe that's possible - and even if it was, choosing an arbitrary different mapping would certainly not be the right fix; that might just select a shared library rather than the executable.

@godlygeek godlygeek closed this Sep 22, 2026
@Gracy769
Gracy769 deleted the fix-core-shebang branch September 22, 2026 16:58
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.

Analyzing core files generated from Python files with shebang

3 participants