buildstream-migration / bst-staging

GNU Lesser General Public License v2.1
0 stars 0 forks source link

Stack trace when log files cause UTF-8 errors #624

Open Cynical-Optimist opened 4 years ago

Cynical-Optimist commented 4 years ago

See original issue on GitLab In GitLab by [Gitlab user @coldtom] on Sep 4, 2018, 14:09

Summary

When trying to view the logs of a failed build I encountered a stack trace due to a non-utf-8 character appearing in the build log.

Steps to reproduce

Attempt to build ntfs-3g on top of freedesktop-sdk's bootstrap-import using a default autotools element, the build should fail in the install-commands and trying to view the logs will give a stack trace.

What is the current bug behavior?

Attempting to view log gives

Build failure on element: vm/deploy-tools/ntfs3g.bst

Choose one of the following options:
  (c)ontinue  - Continue queueing jobs as much as possible
  (q)uit      - Exit after all ongoing jobs complete
  (t)erminate - Terminate any ongoing jobs and exit
  (r)etry     - Retry this job
  (l)og       - View the full log file
  (s)hell     - Drop into a shell in the failed build sandbox

Pressing ^C will terminate jobs and exit

Choice: [continue]: l
Unknown exception in SIGCHLD handler
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/unix_events.py", line 808, in _sig_chld
    self._do_waitpid_all()
  File "/usr/lib/python3.5/asyncio/unix_events.py", line 874, in _do_waitpid_all
    self._do_waitpid(pid)
  File "/usr/lib/python3.5/asyncio/unix_events.py", line 908, in _do_waitpid
    callback(pid, returncode, *args)
  File "/home/thomascoldrick/buildstream/buildstream/_scheduler/jobs/job.py", line 553, in _parent_child_completed
    self._scheduler.job_completed(self, returncode == RC_OK)
  File "/home/thomascoldrick/buildstream/buildstream/_scheduler/scheduler.py", line 238, in job_completed
    self._job_complete_callback(job, success)
  File "/home/thomascoldrick/buildstream/buildstream/_frontend/app.py", line 545, in _job_completed
    self._handle_failure(element, queue, failure)
  File "/home/thomascoldrick/buildstream/buildstream/_frontend/app.py", line 611, in _handle_failure
    content = logfile.read()
  File "/usr/lib/python3.5/codecs.py", line 321, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfe in position 47855: invalid start byte

And doesn't exit to terminal, hanging after the stack trace.


Cynical-Optimist commented 4 years ago

In GitLab by [Gitlab user @tlater] on Sep 25, 2018, 15:10

mentioned in merge request website!93