Skip to content

Fix python test and contention in module state map#2551

Open
dcwhite wants to merge 3 commits into
masterfrom
fix-python-test
Open

Fix python test and contention in module state map#2551
dcwhite wants to merge 3 commits into
masterfrom
fix-python-test

Conversation

@dcwhite

@dcwhite dcwhite commented Jul 4, 2026

Copy link
Copy Markdown
Member

Closes #2486

dcwhite and others added 2 commits June 14, 2026 13:34
PythonInterpreter::initialize() is called in the GTest fixture constructor,
which runs once per test on the singleton. The second call hit
PyImport_AppendInittab() after Py_Initialize(), causing a fatal abort.
Added an early-return guard so initialize() is idempotent.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
transientStateMap_ was accessed concurrently from the GUI thread and async
module execution threads (e.g. ViewScene streaming), causing rare heap
corruption under parallel test load.

Add a mutex protecting all transientStateMap_ reads and writes in
getTransientValue, setTransientValue, and print(). Signals are fired after
releasing the lock to avoid re-entrancy from signal handlers that call back
into get/setTransientValue. Copy ctor and copy assignment also lock the
source object's mutex while reading transientStateMap_.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dcwhite dcwhite added this to the 5.0.0 milestone Jul 4, 2026
@dcwhite dcwhite requested a review from jessdtate July 4, 2026 04:40
@dcwhite dcwhite self-assigned this Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Data race in SimpleMapModuleState transient values (async ViewScene streaming)

1 participant