Issue1687

classification
Title: jython hides StackOverflowError from Java code
Type: behaviour Severity: major
Components: Core Versions: Jython 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: doublep, fwierzbicki, harely, zyasoft
Priority: low Keywords:

Created on 2010-12-15.20:01:24 by harely, last changed 2014-06-19.07:36:28 by zyasoft.

Messages
msg6280 (view) Author: (harely) Date: 2010-12-15.20:01:24
When Java code invoked from Jython causes a StackOverflowError, Jython hides the original error. The PyException that Jython throws does not refer to the original StackOverflowError as its cause and its error message suggests that it was the Python stack that overflowed.

example:


import org.python.util.PythonInterpreter;

public class Main {

	public static void foo() {
		// cause a StackOverflowError
		foo();
		//// When throwing a different Error, jython handles it fine
		//throw new AssertionError();
	}
	
	public static void main(String[] args) {
		PythonInterpreter interpreter = new PythonInterpreter();
		
		interpreter.exec(
				"from jythonstack import Main\n" +
				"Main.foo()");
	}
}


This produces:
init: Bootstrapping class not in Py.BOOTSTRAP_TYPES[class=class org.python.core.PyStringMap]
Exception in thread "main" Traceback (most recent call last):
  File "<string>", line 2, in <module>
RuntimeError: maximum recursion depth exceeded
msg6281 (view) Author: (doublep) Date: 2010-12-16.12:35:29
May be related to issue 1684.
msg8738 (view) Author: Jim Baker (zyasoft) Date: 2014-06-19.07:36:28
Fixed as of http://hg.python.org/jython/rev/5688f9c2b743
History
Date User Action Args
2014-06-19 07:36:28zyasoftsetstatus: open -> closed
resolution: fixed
messages: + msg8738
nosy: + zyasoft
2013-02-19 23:28:40fwierzbickisetpriority: low
2013-02-19 23:28:31fwierzbickisetnosy: + fwierzbicki
versions: + Jython 2.5, - 2.5.2rc
2010-12-16 12:35:29doublepsetnosy: + doublep
messages: + msg6281
2010-12-15 20:01:24harelycreate