geos icon indicating copy to clipboard operation
geos copied to clipboard

`GEOS_init_r` writes to shared data without thread synchronization

Open ChrisThrasher opened this issue 3 months ago • 2 comments

I'm getting ThreadSanitizer failures when calling GEOS_init_r concurrently from multiple threads. The problem comes down to geom::util::Interrupt::cancel which is writing to a global variable called requested in src/geos/util/Interrupt.cpp without any thread synchronization. Is GEOS_init_r meant to be thread-safe or do users need to do their own synchronization to prevent data races? I suspect fixing this could be as simple as using std::atomic_flag for the requested variable.

ChrisThrasher avatar Oct 08 '25 17:10 ChrisThrasher

Did you try that fix?

pramsey avatar Dec 05 '25 19:12 pramsey

No I did not

ChrisThrasher avatar Dec 05 '25 20:12 ChrisThrasher