Skip to content

[Bug]: FVP VSI3 Python teardown can abort with Py_EndInterpreter: not the last thread #274

Description

@TeoMahnic

Is there an existing issue for this?

  • I have searched the existing issues

Problem statement

When using the SDSIO VSI3 Python interface, the FVP can terminate the embedded Python interpreter while SDSIO worker threads are still alive. This can abort the process with:

Fatal Python error: Py_EndInterpreter: not the last thread
Python runtime state: initialized

Thread ... (most recent call first):
  File "/usr/lib/python3.12/threading.py", line 359 in wait
  File ".../Board/Corstone-320/vsi/python/sdsio.py", line 95 in read
  File ".../Board/Corstone-320/vsi/python/sdsio.py", line 377 in _file_write_worker
  File "/usr/lib/python3.12/threading.py", line 1010 in run
  File "/usr/lib/python3.12/threading.py", line 1073 in _bootstrap_inner
  File "/usr/lib/python3.12/threading.py", line 1030 in _bootstrap

Current thread ...:
  <no Python frame>

Extension modules: yaml._yaml (total: 1)
Aborted (core dumped)

Steps To Reproduce

  1. Run an FVP SDS example that loads vsi/python/arm_vsi3.py.
  2. Start SDS recording/playback so a VSI3 stream worker thread is created.
  3. Stop or terminate the FVP before all SDSIO streams are closed.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Fields

No fields configured for Bug.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions