gpu linter on core26: elftools crashes on loading guile pre-compiled .go files
Metadata
Current evaluation
GPU linter crashes with AssertionError when parsing Guile .go ELF files due to missing string table in dynamic section.
Suggested action: keep open
Reason: Valid bug where the GPU linter crashes on Guile .go ELF files due to an unhandled AssertionError from pyelftools. The issue provides a clear reproducer and stack trace pointing to elf_utils.py. The fix involves catching the exception gracefully, similar to existing ELFError handling. No evidence of a fix in recent commits.
Evaluated by: mr-cal-bot
Impact:
40
Quick Win:
27
Complexity:
20
Confidence:
85
Actionability:
85
Issue body
### Check existing issues
- [x] I've verified that this bug isn't described by any existing issues.
### Bug description
While packing a snap containing Guile’s precompiled .go files, Snapcraft crashes in the GPU linter while parsing the ELF dynamic section. The build fails with an internal AssertionError instead of completing linting or reporting an issue.
The file that triggered the crash was the pre-compiled `report.go` in the gnucash project, but any `.go` object should be able to trigger this crash.
See more details in the log below, but my current assessment is that this is triggered by the `<unknown>` dynamic tags in guile pre-compiled ELF objects.
```
$ readelf -d report.go
Dynamic section at offset 0x35a0 contains 7 entries:
Tag Type Name/Value
0x0000000037146003 (<unknown>: 37146003) 0x3000007
0x0000000037146002 (<unknown>: 37146002) 0xe8
0x0000000037146000 (<unknown>: 37146000) 0x10000
0x0000000037146001 (<unknown>: 37146001) 0x13f8
0x000000000000000c (INIT) 0x1a30
0x0000000037146004 (<unknown>: 37146004) 0x31e8
0x0000000000000000 (NULL) 0x0
```
### Steps to reproduce
1. Include a Guile .go file with the dynamic tags shown below in the snap’s primed files.
2. Run snapcraft pack.
### Environment
snapcraft: 9.2.1
ubuntu 26.04
core26
### snapcraft.yaml
Not specific to this project, but if there's trouble obtaining a guile `.go` file, you can reproduce by building this snapcraft.yaml:
https://github.com/lunacd/gnucash-snap/blob/2b0ef9006b600ed84efce922f6b5a20063adbcb7/snap/snapcraft.yaml
### Log output
```shell
:: 2026-10-28 21:04:22.565 Packing...
:: 2026-10-28 21:04:22.571 Reading snap metadata...
:: 2026-10-28 21:04:22.574 Running linters...
:: 2026-10-28 21:04:22.574 Running linter: classic
:: 2026-10-28 21:04:22.575 Running linter: gpu
:: 2026-10-28 21:04:22.615 Extracting ELF attributes: 'usr/bin/fc-pattern'
...
:: 2026-10-28 21:04:22.927 Extracting ELF attributes: 'usr/lib/x86_64-linux-gnu/guile/3.0/bin/guile'
:: 2026-10-28 21:04:22.929 Extracting ELF attributes: 'usr/lib/x86_64-linux-gnu/guile/3.0/site-ccache/gnucash/report.go'
:: 2026-10-28 21:04:22.929 snapcraft internal error: AssertionError()
:: 2026-10-28 21:04:22.935 Traceback (most recent call last):
:: 2026-10-28 21:04:22.935 File "/snap/snapcraft/19387/lib/python3.12/site-packages/craft_application/application.py", line 575, in run
:: 2026-10-28 21:04:22.935 return_code = self._run_inner()
:: 2026-10-28 21:04:22.935 ^^^^^^^^^^^^^^^^^
:: 2026-10-28 21:04:22.935 File "/snap/snapcraft/19387/lib/python3.12/site-packages/snapcraft/application.py", line 182, in _run_inner
:: 2026-10-28 21:04:22.935 return_code = super()._run_inner()
:: 2026-10-28 21:04:22.935 ^^^^^^^^^^^^^^^^^^^^
:: 2026-10-28 21:04:22.935 File "/snap/snapcraft/19387/lib/python3.12/site-packages/craft_application/application.py", line 560, in _run_inner
:: 2026-10-28 21:04:22.935 dispatcher_return = dispatcher.run()
:: 2026-10-28 21:04:22.935 ^^^^^^^^^^^^^^^^
:: 2026-10-28 21:04:22.935 File "/snap/snapcraft/19387/lib/python3.12/site-packages/craft_cli/dispatcher.py", line 576, in run
:: 2026-10-28 21:04:22.935 return self._loaded_command.run(self._parsed_command_args)
:: 2026-10-28 21:04:22.935 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
:: 2026-10-28 21:04:22.935 File "/snap/snapcraft/19387/lib/python3.12/site-packages/craft_application/commands/base.py", line 180, in run
:: 2026-10-28 21:04:22.935 result = self._run(parsed_args, **kwargs) or result
:: 2026-10-28 21:04:22.935 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
:: 2026-10-28 21:04:22.935 File "/snap/snapcraft/19387/lib/python3.12/site-packages/snapcraft/commands/lifecycle.py", line 211, in _run
:: 2026-10-28 21:04:22.935 super()._run(parsed_args)
:: 2026-10-28 21:04:22.935 File "/snap/snapcraft/19387/lib/python3.12/site-packages/craft_application/commands/lifecycle.py", line 646, in _run
:: 2026-10-28 21:04:22.935 return self._run_real(parsed_args=parsed_args, step_name=step_name)
:: 2026-10-28 21:04:22.935 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
:: 2026-10-28 21:04:22.935 File "/snap/snapcraft/19387/lib/python3.12/site-packages/craft_application/commands/lifecycle.py", line 481, in _run_real
:: 2026-10-28 21:04:22.935 self._run_pack(parsed_args, shell_after=shell_after, debug=debug)
:: 2026-10-28 21:04:22.935 File "/snap/snapcraft/19387/lib/python3.12/site-packages/craft_application/commands/lifecycle.py", line 541, in _run_pack
:: 2026-10-28 21:04:22.935 packed = package_service.pack_artifacts()
:: 2026-10-28 21:04:22.935 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
:: 2026-10-28 21:04:22.935 File "/snap/snapcraft/19387/lib/python3.12/site-packages/craft_application/services/package.py", line 322, in pack_artifacts
:: 2026-10-28 21:04:22.935 self._pack(name=name, path=path)
:: 2026-10-28 21:04:22.935 File "/snap/snapcraft/19387/lib/python3.12/site-packages/snapcraft/services/package.py", line 483, in _pack
:: 2026-10-28 21:04:22.935 self._run_lint_checks(self._services.lifecycle.prime_dir)
:: 2026-10-28 21:04:22.935 File "/snap/snapcraft/19387/lib/python3.12/site-packages/snapcraft/services/package.py", line 456, in _run_lint_checks
:: 2026-10-28 21:04:22.935 issues = linters.run_linters(prime_dir, lint=self._project.lint)
:: 2026-10-28 21:04:22.935 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
:: 2026-10-28 21:04:22.935 File "/snap/snapcraft/19387/lib/python3.12/site-packages/snapcraft/linters/linters.py", line 170, in run_linters
:: 2026-10-28 21:04:22.935 issues = linter.run()
:: 2026-10-28 21:04:22.935 ^^^^^^^^^^^^
:: 2026-10-28 21:04:22.935 File "/snap/snapcraft/19387/lib/python3.12/site-packages/snapcraft/linters/gpu_linter.py", line 97, in run
:: 2026-10-28 21:04:22.935 elf_files = elf_utils.get_elf_files(current_path)
:: 2026-10-28 21:04:22.935 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
:: 2026-10-28 21:04:22.935 File "/snap/snapcraft/19387/lib/python3.12/site-packages/snapcraft/elf/elf_utils.py", line 50, in get_elf_files
:: 2026-10-28 21:04:22.935 return get_elf_files_from_list(root_path, file_list)
:: 2026-10-28 21:04:22.935 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
:: 2026-10-28 21:04:22.935 File "/snap/snapcraft/19387/lib/python3.12/site-packages/snapcraft/elf/elf_utils.py", line 78, in get_elf_files_from_list
:: 2026-10-28 21:04:22.935 elf_file = ElfFile(path=path)
:: 2026-10-28 21:04:22.935 ^^^^^^^^^^^^^^^^^^
:: 2026-10-28 21:04:22.935 File "/snap/snapcraft/19387/lib/python3.12/site-packages/snapcraft/elf/_elf_file.py", line 213, in __init__
:: 2026-10-28 21:04:22.935 self._extract_attributes()
:: 2026-10-28 21:04:22.935 File "/snap/snapcraft/19387/lib/python3.12/site-packages/snapcraft/elf/_elf_file.py", line 257, in _extract_attributes
:: 2026-10-28 21:04:22.935 for tag in section.iter_tags():
:: 2026-10-28 21:04:22.935 File "/snap/snapcraft/19387/lib/python3.12/site-packages/elftools/elf/dynamic.py", line 202, in iter_tags
:: 2026-10-28 21:04:22.935 yield DynamicTag(tag, self._get_stringtable())
:: 2026-10-28 21:04:22.935 ^^^^^^^^^^^^^^^^^^^^^^^
:: 2026-10-28 21:04:22.935 File "/snap/snapcraft/19387/lib/python3.12/site-packages/elftools/elf/dynamic.py", line 168, in _get_stringtable
:: 2026-10-28 21:04:22.935 assert isinstance(self._stringtable, _StringTable)
:: 2026-10-28 21:04:22.935 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
:: 2026-10-28 21:04:22.935 AssertionError
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b |
Impact:
40
Quick Win:
27
Complexity:
20
Confidence:
85
Actionability:
85
|
keep open | GPU linter crashes with AssertionError when parsing Guile .go ELF files due to missing string table in dynamic section. |
Update history
| Date | Change |
|---|---|
| created |
Related issues
No related issues found above the similarity threshold.