← Back to issue list

elf: fixes for corrupt shared objects

View original Github issue

Metadata

Project
snapcraft
Number
#2929
Type
pull request
State
merged
Author
cjp256
Labels
—
Created
Updated
Closed

Current evaluation

Merged PR snapcore/snapcraft#2929 (commit 051f24e07, Feb 2020) catching elftools ConstructErrors as CorruptedElfFileError and skipping corrupt shared objects during library crawling.

Resolution: closed resolved

Reason: The PR was merged by maintainer cjp256 into master as commit 051f24e07. Its handling persists in the tree: snapcraft/elf/elf_utils.py catches errors.CorruptedElfFile while finding dependencies and emits a message before continuing, and the spread test tests/spread/general/invalid-elf asserts a successful prime with an 'Unable to parse ELF file' warning.

Evaluated by: mr-cal-bot

No scores available.

Issue body

elf: catch and chain elftools' ConstructErrors to CorruptedElfFileError elf: ignore corrupted elf files when crawling for libraries

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged PR snapcore/snapcraft#2929 (commit 051f24e07, Feb 2020) catching elftools ConstructErrors as CorruptedElfFileError and skipping corrupt shared objects during library crawling.
stealth/space-bunny-alpha — closed resolved Merged PR #2929 as commit 051f24e07, chaining elftools ConstructErrors to CorruptedElfFileError and skipping corrupt ELF files during library crawling.
qwen/qwen3.6-35b-a3b — — Merged to master. Resolves corrupt shared object handling by catching elftools ConstructErrors and skipping corrupted ELF files during library crawling. Approved, passed CI, and achieved 100% diff coverage.
qwen3.6-35b-a3b-mtp-q6 — — Merged into master. Updates ELF parsing to catch ConstructErrors and ignore corrupted files during library crawling. Achieved 100% diff coverage with negligible overall coverage impact.

Update history

No update history recorded yet.

Related work

  • Related To: snapcore/snapcraft#3839 (confidence 60%)

    Later refactor 'elf: add elf file handler class (#3839)' that still references ConstructError handling in the elf package.

Related issues

Issue Project State Summary Similarity
#2663 elf: handle invalid elf files snapcraft merged PR #2663 merged as commit 89490853e: snapcraft/elf/elf_utils.py now catches elftools ELFError (and CorruptedElfFile) during dependency scanning and silently skips invalid ELF files, with a regression test for LP #1838098.
79%
#2830 elf: properly handle corrupted ELF files snapcraft merged Merged #2830 as commit 727ffbdb0, making Snapcraft warn and continue when corrupted ELF files are encountered during priming.
78%
#2081 elf: patch everything instead of a subset of elf files snapcraft merged Merged PR #2081 restored Snapcraft 2.39 behavior by patching every ELF file; commit 77770452b partially reverted 64f78f762a05.
74%
#75 refactor: rewrite elf file support debcraft merged Merged as c841273, replacing Snapcraft-derived ELF handling with deb-oriented library dependency support. Symbol support was deferred to follow-up work.
73%
#1744 elf: conversion from libraries snapcraft merged Merged as ec7ba948a: converted snapcraft/internal/libraries.py into ELF-focused elf.py with type hints and mypy fixes, fixing #1666. Reviewer syntax/lint concerns were handled by follow-up PR #1745 (flake8 upgrade).
73%
#3514 elf: add fallback methods to detect library dependencies snapcraft merged Merged in snapcore/snapcraft#3514 (commit 76ca948c4): ELF dependency detection now falls back from ldd to host-libc6 preloading and loader tracing before warning.
73%
#3840 elf: add handling and patching helpers snapcraft merged Merged in snapcore/snapcraft#3840 via commit 8a9914510, adding helpers to enumerate ELF binaries and locate architecture-specific dynamic linkers.
72%
#3839 elf: add elf file handler class snapcraft merged PR #3839 was merged into main as commit 6830dc69c, porting the Snapcraft 6.x ElfFile handler into snapcraft/elf/_elf_file.py with helpers, ELF errors, and unit tests (CRAFT-1192).
72%
#3841 elf: add elf file patcher snapcraft merged Merged PR #3841 in commit e03a971b3, adding a patchelf-based ELF file patcher ported from Snapcraft 6.x for CRAFT-1191.
71%
#1935 elf: contemplate more patching scenarios snapcraft merged Merged PR #1935 as 048adc4a3, adding ELF patching for classic snaps built on bionic targeting core16 and for hooks built with Snapcraft.
71%