Bug 16081

Summary: bitbake: SemLock usage error on fedora43
Product: [Build System, Metadata & Runtime] BitBake Reporter: Mathieu Dubois-Briand <mathieu.dubois-briand>
Component: bitbakeAssignee: Richard Purdie <richard.purdie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: ccasciato, philip, poky.bs.watcher, poky.watcher, randy.macleod
Version: unspecified   
Target Milestone: 6.0 M1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Mathieu Dubois-Briand 2025-11-27 09:06:40 UTC
We got this error on the Fedor43 worker:

ERROR: An uncaught exception occurred in runqueue
Traceback (most recent call last):
  File "/srv/pokybuild/yocto-worker/qa-extras/build/layers/bitbake/lib/bb/runqueue.py", line 1663, in execute_runqueue
    return self._execute_runqueue()
           ~~~~~~~~~~~~~~~~~~~~~~^^
  File "/srv/pokybuild/yocto-worker/qa-extras/build/layers/bitbake/lib/bb/runqueue.py", line 1607, in _execute_runqueue
    retval = self.dump_signatures(dumpsigs)
  File "/srv/pokybuild/yocto-worker/qa-extras/build/layers/bitbake/lib/bb/runqueue.py", line 1718, in dump_signatures
    p.start()
    ~~~~~~~^^
  File "/usr/lib64/python3.14/multiprocessing/process.py", line 121, in start
    self._popen = self._Popen(self)
                  ~~~~~~~~~~~^^^^^^
  File "/usr/lib64/python3.14/multiprocessing/context.py", line 224, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/usr/lib64/python3.14/multiprocessing/context.py", line 300, in _Popen
    return Popen(process_obj)
  File "/usr/lib64/python3.14/multiprocessing/popen_forkserver.py", line 35, in __init__
    super().__init__(process_obj)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/usr/lib64/python3.14/multiprocessing/popen_fork.py", line 20, in __init__
    self._launch(process_obj)
    ~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/usr/lib64/python3.14/multiprocessing/popen_forkserver.py", line 47, in _launch
    reduction.dump(process_obj, buf)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.14/multiprocessing/reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^
  File "/usr/lib64/python3.14/multiprocessing/synchronize.py", line 109, in __getstate__
    raise RuntimeError('A SemLock created in a fork context is being '
    ...<2 lines>...
                       'multiprocessing objects and Process.')
RuntimeError: A SemLock created in a fork context is being shared with a process in a spawn context. This is not supported. Please use the same context to create multiprocessing objects and Process.
Comment 1 Mathieu Dubois-Briand 2025-11-27 09:23:40 UTC
qa-extras fedora43-vk-1 master completed at 2025-11-24 02:29:07+00:00
https://autobuilder.yoctoproject.org/valkyrie/#/builders/99/builds/2754/steps/22/logs/stdio
Comment 2 Richard Purdie 2025-12-01 14:04:10 UTC
I think that:

bb/runqueue.py:from multiprocessing import Process

can be changed to:

bb/runqueue.py:from bb.multiprocessing import Process

to fix this.