Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Infinite recursion crash #17

Closed
ghost opened this issue Nov 29, 2013 · 2 comments
Closed

Infinite recursion crash #17

ghost opened this issue Nov 29, 2013 · 2 comments

Comments

@ghost
Copy link

ghost commented Nov 29, 2013

Originally reported by: RMTEW FULL NAME (Bitbucket: rmtew, GitHub: rmtew)


(originally reported in Trac by @akruis on 2013-04-23 13:04:22)

The following code leads to an infinite recursion.

stackless.enable_softswitch(True)

class A(object):
    def __call__(self): pass # work around issue #18
A.__call__ = A()             # OK
a=A()                        # OK
a()                          # Crash

This bounces between typeobject.c slot_tp_call() and PyObject_Call() without
ever hitting eval_frame().

The infinite recursion does not happen with CPython. The relevant difference is a change
in PyObject_Call() (http://svn.python.org/view?view=revision&revision=76528).

I'll commit a fix soon.


@ghost
Copy link
Author

ghost commented Nov 29, 2013

Original comment by RMTEW FULL NAME (Bitbucket: rmtew, GitHub: rmtew):


@akruis on 2013-04-24 15:57:08 said:

Fixed by changeset [91ff56a0cd3c] in branch 2.7-slp.
I added a call to Py_EnterRecursiveCall/Py_EnterLeaveRecursiveCall to slot_tp_call().
The tp_call function for classic classes contains similar code.

To do: check if Python3 is also affected by this issue.

@ghost
Copy link
Author

ghost commented Dec 6, 2013

Original comment by Anselm Kruis (Bitbucket: akruis, GitHub: akruis):


Already resolved. Commit for 3.x is 5af459b8176c.

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

0 participants