Message988
I have been using Marathon (a gui testing
framework) and I have seen a deadlock between
org.python.core.imp.importName() and
org.python.core.PythonTraceFunction.safeCall() (stack
trace below). imp.importName is a static method, so
for now I removed the synchronized keyword from the
method declarition of PythonTraceFunction.safeCall()
and then put the whole method inside to synchronized
blocks. First I synchronized on imp.class (since
imp.importName is a static method) and then I
synchronized on this (the current instance of
PythonTraceFunction). This seems to have fixed the
problem. I have not run any of the tests, so I don't
know if this might cause other problems.
STACK TRACE:
[java] Found one Java-level deadlock:
[java] =============================
[java] "Thread-2":
[java] waiting to lock monitor 0x08096a74
(object 0x48c29cd0, a java.lang.Class),
[java] which is held by "Python Playback Thread"
[java] "Python Playback Thread":
[java] waiting to lock monitor 0x08096b1c
(object 0x448512c8, a org.python.core.PythonTraceFunction),
[java] which is held by "Thread-2"
[java] Java stack information for the threads
listed above:
[java]
===================================================
[java] "Thread-2":
[java] at org.python.core.imp.importName(imp.java)
[java] - waiting to lock <0x48c29cd0> (a
java.lang.Class)
[java] at
org.python.core.ImportFunction.load(__builtin__.java)
[java] at
org.python.core.ImportFunction.__call__(__builtin__.java)
[java] at
org.python.core.PyObject.__call__(PyObject.java)
[java] at
org.python.core.__builtin__.__import__(__builtin__.java)
[java] at org.python.core.imp.importFromAs(imp.java)
[java] at org.python.core.imp.importFrom(imp.java)
[java] at
org.python.pycode._pyx11._Debugger__shouldignore$5(debugger.py:33)
[java] at
org.python.pycode._pyx11.call_function(debugger.py)
[java] at
org.python.core.PyTableCode.call(PyTableCode.java)
[java] at
org.python.core.PyTableCode.call(PyTableCode.java)
[java] at
org.python.core.PyFunction.__call__(PyFunction.java)
[java] at
org.python.core.PyInstance.invoke(PyInstance.java)
[java] at
org.python.pycode._pyx11._Debugger__trace$3(debugger.py:15)
[java] at
org.python.pycode._pyx11.call_function(debugger.py)
[java] at
org.python.core.PyTableCode.call(PyTableCode.java)
[java] at
org.python.core.PyTableCode.call(PyTableCode.java)
[java] at
org.python.core.PyTableCode.call(PyTableCode.java)
[java] at
org.python.core.PyFunction.__call__(PyFunction.java)
[java] at
org.python.core.PyMethod.__call__(PyMethod.java)
[java] at
org.python.core.PyObject.__call__(PyObject.java)
[java] at
org.python.core.PyObject.invoke(PyObject.java)
[java] at
org.python.pycode._pyx11.trace$2(debugger.py:8)
[java] at
org.python.pycode._pyx11.call_function(debugger.py)
[java] at
org.python.core.PyTableCode.call(PyTableCode.java)
[java] at
org.python.core.PyTableCode.call(PyTableCode.java)
[java] at
org.python.core.PyTableCode.call(PyTableCode.java)
[java] at
org.python.core.PyFunction.__call__(PyFunction.java)
[java] at
org.python.core.PyMethod.__call__(PyMethod.java)
[java] at
org.python.core.PyObject.__call__(PyObject.java)
[java] at
org.python.core.PythonTraceFunction.safeCall(PythonTraceFunction.java)
[java] - locked <0x448512c8> (a
org.python.core.PythonTraceFunction)
[java] at
org.python.core.PythonTraceFunction.traceCall(PythonTraceFunction.java)
[java] at
org.python.core.PyTableCode.call(PyTableCode.java)
[java] at
org.python.core.PyTableCode.call(PyTableCode.java)
[java] at
org.python.core.PyTableCode.call(PyTableCode.java)
[java] at
org.python.core.PyFunction.__call__(PyFunction.java)
[java] at
org.python.core.PyMethod.__call__(PyMethod.java)
[java] at
org.python.core.PyObject.__call__(PyObject.java)
[java] at
org.python.modules.FunctionThread.run(thread.java)
[java] "Python Playback Thread":
[java] at
org.python.core.PythonTraceFunction.safeCall(PythonTraceFunction.java)
[java] - waiting to lock <0x448512c8> (a
org.python.core.PythonTraceFunction)
[java] at
org.python.core.PythonTraceFunction.traceCall(PythonTraceFunction.java)
[java] at
org.python.core.PyTableCode.call(PyTableCode.java)
[java] at org.python.core.PyCode.call(PyCode.java)
[java] at
org.python.core.imp.createFromCode(imp.java)
[java] at
org.python.core.imp.createFromPyClass(imp.java)
[java] at org.python.core.imp.loadFromPath(imp.java)
[java] at org.python.core.imp.loadFromPath(imp.java)
[java] at org.python.core.imp.load(imp.java)
[java] at org.python.core.imp.import_next(imp.java)
[java] at org.python.core.imp.import_name(imp.java)
[java] at org.python.core.imp.importName(imp.java)
[java] - locked <0x48c29cd0> (a java.lang.Class)
[java] at
org.python.core.ImportFunction.load(__builtin__.java)
[java] at
org.python.core.ImportFunction.__call__(__builtin__.java)
[java] at
org.python.core.PyObject.__call__(PyObject.java)
[java] at
org.python.core.__builtin__.__import__(__builtin__.java)
[java] at
org.python.modules.os.classDictInit(os.java)
[java] at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[java] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at
java.lang.reflect.Method.invoke(Method.java:324)
[java] at
org.python.core.PyJavaClass.initialize(PyJavaClass.java)
[java] - locked <0x447e9df8> (a
org.python.core.PyJavaClass)
[java] at
org.python.core.PyJavaClass.lookupGivingClass(PyJavaClass.java)
[java] at
org.python.core.PyClass.lookup(PyClass.java)
[java] at
org.python.core.PyJavaClass.__findattr__(PyJavaClass.java)
[java] at org.python.core.imp.importFromAs(imp.java)
[java] at org.python.core.imp.importFrom(imp.java)
[java] at
marathon.playback$py.window$5(libpy/marathon/playback.py:31)
[java] at
marathon.playback$py.call_function(libpy/marathon/playback.py)
[java] at
org.python.core.PyTableCode.call(PyTableCode.java)
[java] at
org.python.core.PyTableCode.call(PyTableCode.java)
[java] at
org.python.core.PyTableCode.call(PyTableCode.java)
[java] at
org.python.core.PyFunction.__call__(PyFunction.java)
[java] at
org.python.pycode._pyx10.test$1(/export/crane2/users/jgreenwa/build-dir/trunk/build-artifacts/linux/tests/classes/gui/marathon/TestCases/test1.py:10)
[java] at
org.python.pycode._pyx10.call_function(/export/crane2/users/jgreenwa/build-dir/trunk/build-artifacts/linux/tests/classes/gui/marathon/TestCases/test1.py)
[java] at
org.python.core.PyTableCode.call(PyTableCode.java)
[java] at
org.python.core.PyTableCode.call(PyTableCode.java)
[java] at
org.python.core.PyFunction.__call__(PyFunction.java)
[java] at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[java] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at
java.lang.reflect.Method.invoke(Method.java:324)
[java] at
org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
[java] at
org.python.core.PyMethod.__call__(PyMethod.java)
[java] at
org.python.core.PyObject._callextra(PyObject.java)
[java] at
marathon.results$py.callprotected$3(libpy/marathon/results.py:16)
[java] at
marathon.results$py.call_function(libpy/marathon/results.py)
[java] at
org.python.core.PyTableCode.call(PyTableCode.java)
[java] at
org.python.core.PyTableCode.call(PyTableCode.java)
[java] at
org.python.core.PyTableCode.call(PyTableCode.java)
[java] at
org.python.core.PyFunction.__call__(PyFunction.java)
[java] at
org.python.core.PyInstance.invoke(PyInstance.java)
[java] at
marathon.playback$py.execTest$2(libpy/marathon/playback.py:17)
[java] at
marathon.playback$py.call_function(libpy/marathon/playback.py)
[java] at
org.python.core.PyTableCode.call(PyTableCode.java)
[java] at
org.python.core.PyTableCode.call(PyTableCode.java)
[java] at
org.python.core.PyTableCode.call(PyTableCode.java)
[java] at
org.python.core.PyFunction.__call__(PyFunction.java)
[java] at
org.python.core.PyMethod.__call__(PyMethod.java)
[java] at
org.python.core.PyObject.__call__(PyObject.java)
[java] at
net.sourceforge.marathon.runtime.python.PythonScript$1.run(PythonScript.java:157)
|
|
Date |
User |
Action |
Args |
2008-02-20 17:17:22 | admin | link | issue1227282 messages |
2008-02-20 17:17:22 | admin | create | |
|