Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hitting recursive depth causing all notebook pages to hang #3198

Closed
mrmagooey opened this issue Apr 18, 2013 · 1 comment · Fixed by #3201
Closed

Hitting recursive depth causing all notebook pages to hang #3198

mrmagooey opened this issue Apr 18, 2013 · 1 comment · Fixed by #3201
Milestone

Comments

@mrmagooey
Copy link
Contributor

The following will cause all IPython 0.13.1 notebook pages to become unresponsive:

class Blah(object):
     def recursive_function(self):
         return self.recursive_function()
b = Blah()
b.recursive_function()

This will cause all notebook pages open in the browser to become unresponsive and need to be killed (tested current Chrome and Firefox). Firefox will report that something in utils.js has become unresponsive. Just to be clear, this would otherwise be expected to raise RuntimeError: maximum recursion depth exceeded.

@minrk
Copy link
Member

minrk commented Apr 19, 2013

The error is being raised - the issue is simply rendering the massive traceback in javascript. I expect it's the regular-expression operation that turns ANSI colors into css that's the culprit. It's possible that is not written in an appropriately efficient way, and we should probably also have some truncation of tracebacks to protect against this sort of thing.

@minrk minrk closed this as completed in 719c4f8 Apr 25, 2013
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
ansispan function adapted from mmalecki/ansispan

The easiest way to see how slow the old way was is to create a very large traceback (e.g. max recursion), which bring everything to a screeching halt (even future page loads, if the output is saved).  Now a max recursion error draws in a second or two.

closes ipython#3198
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants