GeezerVison is showing github.com — segfault: fill_between with Python3 · Issue #4210 · matplotlib/matplotlib
segfault: fill_between with Python3 #4210DescriptionI'm getting a reproducible segfault using fill_between in Python 3, but not Python 2, on Ubuntu 12.04 but not on MacOS (these are slightly different versions of Python3/matplotlib, and the Ubuntu is sitting in a virtual box/on a virtual filesystem).
I can try to update my Python3 version, but I'm curious whether anyone else has seen this.
Linux: ubuntu-10-new 3.2.0-77-generic-pae #112-Ubuntu, Python3 version 3.2.3 (matplotlib 1.5.dev1), Python 2.7.3 (matplotlib 1.1.1rc)
MacOS: 10.9.5 (13.4.0 Darwin Kernel Version 13.4.0), Python3 3.4.2 (matplotlib 1.4.2), Python 2.7.3 (matplotlib 1.1.1)
import numpy as np
from matplotlib import pyplot as plt
def u(t,shift=0):
b = np.logical_and(shift<t,t<(1+shift))
return(b.astype(float))
t = np.arange(0,2,1/40.)
plt.plot(t,u(t),color="red")
plt.ylim(0,1.25)
plt.xlim(-1,3)
plt.fill_between(t,u(t),facecolor="red",alpha=0.5)
plt.plot(t,u(t,0.75),color="blue")
plt.fill_between(t,u(t,0.75),facecolor="blue",alpha=0.5)
plt.savefig("fill_between.png")
Activityjenshnielsen commented on Mar 11, 2015 Which version of matplotlib? I cannot reproduce it with Matplotlib 1.4.3 on Conda (Python 3.4.3) on Ubuntu 14.04 bbolker commented on Mar 11, 2015 1.5.dev1 (I edited my report above to include all the matplotlib versions) [I'm not sure how I ended up with development version!] mdboom commented on Mar 11, 2015 I'm having trouble reproducing this. Do you know the githash of the development version of matplotlib you are running? (1.5.dev1 doesn't uniquely identify a version, but just means it's "current git master"). I think it's possible this bug has already been fixed. bbolker commented on Mar 11, 2015 still getting segfault with latest version installed (after a bit of struggle). This is on a 32-bit (virtual) system, I wonder if there's a possibility that that's the issue? mdboom commented on Mar 11, 2015 Ah -- I didn't try on a 32-bit system. Let's see if that helps me reproduce. mdboom commented on Mar 11, 2015 I tried to replicate your environment as best I could -- Debian 32-bit, Python 3.2.3, matplotlib master. Still can't reproduce. What version of Numpy is involved here? bbolker commented on Mar 11, 2015 1.9.1 . Sorry this is such a hassle. I can live without it as long as it's not causing anyone else any trouble ... added this to the This milestone has been deleted milestone on Mar 11, 2015mdboom commented on Mar 11, 2015 Hmm... I was using the same Numpy. So I guess it remains a mystery.
If you're able to get a traceback from gdb for the segfault that might help.
Short instructions:
gdb `which python3`
run /path/to/example_script
bt
bbolker commented on Mar 11, 2015 gdb output:
Starting program: /usr/bin/python3 ~/classes/math1mp3/math1mp/notes/fill_between.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
[New Thread 0xb6579b40 (LWP 11674)]
Program received signal SIGSEGV, Segmentation fault.
agg::rasterizer_cells_aa<agg::cell_aa>::line (this=0xa3f550c, x1=715827882,
y1=-90721, x2=713031679, y2=-90721)
at extern/agg24-svn/include/agg_rasterizer_cells_aa.h:320
320 void rasterizer_cells_aa<Cell>::line(int x1, int y1, int x2, int y2)
Beginning of backtrace:
#0 agg::rasterizer_cells_aa<agg::cell_aa>::line (this=0xa3f550c,
x1=715827882, y1=-90721, x2=713031679, y2=-90721)
at extern/agg24-svn/include/agg_rasterizer_cells_aa.h:320
#1 0xb5d37c5e in agg::rasterizer_cells_aa<agg::cell_aa>::line (
this=0xa3f550c, x1=715827882, y1=-90721, x2=710235476, y2=-90721)
at extern/agg24-svn/include/agg_rasterizer_cells_aa.h:330
#2 0xb5d37c5e in agg::rasterizer_cells_aa<agg::cell_aa>::line (
this=0xa3f550c, x1=715827882, y1=-90721, x2=704643071, y2=-90721)
at extern/agg24-svn/include/agg_rasterizer_cells_aa.h:330
#3 0xb5d37c5e in agg::rasterizer_cells_aa<agg::cell_aa>::line (
this=0xa3f550c, x1=715827882, y1=-90721, x2=693458260, y2=-90721)
at extern/agg24-svn/include/agg_rasterizer_cells_aa.h:330
#4 0xb5d37c5e in agg::rasterizer_cells_aa<agg::cell_aa>::line (
this=0xa3f550c, x1=715827882, y1=-90721, x2=671088639, y2=-90721)
at extern/agg24-svn/include/agg_rasterizer_cells_aa.h:330
#5 0xb5d37c5e in agg::rasterizer_cells_aa<agg::cell_aa>::line (
this=0xa3f550c, x1=715827882, y1=-90721, x2=626349396, y2=-90721)
at extern/agg24-svn/include/agg_rasterizer_cells_aa.h:330
#6 0xb5d37c5e in agg::rasterizer_cells_aa<agg::cell_aa>::line (
this=0xa3f550c, x1=715827882, y1=-90721, x2=536870911, y2=-90721)
at extern/agg24-svn/include/agg_rasterizer_cells_aa.h:330
#7 0xb5d37c5e in agg::rasterizer_cells_aa<agg::cell_aa>::line (
... seems to go on nearly identically for a long time after this.
I'm happy to continue with this if it's helpful or drop it if it's not. tacaswell commented on Mar 12, 2015 Can you try deleting everything about your mpl install and the re-installing from current master? I am a bit worried that what is happening is that you have a mixture of old and new c++ extensions (as you commented you were unsure on how the dev version got installed) that are stepping on each other's toes. bbolker commented on Mar 12, 2015 I will try; I may not have time for a couple of days (thanks for your patience). modified the milestones: This milestone has been deleted, This milestone has been deleted on Oct 26, 2015QuLogic commented on Jan 7, 2016 tacaswell commented on Feb 15, 2016 Closing due to inactivity and this not failing on travis.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|