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

Spyder crashing on very long output #2251

Closed
michalgregor opened this issue Mar 16, 2015 · 1 comment · Fixed by #2253
Closed

Spyder crashing on very long output #2251

michalgregor opened this issue Mar 16, 2015 · 1 comment · Fixed by #2253

Comments

@michalgregor
Copy link
Contributor

Spyder Version: 2.3.0rc
Python Version: 3.4.0
Qt Version : 4.8.6, PyQt4 (API v2) 4.10.4 on Linux
pyflakes >=0.6.0: 0.8.1 (OK)
pep8 >=0.6 : 1.4.6 (OK)
IPython >=0.13 : None (NOK)
pygments >=1.6 : 1.6 (OK)
sphinx >=0.6.6 : 1.2.3 (OK)
psutil >=0.3 : 1.2.1 (OK)
rope >=0.9.2 : 0.9.3 (OK)
matplotlib >=1.0: 1.4.3 (OK)
pylint >=0.25 : 1.1.0 (OK)

What steps will reproduce the problem?

  1. Run a script that produces very long output within a short timespan.
    (E.g. theanets do a lot of logging when learning – like hundreds of lines being written into the output all within a few seconds.)
  2. Watch spyder crash.

The expected behaviour is not to crash, but display the output.

I am attaching the trace that gets printed upon the crash. A stack overflow of some sort seems to be going on.

Also – I can fix the problem by commenting out line 276 in spyderlib/widgets/externalshell/baseshell.py:

def write_output(self):
    self.shell.write(self.get_stdout(), flush=True)
    #QApplication.processEvents()

Is it really absolutely necessary to call processEvents on every write? I mean, surely the updates will get drawn in the next update of the GUI regardless of whether we do this.

I am attaching a patch which removes the line in case you may find the solution acceptable.

@ccordoba12 ccordoba12 added this to the v2.4 milestone Mar 16, 2015
@ccordoba12
Copy link
Member

@michalgregor, thanks a lot for taking the time to post your issue report here. Unfortunately, your patch is unreadable because you changed the end-of-lines of baseshell.py, and so the patch is equivalent to the entire file! :-)

Could you open a pull request with your changes so that it is easier for us to review and merge it?

Besides, your links (i.e. trace and patch) are giving 404 errors on Google Code. I'd suggest to post the traceback here (or as a gist, if it's too long) and remove the link to patch.

michalgregor added a commit to michalgregor/spyder that referenced this issue Mar 16, 2015
Fixing crashes on very long output being written to the console in a short time.  spyder-ide#2251
michalgregor added a commit to michalgregor/spyder that referenced this issue Jun 18, 2016
Nodd added a commit that referenced this issue Jun 30, 2016
Added QMutex protection to write_output as a workaround for issue #2251
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