Michael,
It looks like you've subclassed bytearray with out defining a __len__ method and the PyByteArrayDerived class is calling super.__len__() however that is in turn calling __len__() expecting to call it's super __len__() from BaseBytes however PyByteArrayDerived takes precedence and then recursive loop …

Explicitly forcing PyByteArray.__len__ to call BaseBytes.__len__ should fix it.

diff -r d9c4641be70a src/org/python/core/PyByteArray.java
--- a/src/org/python/core/PyByteArray.java      Sat May 10 23:44:28 2014 -0600
+++ b/src/org/python/core/PyByteArray.java      Mon May 12 06:09:58 2014 +1000
@@ -1466,7 +1466,7 @@
 
     @ExposedMethod(doc = BuiltinDocs.bytearray___len___doc)
     final int bytearray___len__() {
-        return __len__();
+        return super.__len__();
     }
 
     /**


Cheers
Indra



On 12 May 2014 04:22, Michael Büsch <m@bues.ch> wrote:
On Sun, 11 May 2014 19:59:58 +0200
Michael Büsch <m@bues.ch> wrote:

> Ok, I modified the jython code to find out which part throws the error.
> It turns out it's src/org/python/core/Py.java:511, where the Java StackOverflowError
> is caught.
> (I suggest the attached patch, so it's easier to see where the error originated from.)
>
> I tried increasing java memory sizes as follows:
> export JAVA_STACK=-Xss512m
> export JAVA_MEM=-Xmx2048m
>
> That didn't help, though.
>
> Does somebody have an idea on how to debug this further?


t.printStackTrace() shows this:

java.lang.StackOverflowError
        at org.python.core.PyType.lookup(PyType.java:1191)
        at org.python.core.PyByteArrayDerived.__len__(PyByteArrayDerived.java:834)
        at org.python.core.PyByteArray.bytearray___len__(PyByteArray.java:1469)
        at org.python.core.PyByteArray$bytearray___len___exposer.__call__(Unknown Source)
        at org.python.core.PyByteArrayDerived.__len__(PyByteArrayDerived.java:836)
        at org.python.core.PyByteArray.bytearray___len__(PyByteArray.java:1469)
        at org.python.core.PyByteArray$bytearray___len___exposer.__call__(Unknown Source)
        at org.python.core.PyByteArrayDerived.__len__(PyByteArrayDerived.java:836)
        at org.python.core.PyByteArray.bytearray___len__(PyByteArray.java:1469)
        at org.python.core.PyByteArray$bytearray___len___exposer.__call__(Unknown Source)
        at org.python.core.PyByteArrayDerived.__len__(PyByteArrayDerived.java:836)
        at org.python.core.PyByteArray.bytearray___len__(PyByteArray.java:1469)
        at org.python.core.PyByteArray$bytearray___len___exposer.__call__(Unknown Source)
        at org.python.core.PyByteArrayDerived.__len__(PyByteArrayDerived.java:836)
        at org.python.core.PyByteArray.bytearray___len__(PyByteArray.java:1469)
        at org.python.core.PyByteArray$bytearray___len___exposer.__call__(Unknown Source)
        at org.python.core.PyByteArrayDerived.__len__(PyByteArrayDerived.java:836)
        at org.python.core.PyByteArray.bytearray___len__(PyByteArray.java:1469)
        at org.python.core.PyByteArray$bytearray___len___exposer.__call__(Unknown Source)
        at org.python.core.PyByteArrayDerived.__len__(PyByteArrayDerived.java:836)
[snip]
        at org.python.core.PyByteArray$bytearray___len___exposer.__call__(Unknown Source)
        at org.python.core.PyByteArrayDerived.__len__(PyByteArrayDerived.java:836)
        at org.python.core.PyByteArray.bytearray___len__(PyByteArray.java:1469)
        at org.python.core.PyByteArray$bytearray___len___exposer.__call__(Unknown Source)
        at org.python.core.PyByteArrayDerived.__len__(PyByteArrayDerived.java:836)
        at org.python.core.PyByteArray.bytearray___len__(PyByteArray.java:1469)
        at org.python.core.PyByteArray$bytearray___len___exposer.__call__(Unknown Source)



--
Michael.

----
Please use PGP/GPG encryption.
Key-ID: F532BE1D908D8B0E
--------

------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
&#149; 3 signs your SCM is hindering your productivity
&#149; Requirements for releasing software faster
&#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
_______________________________________________
Jython-dev mailing list
Jython-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-dev




--
Indra Talip