<div dir="ltr"><div>Hi!</div><div><br></div><div>Can the GEOSPreparedIntersects_r function be called in parallel? For distinct Geometries in each call (reentrant)?</div><div><br></div><div>I'm trying to implement a parallel intersection check (spatial join), but I'm receiving some EXC_BAD_ACCESS and ": pointer being freed was not allocated". Partial stack below.</div>
<div><br></div><div>Those errors don't happen when I replace GEOSPreparedIntersects_r by GEOSIntersects_r in the same parallel code.</div><div><br></div><div>Stack sample 1:</div><div>------------------------------------------------------------------------------------------------------</div>
<div><div>* thread #2: tid = 0x36079, 0x0000000105730a40, stop reason = EXC_BAD_ACCESS (code=2, address=0x105730a40)</div><div>  * frame #0: 0x0000000105730a40</div><div>    frame #1: 0x00000001001e3c87 libgeos-3.4.2.dylib`geos::noding::MCIndexSegmentSetMutualIntersector::intersectChains() + 225</div>
<div>    frame #2: 0x00000001001e163e libgeos-3.4.2.dylib`geos::noding::FastSegmentSetIntersectionFinder::intersects(std::__1::vector<geos::noding::SegmentString const*, std::__1::allocator<geos::noding::SegmentString const*> >*) + 84</div>
<div>    frame #3: 0x00000001001ba1f1 libgeos-3.4.2.dylib`geos::geom::prep::PreparedPolygonIntersects::intersects(geos::geom::Geometry const*) + 131</div><div>    frame #4: 0x00000001001b9f79 libgeos-3.4.2.dylib`geos::geom::prep::PreparedPolygon::intersects(geos::geom::Geometry const*) const + 155</div>
<div>    frame #5: 0x0000000100313006 libgeos_c.1.dylib`GEOSPreparedIntersects_r + 48</div><div>    frame #6: 0x0000000100028208 geosystem`threaded_refine_rj(ctx=refine_context at 0x0000000106080a00) + 856 at rtree-pjoin-rj.cpp:171</div>
<div>...</div><div>------------------------------------------------------------------------------------------------------<br></div><div><br></div><div>Stack sample 2:</div><div>------------------------------------------------------------------------------------------------------<br>
</div><div><div>* thread #2: tid = 0x3b0ff, 0x00007fff9056cbc0 libsystem_malloc.dylib`malloc_error_break, stop reason = breakpoint 2.1</div><div>  * frame #0: 0x00007fff9056cbc0 libsystem_malloc.dylib`malloc_error_break</div>
<div>    frame #1: 0x00007fff9056e028 libsystem_malloc.dylib`free + 324</div><div>    frame #2: 0x00000001001d2c43 libgeos-3.4.2.dylib`geos::index::intervalrtree::SortedPackedIntervalRTree::buildTree() + 163</div><div>    frame #3: 0x00000001001d3004 libgeos-3.4.2.dylib`geos::index::intervalrtree::SortedPackedIntervalRTree::query(double, double, geos::index::ItemVisitor*) + 44</div>
<div>    frame #4: 0x000000010019e6db libgeos-3.4.2.dylib`geos::algorithm::locate::IndexedPointInAreaLocator::locate(geos::geom::Coordinate const*) + 67</div><div>    frame #5: 0x00000001001ba48a libgeos-3.4.2.dylib`geos::geom::prep::PreparedPolygonPredicate::isAnyTestComponentInTarget(geos::geom::Geometry const*) const + 132</div>
<div>    frame #6: 0x00000001001ba18a libgeos-3.4.2.dylib`geos::geom::prep::PreparedPolygonIntersects::intersects(geos::geom::Geometry const*) + 28</div><div>    frame #7: 0x00000001001b9f79 libgeos-3.4.2.dylib`geos::geom::prep::PreparedPolygon::intersects(geos::geom::Geometry const*) const + 155</div>
<div>    frame #8: 0x0000000100313006 libgeos_c.1.dylib`GEOSPreparedIntersects_r + 48</div><div>    frame #9: 0x0000000100028208 geosystem`threaded_refine_rj(ctx=refine_context at 0x0000000106103a00) + 856 at rtree-pjoin-rj.cpp:171</div>
</div><div>------------------------------------------------------------------------------------------------------<br></div><div><br></div><div><br></div><div><div dir="ltr"><div style="font-family:arial;font-size:small">-- </div>
<div style="font-family:arial;font-size:small">Thiago Borges</div></div></div>
</div></div>