Fails to parse erroenous build output and freezes indefinitely
Metadata
Current evaluation
UTF-8 decoding crash fixed in craft-cli #222 and pulled into Snapcraft via #4528 (craft-cli 2.5.1); report closed as resolved.
Resolution: closed resolved
Reason: The decoding exception was reproduced and fixed in craft-cli PR #222 (commit 9e017d4f), then included through Snapcraft PR #4528 (commit ef10848a2), which bumped craft-cli to 2.5.1. The maintainer could not reproduce a separate freeze and considered the triggering decode error resolved.
Evaluated by: mr-cal-bot
No scores available.
Issue body
### Bug Description
There are libreoffice snap builds for amd64 [1] and arm64 which are stuck.
Afaict snapcraft crashed while parsing the build output.
[1] https://launchpad.net/~libreoffice/df-libreoffice/+snap/libreoffice-fresh/+build/2350372
Originally reported at https://bugs.launchpad.net/snapcraft/+bug/2046156
### To Reproduce
Seems running a build which outputs e.g. an erroneous utf8 encoded string. In case of libreoffice it is an error message where it seems a byte gets cut off.
### Environment
Runs on Launchpad
### snapcraft.yaml
```shell
https://git.launchpad.net/~libreoffice/+git/libreoffice-snap/tree/snapcraft.yaml?h=24.2
```
### Relevant log output
```shell
:: [build HPX] el/helpcontent2/source/text/simpress/guide
:: Entity: line 1: parser error : Opening and ending tag mismatch: switchinline line 1 and root
Exception in thread Thread-45:
Traceback (most recent call last):
File "/snap/snapcraft/10279/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/snap/snapcraft/10279/lib/python3.10/site-packages/craft_cli/messages.py", line 285, in run
self._run_posix()
File "/snap/snapcraft/10279/lib/python3.10/site-packages/craft_cli/messages.py", line 257, in _run_posix
self._write(data)
File "/snap/snapcraft/10279/lib/python3.10/site-packages/craft_cli/messages.py", line 242, in _write
unicode_line = useful_line.decode("utf8")
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbc in position 0: invalid start byte
```
### Additional context
The deb build output looks like this which I would expect the snap build to behave as well:
[build HPX] el/helpcontent2/source/text/sbasic/python
HELPFILES=/tmp/gbuild.SMwYPO && S=/<<PKGBUILDDIR>> && I=$S/instdir && W=$S/workdir && POFILES=/tmp/gbuild.i4kgRa && LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}"$I/program:$I/program" $W/LinkTarget/Executable/helpex -l el -mi ${HELPFILES} -m ${POFILES} -o $W/HelpTranslatePartTarget/el/helpcontent2/source/text/sbasic/python && rm -f ${POFILES} && touch /<<PKGBUILDDIR>>/workdir/HelpTranslatePartTarget/el/helpcontent2/source/text/sbasic/python/done && rm -f ${HELPFILES}
[build HPX] el/helpcontent2/source/text/sbasic/shared
Entity: line 1: parser error : Opening and ending tag mismatch: switchinline line 1 and root
�αζί και επιστρέφοντας το άθροισμά τους.</root>
^
Entity: line 1: parser error : Premature end of data in tag root line 1
�αζί και επιστρέφοντας το άθροισμά τους.</root>
^
HELPFILES=/tmp/gbuild.HZ8Z3B && S=/<<PKGBUILDDIR>> && I=$S/instdir && W=$S/workdir && POFILES=/tmp/gbuild.MFTIRb && LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}"$I/program:$I/program" $W/LinkTarget/Executable/helpex -l el -mi ${HELPFILES} -m ${POFILES} -o $W/HelpTranslatePartTarget/el/helpcontent2/source/text/sbasic/shared && rm -f ${POFILES} && touch /<<PKGBUILDDIR>>/workdir/HelpTranslatePartTarget/el/helpcontent2/source/text/sbasic/shared/done && rm -f ${HELPFILES}
[build HPX] el/helpcontent2/source/text/sbasic/shared/01
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | UTF-8 decoding crash fixed in craft-cli #222 and pulled into Snapcraft via #4528 (craft-cli 2.5.1); report closed as resolved. | |
| stealth/space-bunny-alpha | — | closed resolved | Snapcraft 8.0.1’s invalid UTF-8 decoding failure was reproduced and fixed; the related freeze could not be reproduced separately. | |
| stealth/space-bunny-alpha | — | closed resolved | The UTF-8 decoding failure in Snapcraft 8.0.1 was reproduced and fixed. The maintainer could not reproduce the freeze separately and closed the report as resolved. | |
| qwen/qwen3.6-35b-a3b | — | — | The maintainer fixed the UTF-8 decoding error that caused the crash, resolving the associated indefinite freeze. The issue was closed as resolved after confirming the fix addressed the root cause. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed a UnicodeDecodeError crash caused by a bare decode call when parsing malformed build output. The maintainer patched the decoding logic, determined the reported freeze was a downstream effect, and closed the issue as resolved. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed a UTF-8 decoding crash in snapcraft that caused indefinite freezing during builds with malformed output. The maintainer patched the output parser to handle invalid bytes, resolving the freeze and closing the issue. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed a UTF-8 decoding crash in Snapcraft that caused indefinite freezing during builds with malformed output. Resolving the parsing error eliminated the freeze, marking the issue as resolved. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Fixed a UTF-8 decoding error in snapcraft that caused crashes and indefinite freezes during build output parsing. The contributor patched the unsafe decode call and closed the report as resolved, noting the freeze resulted directly from the unhandled exception. |
Update history
No update history recorded yet.
Related work
-
Likely Fixed By:
craft-cli#222
(confidence 99%)
Craft-cli commit 9e017d4f handles decoding errors from subprocess output.
-
Likely Fixed By:
snapcraft#4528
(confidence 97%)
Snapcraft commit ef10848a2 bumped craft-cli to 2.5.1, bringing in the decoding fix.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #2046156 Fails to parse build output and freezes indefinitely | snapcraft (launchpad) | closed | Build-output parsing no longer freezes: canonical/craft-cli#222 (commit 9e017d4) fixed invalid UTF-8 subprocess bytes and was pulled into Snapcraft by #4528 via craft-cli 2.5.1. | |
| #4528 build(deps): bump craft-cli to 2.5.1 | snapcraft | merged | Merged in ef10848a2 via #4528, upgrading craft-cli to 2.5.1 to fix malformed process-output decoding; released in Snapcraft 8.0.2. | |
| #1796813 Snapcraft crashes with UnicodeDecodeError | snapcraft (launchpad) | closed | Closed as stale. Failed OpenSSL decryption corrupted snapcraft.cfg; restoring the correct key fixed the build. No Snapcraft code change was made. |