-
Notifications
You must be signed in to change notification settings - Fork 171
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
Race Condition in GEOS in v6 #192
Comments
Looks like both threads are creating a new GEOS context. My understanding is that this is supposed to be thread-safe.
|
Opened a ticket with the geos project: https://trac.osgeo.org/geos/ticket/1012 |
@ssokol I have some good news and some bad news. First, the bad news: Our understanding of the root cause of the data race is correct. Multiple threads modify a shared value without synchronization. This would have to be fixed in GEOS. The impact is that if multiple threads try to use the interrupt mechanism simultaneously, there could be problems. The good news is that GEOSwift doesn't ever request interrupts, so in practice, I think you should be okay apart from the annoyance of having to see these warnings. If we ever had a need to expose the ability to cancel long-running operations, then this would definitely be an issue. I'll continue discussing the issue with the GEOS folks to see if we can come up with a solution for a future release of GEOS. |
Thanks for the update. I believe you are correct - I've not actually seen a crash that I can directly link to this. Please let me know if I can provide any additional information to you or to the GEOS team. I'll be happy to test updates as they become available. |
I'm going to go ahead and close this since there's no immediate risk caused by this issue. Hopefully a future version of GEOS resolves it. |
As an FYI - I'm also getting a race condition on the addRef() function in GeometryFactory.cpp. Looks like the read call came from Polygon.geosObject(with:) while a write call happened when a polygon was created from WKT. No crash - just the warning from the sanitizer. |
@ssokol can you share the stack traces for those too? We can open another issue with GEOS |
Just upgraded to v6 in an attempt to placate the Thread Sanitizer, which was finding race conditions in GEOS in v4. I seem to still be hitting them in v6 - not sure if this is something specific to my code or if there are still issues with the limited use of GEOS in the new version.
Specifically, the issue appears to be happening in the geos::util::Interrupt::cancel() method. Here's the full dump from the sanitizer:
Any suggestions?
Thanks!
The text was updated successfully, but these errors were encountered: