[GEOS] #1052: Thread safety: C API contexts use shared GeometryFactory without any refCount synchronization

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[GEOS] #1052: Thread safety: C API contexts use shared GeometryFactory without any refCount synchronization

geos-2
#1052: Thread safety: C API contexts use shared GeometryFactory without any
refCount synchronization
------------------------+--------------------------
 Reporter:  macdrevx    |      Owner:  geos-devel@…
     Type:  defect      |     Status:  new
 Priority:  major       |  Milestone:
Component:  Default     |    Version:  3.6.2
 Severity:  Unassigned  |   Keywords:
------------------------+--------------------------
 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
 [https://github.com/GEOSwift/GEOSwift/issues/190#issuecomment-699502839
 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.

--
Ticket URL: <https://trac.osgeo.org/geos/ticket/1052>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).

_______________________________________________
geos-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geos-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GEOS] #1052: Thread safety: C API contexts use shared GeometryFactory without any refCount synchronization

geos-2
#1052: Thread safety: C API contexts use shared GeometryFactory without any
refCount synchronization
------------------------+---------------------------
 Reporter:  macdrevx    |       Owner:  geos-devel@…
     Type:  defect      |      Status:  new
 Priority:  major       |   Milestone:
Component:  Default     |     Version:  master
 Severity:  Unassigned  |  Resolution:
 Keywords:              |
------------------------+---------------------------
Changes (by macdrevx):

 * cc: macdrevx (added)
 * version:  3.6.2 => master


--
Ticket URL: <https://trac.osgeo.org/geos/ticket/1052#comment:1>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).

_______________________________________________
geos-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geos-devel