8000 segfault: fill_between with Python3 · Issue #4210 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

segfault: fill_between with Python3 #4210

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintaine 8000 rs 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

Closed
bbolker opened this issue Mar 11, 2015 · 13 comments
Closed

segfault: fill_between with Python3 #4210

bbolker opened this issue Mar 11, 2015 · 13 comments
Milestone

Comments

@bbolker
Copy link
bbolker commented Mar 11, 2015

I'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")
@jenshnielsen
Copy link
Member

Which version of matplotlib? I cannot reproduce it with Matplotlib 1.4.3 on Conda (Python 3.4.3) on Ubuntu 14.04

@bbolker
Copy link
Author
bbolker commented 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 mdboom self-assigned this Mar 11, 2015
@mdboom
Copy link
Member
mdboom commented 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
Copy link
Author
bbolker commented 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 mdboom removed their assignment Mar 11, 2015
@mdboom
Copy link
Member
mdboom commented Mar 11, 2015

Ah -- I didn't try on a 32-bit system. Let's see if that helps me reproduce.

@mdboom
Copy link
Member
mdboom commented 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
Copy link
Author
bbolker commented 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 ...

@tacaswell tacaswell added this to the Color overhaul milestone Mar 11, 2015
@mdboom
Copy link
Member
mdboom commented 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
Copy link
Author
bbolker commented 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
Copy link
Member
8000

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
Copy link
Author
bbolker commented Mar 12, 2015

I will try; I may not have time for a couple of days (thanks for your patience).

@tacaswell tacaswell modified the milestones: Color overhaul, next major release (2.0) Oct 26, 2015
@QuLogic
Copy link
Member
QuLogic commented Jan 7, 2016

Ping?

@tacaswell
Copy link
Member

Closing due to inactivity and this not failing on travis.

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

No branches or pull requests

5 participants
0