snapcraft comes with an old version of pyelftools, some builds fail due to this
Metadata
Current evaluation
Fixed ELF prime-time crashes from non-ASCII section names in snapcore/snapcraft#2830; maintainers confirmed the fix shipped as part of Snapcraft 3.10.
Resolution: closed resolved
Reason: The issue was closed after snapcore/snapcraft#2830 provided the fix. A maintainer confirmed it was included in Snapcraft 3.10.
Evaluated by: mr-cal-bot
No scores available.
Issue body
The following snapcraft.yaml:
name: vcs
version: '2.0'
summary: VCS GUI
description: |
Maritime Robotics Vehicle Control System GUI
confinement: devmode
base: core18
layout:
/usr/lib/vcs-gui/plugins:
bind: $SNAP/usr/lib/vcs-gui/plugins
parts:
desktop-qt5:
source: https://download.qt.io/archive/qt/5.13/5.13.2/single/qt-everywhere-src-5.13.2.tar.xz
plugin: dump
override-build: |
snapcraftctl build
./configure -opensource -confirm-license -debug -nomake examples -nomake tests
make
make install
override-prime: |
locale-gen "en_US.UTF-8"
update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
snapcraftctl prime
build-packages:
- python
- locales
protobuf:
source: https://github.com/protocolbuffers/protobuf/releases/download/v3.8.0/protobuf-all-3.8.0.tar.gz
plugin: autotools
cmake:
source: https://github.com/Kitware/CMake/releases/download/v3.15.0-rc1/cmake-3.15.0-rc1.tar.gz
plugin: autotools
libproj:
source: http://download.osgeo.org/proj/proj-6.0.0.tar.gz
plugin: autotools
build-packages:
- libsqlite3-dev
- sqlite3
- libgl1-mesa-dev
- libglu1-mesa-dev
gdal:
source: https://github.com/OSGeo/gdal/releases/download/v3.0.0/gdal-3.0.0.tar.gz
plugin: autotools
after: [libproj]
ecc:
source: https://confluence.ecmwf.int/download/attachments/45757960/eccodes-2.12.5-Source.tar.gz
plugin: cmake
configflags: [-DENABLE_FORTRAN=OFF]
vcs:
plugin: cmake
configflags: [-DQt5Core_DIR=/usr/local/Qt-5.13.2/lib/cmake/Qt5Core,-DQt5_DIR=/usr/local/Qt-5.13.2/lib/cmake/Qt5,-DQT_QMAKE_EXECUTABLE=/usr/local/Qt-5.13.2/bin/qmake]
source: https://github.com/fritzone/Qt-CMake-HelloWorld.git
after: [protobuf,cmake,libproj,gdal,ecc,desktop-qt5]
build-packages:
- git
- g++
- make
- libkml-dev
- libarmadillo-dev
- libgeographic-dev
- libssl-dev
- libconfig++-dev
- libxml2-dev
- libmodbus-dev
- libev-dev
- libudev-dev
- libexiv2-dev
- libv4l-dev
- doxygen
- graphviz
- libgeotiff-dev
- libgeos-dev
- libpng-dev
- libbotan-2-dev
stage-packages:
- libbotan-2-4
- libtspi1
- libkmlconvenience1
- libkmlbase1
- libkmlengine1
- libkmldom1
- libssl1.0.0
- libconfig++9v5
- libxml2
- libmodbus5
- libev4
- libaec0
- libhdf4-0-alt
- libsz2
- libexiv2-14
- libv4l-0
- libgeotiff2
- libsdl2-2.0-0
- libxcb-xinerama0
- libarmadillo8
- libarpack2
- libsuperlu5
- libgeos-3.6.2
- libgeos-c1v5
apps:
vcs:
command: bin/desktop-launch bin/vcs
adapter: full
command-chain:
- bin/desktop-launch
- bin/vcs
common-id: vcs-gui.desktop
desktop: usr/share/applications/vcs-gui.desktop
environment:
"DISABLE_WAYLAND": "0"
plugs: [x11, wayland, desktop, desktop-legacy, opengl, network, home]
generates an error:
'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128)
We would appreciate it if you anonymously reported this issue.
No other data than the traceback and the version of snapcraft in use will be sent.
Would you like to send this error data? (Yes/No/Always/View) [no]: View
Traceback (most recent call last):
File "/snap/snapcraft/3440/bin/snapcraft", line 11, in <module>
load_entry_point('snapcraft==3.8', 'console_scripts', 'snapcraft')()
File "/snap/snapcraft/3440/lib/python3.5/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/snap/snapcraft/3440/lib/python3.5/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/snap/snapcraft/3440/lib/python3.5/site-packages/click/core.py", line 1114, in invoke
return Command.invoke(self, ctx)
File "/snap/snapcraft/3440/lib/python3.5/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/snap/snapcraft/3440/lib/python3.5/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/snap/snapcraft/3440/lib/python3.5/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/snap/snapcraft/3440/lib/python3.5/site-packages/snapcraft/cli/_runner.py", line 103, in run
snap_command.invoke(ctx)
File "/snap/snapcraft/3440/lib/python3.5/site-packages/snapcraft/cli/_command.py", line 87, in invoke
return super().invoke(ctx)
File "/snap/snapcraft/3440/lib/python3.5/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/snap/snapcraft/3440/lib/python3.5/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/snap/snapcraft/3440/lib/python3.5/site-packages/snapcraft/cli/lifecycle.py", line 261, in snap
_execute(steps.PRIME, parts=[], pack_project=True, output=output, **kwargs)
File "/snap/snapcraft/3440/lib/python3.5/site-packages/snapcraft/cli/lifecycle.py", line 66, in _execute
lifecycle.execute(step, project_config, parts)
File "/snap/snapcraft/3440/lib/python3.5/site-packages/snapcraft/internal/lifecycle/_runner.py", line 94, in execute
executor.run(step, part_names)
File "/snap/snapcraft/3440/lib/python3.5/site-packages/snapcraft/internal/lifecycle/_runner.py", line 148, in run
self._handle_step(part_names, part, step, current_step, cli_config)
File "/snap/snapcraft/3440/lib/python3.5/site-packages/snapcraft/internal/lifecycle/_runner.py", line 162, in _handle_step
getattr(self, "_run_{}".format(current_step.name))(part)
File "/snap/snapcraft/3440/lib/python3.5/site-packages/snapcraft/internal/lifecycle/_runner.py", line 237, in _run_prime
self._run_step(step=steps.PRIME, part=part, progress="Priming")
File "/snap/snapcraft/3440/lib/python3.5/site-packages/snapcraft/internal/lifecycle/_runner.py", line 281, in _run_step
getattr(part, step.name)()
File "/snap/snapcraft/3440/lib/python3.5/site-packages/snapcraft/internal/pluginhandler/__init__.py", line 795, in prime
self._do_runner_step(steps.PRIME)
File "/snap/snapcraft/3440/lib/python3.5/site-packages/snapcraft/internal/pluginhandler/__init__.py", line 242, in _do_runner_step
return getattr(self._runner, "{}".format(step.name))()
File "/snap/snapcraft/3440/lib/python3.5/site-packages/snapcraft/internal/pluginhandler/_runner.py", line 91, in prime
"override-prime", self._override_prime_scriptlet, self._primedir
File "/snap/snapcraft/3440/lib/python3.5/site-packages/snapcraft/internal/pluginhandler/_runner.py", line 137, in _run_scriptlet
scriptlet_name, function_call.strip()
File "/snap/snapcraft/3440/lib/python3.5/site-packages/snapcraft/internal/pluginhandler/_runner.py", line 193, in _handle_builtin_function
function(**function_args)
File "/snap/snapcraft/3440/lib/python3.5/site-packages/snapcraft/internal/pluginhandler/__init__.py", line 807, in _do_prime
dependency_paths = self._handle_elf(snap_files)
File "/snap/snapcraft/3440/lib/python3.5/site-packages/snapcraft/internal/pluginhandler/__init__.py", line 814, in _handle_elf
elf_files = elf.get_elf_files(self.primedir, snap_files)
File "/snap/snapcraft/3440/lib/python3.5/site-packages/snapcraft/internal/elf.py", line 576, in get_elf_files
elf_file = ElfFile(path=path)
File "/snap/snapcraft/3440/lib/python3.5/site-packages/snapcraft/internal/elf.py", line 219, in __init__
elf_data = self._extract(path)
File "/snap/snapcraft/3440/lib/python3.5/site-packages/snapcraft/internal/elf.py", line 252, in _extract
interp_section = elf.get_section_by_name(_INTERP)
File "/snap/snapcraft/3440/lib/python3.5/site-packages/elftools/elf/elffile.py", line 94, in get_section_by_name
for i, sec in enumerate(self.iter_sections()):
File "/snap/snapcraft/3440/lib/python3.5/site-packages/elftools/elf/elffile.py", line 103, in iter_sections
yield self.get_section(i)
File "/snap/snapcraft/3440/lib/python3.5/site-packages/elftools/elf/elffile.py", line 83, in get_section
return self._make_section(section_header)
File "/snap/snapcraft/3440/lib/python3.5/site-packages/elftools/elf/elffile.py", line 288, in _make_section
name = self._get_section_name(section_header)
File "/snap/snapcraft/3440/lib/python3.5/site-packages/elftools/elf/elffile.py", line 283, in _get_section_name
return self._file_stringtable_section.get_string(name_offset)
File "/snap/snapcraft/3440/lib/python3.5/site-packages/elftools/elf/sections.py", line 70, in get_string
return s.decode('ascii')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128)
We would appreciate it if you anonymously reported this issue.
due to not using the latest version of pyelftools in the snapcraft package.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Fixed ELF prime-time crashes from non-ASCII section names in snapcore/snapcraft#2830; maintainers confirmed the fix shipped as part of Snapcraft 3.10. | |
| stealth/space-bunny-alpha | — | closed resolved | Snapcraft 3.10 fixed the priming crash by handling corrupted ELF files in merged PR #2830 (commit 727ffbdb0) instead of propagating pyelftools' UnicodeDecodeError. | |
| stealth/space-bunny-alpha | — | closed stale | Closed without a confirmed pyelftools fix after 84 days of inactivity. Later ELF corruption handling in canonical/snapcraft#2929 addressed related failures but was not linked to its closure. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without direct resolution. Likely abandoned or superseded by newer snapcraft releases that updated pyelftools, resolving the UnicodeDecodeError during ELF parsing. No comments or patches were submitted. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution. The issue stemmed from an outdated pyelftools dependency triggering a Unicode decode error during ELF parsing. No patch was applied, leaving the snap build failure unresolved. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed by updating the bundled pyelftools dependency to a version that correctly handles non-ASCII ELF section names, resolving the UnicodeDecodeError during the prime step. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed without comments or a documented fix. The outdated pyelftools dependency causing ELF parsing failures was likely abandoned or resolved by upstream updates. |
Update history
| Date | Change |
|---|---|
| created |
Related work
-
Likely Fixed By:
snapcore/snapcraft#2830
(confidence 99%)
The issue comments identify PR #2830 as the fix and confirm its inclusion in Snapcraft 3.10.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1838098 snapcraft prime fails if it finds an invalid ELF file | snapcraft (launchpad) | closed | Snapcraft now skips invalid ELF files during priming; PR #2663 was merged in commit 89490853e. | |
| #1746397 snapcraft from edge fails building dotnet snaps because of readelf | snapcraft (launchpad) | closed | Fixed by snapcore/snapcraft PR #1901 (commit 592206be6), which skips ELF inspection for missing files and prevents readelf failures on dangling links. | |
| #1913 elf: pyelftools to parse ELF files rather than readelf | snapcraft | merged | Merged PR #1913 (commit 9e4e88629): snapcraft.internal.elf.ElfFile now parses ELF files with pyelftools instead of shelling out to readelf, handling weak refs outside DT_NEEDED; cut test build times roughly in half. | |
| #1879519 Crash when parsing ELF file with symbols on armhf | snapcraft (launchpad) | closed | Fixed by snapcore/snapcraft PR #3149; the reporter confirmed that snapcraft revision 4857 resolved the armhf ELF-symbol parsing crash. |