Opened 4 years ago
Last modified 3 years ago
#1052 new defect
Thread safety: C API contexts use shared GeometryFactory without any refCount synchronization
Reported by: | macdrevx | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 3.11.0 |
Component: | Default | Version: | main |
Severity: | Unassigned | Keywords: | |
Cc: | macdrevx |
Description
The C API's GEOSContextHandle_HS
initializes its geomFactory
fields via
geomFactory = GeometryFactory::getDefaultInstance();
Various operations subsequently utilize the reference counting features of GeometryFactory
without synchronization.
We have observed that this can lead to data races.
It appears as though a corruption of the value in _refCount
could possibly be harmless so long as GeometryFactory::destroy()
is never invoked, thus setting _autoDestroy
to true
. As far as I can tell, destroy()
is never invoked on GeometryFactory
returned from getDefaultInstance()
, so perhaps we're getting lucky so long as we're only using the C API.
Change History (3)
comment:1 by , 4 years ago
Cc: | added |
---|---|
Version: | 3.6.2 → master |
comment:2 by , 3 years ago
Milestone: | → 3.10.0 |
---|
comment:3 by , 3 years ago
Milestone: | 3.10.0 → 3.11.0 |
---|
Retargeting in prep for GEOS 3.10.0 release