Eryk Sun <eryk...@gmail.com> added the comment:
I built JPype normally in release mode and was able to analyze the problem using the platform debugger (cdb or WinDbg). I think the issue is pretty straight forward. The static initializer for classMagic in "native\python\pyjp_class.cpp" is calling PyDict_New(). That's not kosher because the GIL isn't held during the LoadLibraryExW call. It seems to be okay without a cached PYC because the new_dict() call has an available dict on the freelist in this case. In the PYC case, new_dict() happens to instead call PyObject_GC_New, which fails with an access violation. I modified "pyjp_class.cpp" to set the static value of classMagic to NULL and moved the initialization to PyJPClass_new. This resolved the problem. So I think this issue should be closed as a third-party bug. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue42529> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com