Eric,
> I hit a bug (segfault) in cntr.c that is likely related to your changes. It
> is ID 2956378 in the tracker.
Attached is a patch file with a fix for this bug. I've also included
a minimal test file to demonstrate the behaviour before and after the
fix, along with a brief explanation which I can expand upon if you
wish.
Ian
Index: src/cntr.c
===================================================================
--- src/cntr.c (revision 8150)
+++ src/cntr.c (working copy)
@@ -605,6 +605,9 @@
}
if (fwd < 0 && level0 && left < 0)
{
+ /* remove J0_START from this boundary edge as boundary is
+ * included by the upwards slit from contour line below. */
+ data[edge] &= ~J0_START;
if (n_kind) kcp[n_kind] += kind_start_slit;
return slit_cutter (site, 0, pass2);
}
#!/usr/bin/env python
#
# Minimal example to demonstrate bug ID 2956378 and its fix.
#
# Bug causes infinite loop leading to segmentation fault. Infinite loop occurs
# as contouring code repeated restarts walking around the edge of a masked
# hole that is linked, via a vertical slit, to the contour line below (with a
# lower j-index). Such a hole should not be a contour starting edge as it is
# included in the contour line that it is slit up from. The solution is to
# prevent such a hole from being a possible contour starting edge by removing
# its J0_START flag.
#
# Bug is only visible if there is at least one other starting edge in the same
# row of the grid, otherwise the erroneous starting edge is ignored.
from pylab import *
z = ones((5,6))
z[2,2] = ma.masked
z[:,-2:] = 0
z[1,-1] = 1 # Force another contour starting edge in the same row.
levels = [0.5, 2]
contourf(z, levels, alpha=0.5)
colorbar()
contour(z, levels)
axis([-0.2, 5.2, -0.2, 4.2])
show()
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel