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

Recursion depth exceeded exception #5

Open
jhargis opened this issue Apr 19, 2016 · 5 comments
Open

Recursion depth exceeded exception #5

jhargis opened this issue Apr 19, 2016 · 5 comments

Comments

@jhargis
Copy link

jhargis commented Apr 19, 2016

2016-04-18 22:44:46-0700 [WProtocol,0,192.168.1.202] Unhandled Error
    Traceback (most recent call last):
      File "/Users/j/SOURCE/w/qt5reactor.py", line 305, in doIteration
        self.qApp.processEvents(QEventLoop.AllEvents, delay * 1000)
      File "/Users/j/SOURCE/w/qt5reactor.py", line 291, in _iterate
        self.doIteration(delay, fromqt)
      File "/Users/j/SOURCE/w/qt5reactor.py", line 305, in doIteration
        self.qApp.processEvents(QEventLoop.AllEvents, delay * 1000)
      File "/Users/j/SOURCE/w/qt5reactor.py", line 186, in write
        log.callWithLogger(w, _write)
    --- <exception caught here> ---
      File "/Users/j/.virtualenvs/w/lib/python2.7/site-packages/twisted/python/log.py", line 101, in callWithLogger
        return callWithContext({"system": lp}, func, *args, **kw)
      File "/Users/j/.virtualenvs/w/lib/python2.7/site-packages/twisted/python/log.py", line 84, in callWithContext
        return context.call({ILogContext: newCtx}, func, *args, **kw)
      File "/Users/j/.virtualenvs/w/lib/python2.7/site-packages/twisted/python/context.py", line 118, in callWithContext
        return self.currentContext().callWithContext(ctx, func, *args, **kw)
      File "/Users/j/.virtualenvs/w/lib/python2.7/site-packages/twisted/python/context.py", line 81, in callWithContext
        return func(*args,**kw)
      File "/Users/j/SOURCE/w/qt5reactor.py", line 185, in _write
        self.reactor._iterate(fromqt=True)
      File "/Users/j/SOURCE/w/qt5reactor.py", line 290, in _iterate
        self.runUntilCurrent()
      File "/Users/j/.virtualenvs/w/lib/python2.7/site-packages/twisted/internet/base.py", line 827, in runUntilCurrent
        log.deferr()
      File "/Users/j/.virtualenvs/w/lib/python2.7/site-packages/twisted/python/log.py", line 132, in err
        msg(failure=_stuff, why=_why, isError=1, **kw)
      File "/Users/j/.virtualenvs/w/lib/python2.7/site-packages/twisted/python/threadable.py", line 53, in sync
        return function(self, *args, **kwargs)
      File "/Users/j/.virtualenvs/w/lib/python2.7/site-packages/twisted/python/log.py", line 282, in msg
        _publishNew(self._publishPublisher, actualEventDict, textFromEventDict)
      File "/Users/j/.virtualenvs/w/lib/python2.7/site-packages/twisted/logger/_legacy.py", line 154, in publishToNewObserver
        observer(eventDict)
      File "/Users/j/.virtualenvs/w/lib/python2.7/site-packages/twisted/logger/_observer.py", line 136, in __call__
        errorLogger = self._errorLoggerForObserver(brokenObserver)
      File "/Users/j/.virtualenvs/w/lib/python2.7/site-packages/twisted/logger/_observer.py", line 156, in _errorLoggerForObserver
        if obs is not observer
      File "/Users/j/.virtualenvs/w/lib/python2.7/site-packages/twisted/logger/_observer.py", line 81, in __init__
        self.log = Logger(observer=self)
      File "/Users/j/.virtualenvs/w/lib/python2.7/site-packages/twisted/logger/_logger.py", line 52, in __init__
        namespace = self._namespaceFromCallingContext()
      File "/Users/j/.virtualenvs/w/lib/python2.7/site-packages/twisted/logger/_logger.py", line 32, in _namespaceFromCallingContext
        return currentframe(2).f_globals["__name__"]
    exceptions.RuntimeError: maximum recursion depth exceeded

2016-04-18 22:44:46-0700 [WProtocol,0,192.168.1.202] Unhandled Error
    Traceback (most recent call last):
      File "/Users/j/SOURCE/w/qt5reactor.py", line 305, in doIteration
        self.qApp.processEvents(QEventLoop.AllEvents, delay * 1000)
      File "/Users/j/SOURCE/w/qt5reactor.py", line 291, in _iterate
        self.doIteration(delay, fromqt)
      File "/Users/j/SOURCE/w/qt5reactor.py", line 305, in doIteration
        self.qApp.processEvents(QEventLoop.AllEvents, delay * 1000)
      File "/Users/j/SOURCE/w/qt5reactor.py", line 165, in read
        log.callWithLogger(w, _read)
    --- <exception caught here> ---
      File "/Users/j/.virtualenvs/w/lib/python2.7/site-packages/twisted/python/log.py", line 101, in callWithLogger
        return callWithContext({"system": lp}, func, *args, **kw)
      File "/Users/j/.virtualenvs/w/lib/python2.7/site-packages/twisted/python/log.py", line 84, in callWithContext
        return context.call({ILogContext: newCtx}, func, *args, **kw)
      File "/Users/j/.virtualenvs/w/lib/python2.7/site-packages/twisted/python/context.py", line 118, in callWithContext
        return self.currentContext().callWithContext(ctx, func, *args, **kw)
      File "/Users/j/.virtualenvs/w/lib/python2.7/site-packages/twisted/python/context.py", line 81, in callWithContext
        return func(*args,**kw)
      File "/Users/j/SOURCE/w/qt5reactor.py", line 157, in _read
        log.err()
      File "/Users/j/.virtualenvs/w/lib/python2.7/site-packages/twisted/python/log.py", line 132, in err
        msg(failure=_stuff, why=_why, isError=1, **kw)
      File "/Users/j/.virtualenvs/w/lib/python2.7/site-packages/twisted/python/threadable.py", line 53, in sync
        return function(self, *args, **kwargs)
      File "/Users/j/.virtualenvs/w/lib/python2.7/site-packages/twisted/python/log.py", line 282, in msg
        _publishNew(self._publishPublisher, actualEventDict, textFromEventDict)
      File "/Users/j/.virtualenvs/w/lib/python2.7/site-packages/twisted/logger/_legacy.py", line 154, in publishToNewObserver
        observer(eventDict)
      File "/Users/j/.virtualenvs/w/lib/python2.7/site-packages/twisted/logger/_observer.py", line 136, in __call__
        errorLogger = self._errorLoggerForObserver(brokenObserver)
      File "/Users/j/.virtualenvs/w/lib/python2.7/site-packages/twisted/logger/_observer.py", line 156, in _errorLoggerForObserver
        if obs is not observer
      File "/Users/j/.virtualenvs/w/lib/python2.7/site-packages/twisted/logger/_observer.py", line 81, in __init__
        self.log = Logger(observer=self)
    exceptions.RuntimeError: maximum recursion depth exceeded

^C2016-04-18 22:44:48-0700 [-] Received SIGINT, shutting down.
2016-04-18 22:44:48-0700 [twisted.internet.protocol.Factory] (TCP Port 4337 Closed)
2016-04-18 22:44:48-0700 [-] Stopping factory <twisted.internet.protocol.Factory instance at 0x10da9bfc8>

This recursion exception is thrown while chunking a large file and sending 16k blocks as messages through AMP. It happens very erratically. I'll try to put together some test code that exposes it. May be difficult since it seems to be so unpredictable.

using Twisted 16.1.1 , Python 2.7.11 , PyQt 5.5.1

@altendky
Copy link
Member

altendky commented Jan 4, 2017

altendky@a52c0d0

You might try my branch to see if it helps. I had similar issues before that commit. I haven't gotten a response over in #11 so my stuff might be bad in other ways but it did seem like an oversight to not actually exercise the fromqt parameter.

@crwood
Copy link
Collaborator

crwood commented May 17, 2017

Have either of you been able to reproduce this issue reliably, by any chance? I would like to fix it, if possible, but have not yet run into it on my end (and am not sure how to isolate without a good test case).

@jhargis Did you ever end up trying @altendky's branch?

@jhargis
Copy link
Author

jhargis commented May 17, 2017

@crwood No, sorry. I've abandoned it all together. I mentioned it to @glyph in the #twisted irc channel and he took a quick peek and seemed to understand the problem right away but it was beyond me as I don't have intimate working knowledge of the Twisted core. IIRC he mentioned that some technique being used was flatly incorrect. I'd strongly recommend tapping him for insight.

Sorry can't be more helpful on this.

@glyph
Copy link
Member

glyph commented May 17, 2017

Is anyone interested in this problem at PyCon this year?

@crwood
Copy link
Collaborator

crwood commented May 18, 2017

Unfortunately, I will not be. :(

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

No branches or pull requests

4 participants