source-builder randomly hangs

Anders Montonen Anders.Montonen at iki.fi
Sat May 2 12:04:19 UTC 2020


Hi,

A couple of times I’ve had source-builder hang seemingly randomly, with the following Python backtrace:

Exception in thread _stderr[]:
Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/home/anders/work/rtems/rsb/source-builder/sb/execute.py", line 204, in _readthread
    data = data.decode(sys.stdout.encoding)
UnicodeDecodeError: 'utf-8' codec can't decode bytes in position 4094-4095: unexpected end of data

My guess is that since the loop in execute._readthread() is reading in fixed 4096-byte chunks, occasionally the boundary will fall in the middle of an UTF-8 code point, causing the decode call to throw an error. Since source-builder stops reading the file handle at that point, it will then deadlock the child process. Unfortunately, I haven’t yet been able to reliably trigger the issue. Usually, re-running the same build command succeeds.

Regards,
Anders


More information about the users mailing list