fix(linux): disable autoPatchelfHook to fix pyelftools segfault#125
Open
Beach-Bum wants to merge 9 commits into
Open
fix(linux): disable autoPatchelfHook to fix pyelftools segfault#125Beach-Bum wants to merge 9 commits into
Beach-Bum wants to merge 9 commits into
Conversation
Local-only fix, not pushed upstream.
This was referenced May 6, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
autoPatchelfHookfromnativeBuildInputsinnix/bin.nixdontStrip = trueto prevent ELF section header corruptionProblem
On current nixpkgs (pinned via logos-nix),
pyelftools 0.32segfaults whenauto-patchelfprocesses thelogos-liblogos-binderivation during the fixupphase. The crash occurs in
elftools/elf/dynamic.pywhen parsing stripped ELFbinaries — the
DynamicSectionconstructor reads ash_linkindex that pointsto a corrupted section after stripping.
The failure chain:
stripruns in fixup phase, corrupts ELF section headersauto-patchelf(via pyelftools) tries to parse the stripped binaryKeyErrororAttributeError: 'int' object has no attribute 'FLAG_EMBED'Fix
Remove
autoPatchelfHookfromnativeBuildInputsentirely and disable stripping.The binaries still work correctly — they resolve libraries via
LD_LIBRARY_PATHorthe Nix store paths already embedded by CMake.
Test plan
ws build logos-basecamp --auto-localsucceeds on NixOS (x86_64-linux)LogosBasecamplaunches and loads modules (capability_module, package_manager)logos_host --name capability_module --path <plugin.so>loads the moduleGenerated with Claude Code