Title: Jython script engine hangs on "genericpath.isfile" during its initialization
Type: crash Severity: normal
Components: Core Versions: Jython 2.7
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: fviale, stefan.richthofer
Priority: Keywords:

Created on 2019-09-05.11:59:46 by fviale, last changed 2019-09-05.17:31:22 by stefan.richthofer.

File name Uploaded Description Edit Remove
71348_jstack.log fviale, 2019-09-05.11:59:45
msg12648 (view) Author: Fabien Viale (fviale) Date: 2019-09-05.11:59:45
From time to time, the Jython script engine hangs during initialization in our environment.

The attached java stack shows where the jython engine is blocked:

"main" #1 prio=5 os_prio=0 tid=0x00007fc9b400e800 nid=0x116bb runnable [0x00007fc9b8e80000]
   java.lang.Thread.State: RUNNABLE
	at org.python.modules.posix.PosixModule$StatFunction.__call__(
	at org.python.core.PyObject.__call__(
	at genericpath$py.isfile$2(/tibco/proactive/dist/lib/jython-standalone-2.7.0.jar/Lib/
	at genericpath$py.call_function(/tibco/proactive/dist/lib/jython-standalone-2.7.0.jar/Lib/
	at org.python.core.PyFunction.__call__(
	at sysconfig$py.is_python_build$2(/tibco/proactive/dist/lib/jython-standalone-2.7.0.jar/Lib/
	at sysconfig$py.call_function(/tibco/proactive/dist/lib/jython-standalone-2.7.0.jar/Lib/
	at org.python.core.PyFunction.__call__(
	at sysconfig$py.f$0(/tibco/proactive/dist/lib/jython-standalone-2.7.0.jar/Lib/
	at sysconfig$py.call_function(/tibco/proactive/dist/lib/jython-standalone-2.7.0.jar/Lib/
	at org.python.core.imp.createFromCode(
	at org.python.core.util.importer.importer_load_module(
	at org.python.modules.zipimport.zipimporter.zipimporter_load_module(
	at org.python.modules.zipimport.zipimporter$zipimporter_load_module_exposer.__call__(Unknown Source)
	at org.python.core.PyBuiltinMethodNarrow.__call__(
	at org.python.core.imp.loadFromLoader(
	at org.python.core.imp.find_module(
	at org.python.core.imp.import_next(
	at org.python.core.imp.import_module_level(
	at org.python.core.imp.importName(
	at org.python.core.ImportFunction.__call__(
	at org.python.core.PyObject.__call__(
	at org.python.core.__builtin__.__import__(
	at org.python.core.imp.importFromAs(
	at org.python.core.imp.importFrom(

Additionnally, the standard error of the process shows:
Error in `java': malloc(): memory corruption: 0x00007fcb68beb690

Have you ever encountered before this issue and do you know what could cause it?
msg12650 (view) Author: Stefan Richthofer (stefan.richthofer) Date: 2019-09-05.16:12:20
I recognize you are using Jython 2.7.0. There were various issues regarding hanging, deadlocks and synchonization fixed since 2.7.0:
#2230 #2487 #2457 #2452. Relating to script engine, there is also this concurrency issue (still open): #2642.
So, it would be ideal if you could check if this issue still occurs with 2.7.1 or even better with current master.
Given the manifold changes since 2.7.0 it is well possible that it was fixed as a side-effect of something.

If you can reproduce it with current Jython, please provide the new jstack output because it will be convenient to have the current line numbers.

Then, some instructions for reproducing would be crucial to continue here.

What Java version and platform are you using? (sorry if that's somewhere in the jstack output; I couldn't spot it there)
msg12652 (view) Author: Fabien Viale (fviale) Date: 2019-09-05.16:22:21
Thank you stefan for your quick answer. Unfortunately, we were never able to move to jython 2.7.1 because we encoutered a different issue that we submitted a while ago:

This issue is apparently still under investigation and not fixed in any recent release. Can you confirm?
msg12654 (view) Author: Stefan Richthofer (stefan.richthofer) Date: 2019-09-05.17:31:22
At the moment I am just triaging. However, at the bottom of #2625, Jim claims to have stabilized the file count. Still, for some reason that issue is not considered fixed. Did you check if his solution solved it? Any way, that should go into the discussion at #2625 rather than here. (As a side-effect, it would pop up #2625 to the top of the bjo landing page, giving it better visibility). If you have updates or new knowledge about #2625 I suggest you post it there.

That said, in no case #2800 or #2625 will fix in 2.7.0 - '0' is already the micro version. Eventual fixes would go into 2.7.3 (or 2.7.2 if there is really a fast fix).

Further, #2800 may be worth further investigation independently from #2625, so maybe you'd want to confirm it on current Jython even if you would not actually switch to current Jython right now.
Date User Action Args
2019-09-05 17:31:22stefan.richthofersetmessages: + msg12654
2019-09-05 16:22:21fvialesetmessages: + msg12652
2019-09-05 16:12:20stefan.richthofersetnosy: + stefan.richthofer
messages: + msg12650
2019-09-05 11:59:46fvialecreate