add regression tests for GIL ordering bug (v2)#390
Closed
Conversation
…no fix Adds TestGilString and expands TestBindCgoPackage/TestBindSimple to exercise the go2py string conversion paths that panic on master without the fix. Intended to run against master to prove the bug is reproducible in CI.
6836d46 to
9683a52
Compare
9683a52 to
f93fc93
Compare
Rebuilds the gilstring example as a minimal two-extension test: gilstring (Hello) and simple (Add) are each built into the same workdir and imported in the same Python process, interleaved over 5000 iterations — matching the exact script from the issue report. Replaces the single-extension approach that could not trigger the cross-extension GIL/cgo crash.
gopy compiles generated C files in-place via os.Chdir(outputDir), so building two packages into the same directory caused symbol collisions (redefinition of gopy_build_bool, GoPyInit, etc.). Each package now gets its own subdirectory under the shared workdir, mirroring how extensions coexist under site-packages in a real virtualenv.
e521539 to
6599997
Compare
6599997 to
8cb89ab
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is just meant to try and exercise / demonstrate the issue filed in #370 . It is possible that we will not be able to reproduce.
Summary
Adds TestGilString and expands TestBindCgoPackage/TestBindSimple to exercise the go2py string conversion paths that panic on master without the fix. Intended to run against master to prove the bug is reproducible in CI.
This is an alternate to #389