Issue2519

classification
Title: Hangs in test.test_gc_jy under regrtest
Type: behaviour Severity: normal
Components: Core Versions: Jython 2.7
Milestone:
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: stefan.richthofer Nosy List: jeff.allen, stefan.richthofer
Priority: low Keywords: test failure causes

Created on 2016-09-04.07:31:58 by jeff.allen, last changed 2016-09-04.11:57:24 by stefan.richthofer.

Messages
msg10932 (view) Author: Jeff Allen (jeff.allen) Date: 2016-09-04.07:31:57
test.test_gc_jy used not to run under the regression test because it had no test_main() function. Now that is corrected, it reliably hangs the regression test in GCTests_Jy_Monitoring (either test).

I've skipped this test case for now so the test runs at the console, not under regrtest. (See https://hg.python.org/jython/file/tip/Lib/test/test_gc_jy.py#l785)

When hanging, the main thread dump (JVisualVM) looks like this:

"MainThread" prio=6 tid=0x0000000002513000 nid=0x133c in Object.wait() [0x000000000250b000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x00000000e0b18578> (a java.lang.Class for org.python.modules.gc$GCSentinel)
	at java.lang.Object.wait(Object.java:503)
	at org.python.modules.gc.waitForFinalizers(gc.java:2474)
	- locked <0x00000000e0b18578> (a java.lang.Class for org.python.modules.gc$GCSentinel)
	at org.python.modules.gc.syncCollect(gc.java:2151)
	at org.python.modules.gc.collect_intern(gc.java:1953)
	at org.python.modules.gc.collect(gc.java:1882)
	at sun.reflect.GeneratedMethodAccessor107.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:186)
	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:204)
	at org.python.core.PyObject.__call__(PyObject.java:464)
	at org.python.core.PyObject.__call__(PyObject.java:468)
	at test.test_gc_jy$py.test_monitor_status_after_delayed_finalization$122(~jython-trunk\dist\Lib\test\test_gc_jy.py:859)
	at test.test_gc_jy$py.call_function(~jython-trunk\dist\Lib\test\test_gc_jy.py)
...

   Locked ownable synchronizers:
	- None
msg10933 (view) Author: Stefan Richthofer (stefan.richthofer) Date: 2016-09-04.11:57:24
I guess this one is my responsibility. Thanks for sorting this out.
However this is probably a rarely used feature, so I put it to low priority for now, given that it is likely to be a tough one to fix.
(Feel free to complain if you have a crucial use-case for global gc-monitoring, then I'll reconsider.)
History
Date User Action Args
2016-09-04 11:57:24stefan.richthofersetpriority: low
assignee: stefan.richthofer
messages: + msg10933
2016-09-04 07:31:58jeff.allencreate