You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
matplotlib crashes on OS X when saving to JPEG and then displaying the plot #4194
Assertion failed: (s->stack->next != NULL), function CGGStackRestore, file Context/CGGStack.c, line 77.
The crash does not happen if the savefig and show call are swapped, or when saving to png/pdf/svg file. It only happens when pyplot is called in this sequence, and when the format is jpg.
I could not reproduce this with Python 2.7.9 and matplotlib 1.4.3 on Mac OS X 10.9 or 10.10.
Can you try changing backend_macosx.py to return immediately from _print_bitmap ?
So
Sorry, there is not much I can do as I cannot reproduce this error. I would suggest to remove more of the code in FigureCanvas_write_bitmap and see if the problem disappears at some point.
Activity
tacaswell commentedon Mar 5, 2015
What backend are you using? I suspect the OSX backend from the error. Is that the full error message you get?
I can not reproduce this on py3 + linux + qtagg
attn @mdehoon
netheril96 commentedon Mar 5, 2015
@tacaswell
Yes, it is the MacOSX backend, and the error message is all that I get.
If I manually specify the
aggbackend, it works normally as well. So this is a bug specific to OSX backend.jenshnielsen commentedon Mar 5, 2015
Which Matplotlib version do you use? I could not reproduce this on master (1.5.dev1)
netheril96 commentedon Mar 5, 2015
@jenshnielsen
matplotlib (1.4.3)
Python 2.7.9
Mac OS X backend
mdehoon commentedon Mar 6, 2015
I could not reproduce this with Python 2.7.9 and matplotlib 1.4.3 on Mac OS X 10.9 or 10.10.
Can you try changing backend_macosx.py to return immediately from _print_bitmap ?
So
Then, with some luck, we can find out exactly where the problem is occurring.
netheril96 commentedon Mar 6, 2015
@mdehoon
The error message goes away, and obviously the
jpgis never created.I took the liberty of poking around in that function, and the error occurs in the call
self.write_bitmap(filename, width, height, dpi)Even weirder is that running this script in
ipdbline by line does not produce any error, and does produce a correctjpegfile.mdehoon commentedon Mar 6, 2015
I am guessing that these two lines:
in the function FigureCanvas_write_bitmap in _macosx.m are causing the problem. Can you try moving these two lines down to just before
, recompile, and see if the problem still occurs?
netheril96 commentedon Mar 6, 2015
@mdehoon
The problem still occurs after the change and recompile/reinstallation.
Deleting that two release calls doesn't help, either.
netheril96 commentedon Mar 6, 2015
@mdehoon
I also tried recompiling python as well as installing matplotlib from this git repository. The assertion failure is still there.
mdehoon commentedon Mar 6, 2015
Sorry, there is not much I can do as I cannot reproduce this error. I would suggest to remove more of the code in FigureCanvas_write_bitmap and see if the problem disappears at some point.
mdboom commentedon Mar 21, 2016
Possibly fixed by #6178, but since we're having trouble reproducing, it's hard to say.