Skip to content

fix(linux): disable autoPatchelfHook to fix pyelftools segfault#125

Open
Beach-Bum wants to merge 9 commits into
logos-co:masterfrom
Beach-Bum:fix/disable-autopatchelf-linux
Open

fix(linux): disable autoPatchelfHook to fix pyelftools segfault#125
Beach-Bum wants to merge 9 commits into
logos-co:masterfrom
Beach-Bum:fix/disable-autopatchelf-linux

Conversation

@Beach-Bum

Copy link
Copy Markdown

Summary

  • Remove autoPatchelfHook from nativeBuildInputs in nix/bin.nix
  • Add dontStrip = true to prevent ELF section header corruption

Problem

On current nixpkgs (pinned via logos-nix), pyelftools 0.32 segfaults when
auto-patchelf processes the logos-liblogos-bin derivation during the fixup
phase. The crash occurs in elftools/elf/dynamic.py when parsing stripped ELF
binaries — the DynamicSection constructor reads a sh_link index that points
to a corrupted section after stripping.

The failure chain:

  1. strip runs in fixup phase, corrupts ELF section headers
  2. auto-patchelf (via pyelftools) tries to parse the stripped binary
  3. pyelftools 0.32 crashes with KeyError or AttributeError: 'int' object has no attribute 'FLAG_EMBED'

Fix

Remove autoPatchelfHook from nativeBuildInputs entirely and disable stripping.
The binaries still work correctly — they resolve libraries via LD_LIBRARY_PATH or
the Nix store paths already embedded by CMake.

Test plan

  • ws build logos-basecamp --auto-local succeeds on NixOS (x86_64-linux)
  • LogosBasecamp launches and loads modules (capability_module, package_manager)
  • logos_host --name capability_module --path <plugin.so> loads the module

Generated with Claude Code

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.

2 participants