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

Segmentation Fault (core dumped) when running on large polygons #18

Open
tronxd opened this issue Apr 26, 2015 · 12 comments
Open

Segmentation Fault (core dumped) when running on large polygons #18

tronxd opened this issue Apr 26, 2015 · 12 comments
Assignees

Comments

@tronxd
Copy link

tronxd commented Apr 26, 2015

when running at your dataset (Data/CLC2006_180927.geojson)
prepair --ogr CLC2006_180927.geojson
I get a segmentation fault (core dumped)
(small polygons are ok)
DETAILS:
branch: master:
OS: RHEL 6.2 (Santiago)
compiled by gcc 4.4.7
Boost 1.41.0
CGAL 4.6

@kenohori
Copy link
Member

Thanks for the report! I'm quite busy at the moment, but I'll install Red Hat in a VM to debug it when I can.

However, my best guess would be that there is a problem with the GMP or MPFR libraries, which are needed for exact arithmetic. Did you compile them yourself or got them from a repository? In RPM perhaps?

@tronxd
Copy link
Author

tronxd commented May 1, 2015

Hello Ken,
These libraries were installed from a Yum repository.

@aj7
Copy link

aj7 commented Jul 27, 2017

any ideas on this? i am also getting the same

@entranOA
Copy link

entranOA commented Apr 5, 2018

Any updates on this issue? I'm having the same issue while trying to prepair polygons that span the entirety of the USA land boundary.

@kenohori
Copy link
Member

kenohori commented Apr 5, 2018

Sorry, but it wasn't a trivial thing to debug and I've been busy with other projects. I'll have another look at it.

@kenohori kenohori self-assigned this Apr 5, 2018
@entranOA
Copy link

entranOA commented Apr 6, 2018

Thank you! I was using the improvements-with-ogr branch.

@1riggs
Copy link

1riggs commented Jul 13, 2018

I ran into the same issue with the improvements-with-ogr branch, that it was producing a segmentation fault when processing large/complex polygons. After some investigation, it appeared the cause was a certain malloc call, which results in a stack overflow. I circumvented the issue by setting the core file size (I don't think core file size change is necessary, but haven't tried it without it) and the stack size to unlimited. I was able to process the polygons which were previously resulting in the aforementioned error.

@albanm
Copy link

albanm commented Sep 11, 2018

@AlexRiggs how did you increase the stack size to unlimited ? On ubuntu I tried using "ulimit -s", it didn't fix the problem, I don't know if it is the right command.

@1riggs
Copy link

1riggs commented Sep 11, 2018

@albanm the commands I used are as follows:

ulimit -c unlimited
ulimit -s unlimited
ulimit -a

the -a flag just displays the ulimit settings, use it to verify the changes. Hope this helps!

@albanm
Copy link

albanm commented Sep 11, 2018

Thanks! Unfortunately it seems that my problem is not related to the polygon size.

After closer inspection it happens on a small broken polygon (4 points including 2 duplicates).

@1riggs
Copy link

1riggs commented Sep 11, 2018 via email

@albanm
Copy link

albanm commented Sep 11, 2018

It is alright in the end, this polygon is actually impossible to repair in my opinion and it is just one in many in a large dataset. So I just catch the error, log it, consider that I did the best I could and go on to the next feature. I use prepair as well as turfjs' cleanCoords and rewind, and it seems that almost all features are clean afterwards.

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

6 participants