Skip to content

NUnit Embedded tests fail occasionally on Python3 #364

Closed

Description

@vmuriart

Environment

  • Pythonnet version: Current
  • Python version: 3.3+
  • Operating System: Windows

Details

  • Describe what you were trying to get done.

Run Unit tests on AppVeyor

  • If there was a crash, please include the traceback here.
Execution Runtime: net-3.5
OpenCover.Console.exe : 
At C:\projects\pythonnet\ci\appveyor_run_tests.ps1:22 char:1
+ .$OPENCOVER -register:user -searchdirs:"$RUNTIME_DIR" -output:cs.cove ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at Python.Runtime.Runtime.PyGILState_Ensure()
   at Python.Runtime.PythonEngine.AcquireLock() in C:\projects\pythonnet\src\runtime\pythonengine.cs:line 309
   at Python.Runtime.PyObject.Dispose(Boolean disposing) in C:\projects\pythonnet\src\runtime\pyobject.cs:line 118
   at Python.Runtime.PyObject.Dispose() in C:\projects\pythonnet\src\runtime\pyobject.cs:line 129
   at Python.Runtime.PyObject.Finalize() in C:\projects\pythonnet\src\runtime\pyobject.cs:line 46
Fatal Python error: take_gil: NULL tstate
...F.Unhandled Exception:

Possibly related

https://bugs.python.org/issue26003
https://bugs.python.org/issue19576
https://bugs.python.org/issue20891
http://stackoverflow.com/questions/4866701/python-pygilstate-ensure-release-causes-segfault-while-returning-to-c-from-p

Activity

  1. vmuriart commented on Feb 7, 2017

    @vmuriart
    ContributorAuthor

    Related to this currently we are running the embedded tests, but ignoring the exit code from nunit.

    That is by design till this issue is fixed. Looks to be a race condition from what the links above mention, and how often/rare it shows up. I can't reproduce it locally though

  2. added a commit that references this issue on Feb 8, 2017
    c69297e
  3. added a commit that references this issue on Jun 1, 2017
    1aa6e4c
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