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

2020-10-02 Thread GEOS
#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: 
GEOS 
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite 
(JTS).
___
geos-devel mailing list
geos-devel@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/geos-devel

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

2020-09-28 Thread GEOS
#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: 
GEOS 
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite 
(JTS).
___
geos-devel mailing list
geos-devel@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/geos-devel