Skip to content
New issue

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

SIGSEV when using GEOSCoordSeq_destroy_r #247

Closed
furstenheim-geoblink opened this issue Nov 7, 2019 · 1 comment
Closed

SIGSEV when using GEOSCoordSeq_destroy_r #247

furstenheim-geoblink opened this issue Nov 7, 2019 · 1 comment

Comments

@furstenheim-geoblink
Copy link

Hi,
I'm using geos in golang using a wrapper. I'm getting a SIGSEV because of destroy coordseq.
Not exactly the code but I'm doing something like:

*GeosGeometry g;
// define g somehow
r = GEOSGetExteriorRing_r(handle, g);
seq = GEOSGeom_getCoordSeq_r(handle, r);
GEOSCoordSeq_destroy_r(handle, seq);
GEOSGeom_destroy_r(handle, g);

As I said, this is not exactly the code since I'm using go, but those are the calls to the Geos library.
If I comment GEOSCoordSeq_destroy_r then I don't get the SIGSEV. Is the coordseq using an internal memory from the polygon? In the case of Exterior Ring it is, but it is documented in the headers file geos_c.h.

I'm using version 3.9.0dev

Thanks

@dbaston
Copy link
Member

dbaston commented Nov 7, 2019

Yes, the coordseq is owned by the polygon, which is why GEOSGeom_getCoordSeq_r returns a const pointer. It's surprising that you're able to call GEOSCoordSeq_destroy_r on it at all. I guess the wrapper is removing the const-ness somehow.

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

No branches or pull requests

2 participants