Bug 15675

Summary: qemurunner: format_exception() missing 2 required positional arguments
Product: [QA/Testing] Runtime Testing Reporter: Mathieu Dubois-Briand <mathieu.dubois-briand>
Component: oeqa/runtimeAssignee: Mathieu Dubois-Briand <mathieu.dubois-briand>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: randy.macleod
Version: unspecified   
Target Milestone: 5.2 M2   
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 2024-11-28 14:59:43 UTC
LoggingThread exception handler fails to handle exceptions properly, with the following exception:

>   File "/srv/pokybuild/yocto-worker/qemux86-64-tc/build/meta/lib/oeqa/utils/qemurunner.py", line 750, in threadtarget
>     self.logger.warning("Exception %s in logging thread" % traceback.format_exception(e))
> TypeError: format_exception() missing 2 required positional arguments: 'value' and 'tb'

https://valkyrie.yoctoproject.org/#/builders/66/builds/529/steps/12/logs/stdio

I believe this is because python 3.8 was used here, and this syntax for traceback.format_exception() is only supported since 3.10.

https://docs.python.org/3/library/traceback.html#traceback.format_exception

> Since Python 3.10, instead of passing value and tb, an exception object can be passed as the first argument. If value and tb are provided, the first argument is ignored in order to provide backwards compatibility.

We will have to switch to the old syntax if we want to be compatible with python versions before 3.10.
Comment 1 Mathieu Dubois-Briand 2024-11-28 15:05:30 UTC
qemux86-64-tc ubuntu2004-vk-2 master-next completed at 2024-11-27T12:15:38Z
https://valkyrie.yoctoproject.org/#/builders/66/builds/529/steps/12/logs/stdio
Comment 2 Mathieu Dubois-Briand 2025-01-15 10:27:35 UTC
Fixed by 5f9ecf5f210e qemurunner: Fix stack trace generation in exception handler