Thanks to visit codestin.com
Credit goes to github.com

Skip to content

New test class causes crash on x86 with PythonEngine.Initialize #946

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lostmsu opened this issue Aug 23, 2019 · 3 comments
Closed

New test class causes crash on x86 with PythonEngine.Initialize #946

lostmsu opened this issue Aug 23, 2019 · 3 comments

Comments

@lostmsu
Copy link
Member

lostmsu commented Aug 23, 2019

See the new test class in #901

AccessViolationException gets thrown in the line PyImport_ImportModule("platform") in Runtime.InitializePlatformData when a release build is tested using NUnit console runner.

nunit3-console.exe --x86 src\embed_tests\bin\publish\Python.EmbeddingTest.dll

Removal of initialization code makes tests succeed:

[OneTimeSetUp]
public void SetUp() {
    PythonEngine.Initialize();
}

[OneTimeTearDown]
public void Dispose() {
    PythonEngine.Shutdown();
}

The initialization code on its own may not be the cause, as there are other classes, that use the same pattern. Must be something in conjunction with the actual tests.

Note, that disabling feature implemented by #901 by commenting out code in TypeManager does not resolve the problem, e.g. it crashes anyway.

lostmsu added a commit to losttech/pythonnet that referenced this issue Aug 23, 2019
@lostmsu
Copy link
Member Author

lostmsu commented Aug 23, 2019

Possibly related to #262

@lostmsu
Copy link
Member Author

lostmsu commented Aug 23, 2019

Seems that even after removing Initialize and Shutdown calls tests are flacky. :/

@lostmsu
Copy link
Member Author

lostmsu commented Aug 24, 2019

Also possibly related:
https://bugs.python.org/issue35235
https://bugs.python.org/issue32629

I am seeing that access violation in the same exact line.

This was referenced Dec 15, 2019
@filmor filmor closed this as completed Feb 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants