Skip to content

Segmentation fault inside _backend_agg.so #7050

Closed
@ngoldbaum

Description

@ngoldbaum

This came up in the context of the yt test suite. To reproduce it using the test script I've include here requires yt 3.3.1 or the latest development version of yt to be installed. We regularly trigger this during our test suite which uses matplotlib 1.5.1.

import numpy as np
import yt
from yt.testing import fake_tetrahedral_ds
from yt.testing import fake_hexahedral_ds

np.random.seed(0x4d3d3d3)

ds = fake_hexahedral_ds()
idir = 2
for field in ds.field_list:
    sl = yt.SlicePlot(ds, idir, field)
    sl.annotate_mesh_lines()
    sl.save()

The stack trace I get back from the apple crash reporter consists only of calls to (including just the first three)

0   _backend_agg.so                   0x0000000148a37cbf agg::rasterizer_cells_aa<agg::cell_aa>::line(int, int, int, int) + 31
1   _backend_agg.so                   0x0000000148a37cfd agg::rasterizer_cells_aa<agg::cell_aa>::line(int, int, int, int) + 93
2   _backend_agg.so                   0x0000000148a37cfd agg::rasterizer_cells_aa<agg::cell_aa>::line(int, int, int, int) + 93

In addition, we were able to capture this in GDB and get a python traceback as well: https://gist.github.com/ngoldbaum/7538f71644ec4248b41d9d0d1f6bef34

Note that the seg fault does not happen every time you run the test script. I've been able to trigger it by running e.g. this bash for loop:

for i in {0..100} ; do python test.py ; echo $i ; done

Finally, I tried updating matplotlib to 2.0b3 from the prerelease wheels on pypi, and that seems to have fixed it? I'm going to try running the test script 1000 times to see if I can reproduce on matplotlib 2.0b3, but if I can't then maybe this is already fixed upstream.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions