Issue2800

classification
Title: Jython script engine hangs on "genericpath.isfile" during its initialization
Type: crash Severity: normal
Components: Core Versions: Jython 2.7
Milestone:
process
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.

Files
File name Uploaded Description Edit Remove
71348_jstack.log fviale, 2019-09-05.11:59:45
Messages
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__(PosixModule.java:1273)
	at org.python.core.PyObject.__call__(PyObject.java:465)
	at genericpath$py.isfile$2(/tibco/proactive/dist/lib/jython-standalone-2.7.0.jar/Lib/genericpath.py:32)
	at genericpath$py.call_function(/tibco/proactive/dist/lib/jython-standalone-2.7.0.jar/Lib/genericpath.py)
	at org.python.core.PyTableCode.call(PyTableCode.java:167)
	at org.python.core.PyBaseCode.call(PyBaseCode.java:138)
	at org.python.core.PyFunction.__call__(PyFunction.java:413)
	at sysconfig$py.is_python_build$2(/tibco/proactive/dist/lib/jython-standalone-2.7.0.jar/Lib/sysconfig.py:143)
	at sysconfig$py.call_function(/tibco/proactive/dist/lib/jython-standalone-2.7.0.jar/Lib/sysconfig.py)
	at org.python.core.PyTableCode.call(PyTableCode.java:167)
	at org.python.core.PyBaseCode.call(PyBaseCode.java:124)
	at org.python.core.PyFunction.__call__(PyFunction.java:403)
	at sysconfig$py.f$0(/tibco/proactive/dist/lib/jython-standalone-2.7.0.jar/Lib/sysconfig.py:719)
	at sysconfig$py.call_function(/tibco/proactive/dist/lib/jython-standalone-2.7.0.jar/Lib/sysconfig.py)
	at org.python.core.PyTableCode.call(PyTableCode.java:167)
	at org.python.core.PyCode.call(PyCode.java:18)
	at org.python.core.imp.createFromCode(imp.java:436)
	at org.python.core.util.importer.importer_load_module(importer.java:109)
	at org.python.modules.zipimport.zipimporter.zipimporter_load_module(zipimporter.java:163)
	at org.python.modules.zipimport.zipimporter$zipimporter_load_module_exposer.__call__(Unknown Source)
	at org.python.core.PyBuiltinMethodNarrow.__call__(PyBuiltinMethodNarrow.java:46)
	at org.python.core.imp.loadFromLoader(imp.java:587)
	at org.python.core.imp.find_module(imp.java:537)
	at org.python.core.imp.import_next(imp.java:840)
	at org.python.core.imp.import_module_level(imp.java:959)
	at org.python.core.imp.importName(imp.java:1062)
	at org.python.core.ImportFunction.__call__(__builtin__.java:1280)
	at org.python.core.PyObject.__call__(PyObject.java:431)
	at org.python.core.__builtin__.__import__(__builtin__.java:1232)
	at org.python.core.imp.importFromAs(imp.java:1156)
	at org.python.core.imp.importFrom(imp.java:1132)
...


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:
http://bugs.jython.org/issue2625

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.
History
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