Title: StackOverflowError with multiple inheritance, metaclasses, and __isinstancecheck__
Type: behaviour Severity: normal
Components: Versions: Jython 2.7
Milestone: Jython 2.7.1
Status: closed Resolution: invalid
Dependencies: Superseder:
Assigned To: stefan.richthofer Nosy List: jamesmudd, refi64, stefan.richthofer
Priority: normal Keywords:

Created on 2017-02-28.23:57:35 by refi64, last changed 2017-03-28.05:26:40 by zyasoft.

File name Uploaded Description Edit Remove jamesmudd, 2017-03-01.19:05:20 Example script
msg11148 (view) Author: Ryan (refi64) Date: 2017-02-28.23:57:35
class A(type): pass

class B(type):
    def __instancecheck__(): pass

class C(A, B): pass

print(isinstance(object(), C))


Traceback (most recent call last):
  File "", line 8, in <module>
    print(isinstance(object(), C))
RuntimeError: maximum recursion depth exceeded (Java StackOverflowError)

Originally reported as
msg11154 (view) Author: James Mudd (jamesmudd) Date: 2017-03-01.19:05:20
I have just looked at this and couldn't reproduce it using jython master Ubuntu 16.04 with java1.8.0_111 using the example below. I have uploaded the script I was running successfully and it prints False which seems to be correct.

Could you give more details on the setup you were testing OS, jython version java version. Looking at the linked github issue it appears this might be happening on Windows?

Also could you try increasing -Xss the default is 1m maybe try with 5m and see if it still occurs. e.g. run
java -Xss5m -jar /path/to/jython.jar
msg11156 (view) Author: Stefan Richthofer (stefan.richthofer) Date: 2017-03-01.23:34:56
This one has already been fixed as part of

Specifically it is described in

The cause is deciphered in

And finally it was fixed in

Ryan, can you assert that it works using our soft 2.7.1rc linked in ?
Date User Action Args
2017-03-28 05:26:40zyasoftsetstatus: pending -> closed
2017-03-01 23:34:56stefan.richthofersetstatus: open -> pending
nosy: + stefan.richthofer
messages: + msg11156
priority: normal
assignee: stefan.richthofer
milestone: Jython 2.7.1
resolution: invalid
2017-03-01 19:05:21jamesmuddsetfiles: +
nosy: + jamesmudd
messages: + msg11154
2017-02-28 23:57:35refi64create