[issue39345] Py_Initialize Hangs on Windows 10

Fieschi report at bugs.python.org
Wed Aug 19 05:00:03 EDT 2020


Fieschi <philemon.fieschi at gmail.com> added the comment:

Personally, I have the same problem of Py_Initialize() hanging indefinitely.

Here is the context in which it happens : I am developing an application in Java, in which I use the library jep (https://github.com/ninia/jep), that enables me to get a Python interpreter from Java, and I am developing and testing it on Windows. My Python version is 3.8.2 and I am on Windows 10 - version 1903.
When I test this library outside my app in a simple Java project, everything works fine, and the interpreter works. 
But when I try to use it in the app, it hangs indefinitely when I create the interpreter. When I digged into the code of the library, I found out that it occurs in the native code of jep, during the call to Py_Initialize(). I posted an issue on the github of jep, and they brought me here. I bet this is related to stdin and stdout when I see what dhamilton posted.
My Java's stdout is normal and writes in the console. I tried to reset or redirect Java's stdin an stdout, but it doesn't change nothing.

And when I try to do this on Linux (my application is also on Linux), on Ubuntu 16, everything works fine and it doesn't hang indefinitely. So this only happens on Windows.

About capturing a process dump, all I can get is a message displayed on the Java console when I close the app (because it hangs indefinitely) :
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00000000302b9d8f, pid=11960, tid=0x0000000000003f98
#
# JRE version: Java(TM) SE Runtime Environment (8.0_241-b07) (build 1.8.0_241-b07)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.241-b07 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C  0x00000000302b9d8f
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows

# The crash happened outside the Java Virtual Machine in native code.

All of this is just my personal case, and it's probably not the same for dhamilton. I hope it helped you.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39345>
_______________________________________


More information about the Python-bugs-list mailing list