Skip to content

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

Closed

Description

@lostmsu

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.

Activity

  1. lostmsu commented on Aug 23, 2019

    @lostmsu
    MemberAuthor

    Possibly related to #262

  2. lostmsu commented on Aug 23, 2019

    @lostmsu
    MemberAuthor

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

  3. lostmsu commented on Aug 24, 2019

    @lostmsu
    MemberAuthor

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions