<p>Checked the cmake scripts and dll dependencies - all seems to be correct, /MD or /MDd flags are used in geos and osm2pgsql (multi-threaded runtime with thread-safe malloc). Tried older Geos 3.4.2 from git and also geos from <a href="https://github.com/mapbox/windows-builds">https://github.com/mapbox/windows-builds</a> (built without cmake, release build).</p>
<p>C++ geos seems to be not thread-safe, only the C functions have _r variants. Are there any converter objects that we are using together from multiple threads?</p>
<p>I thought it may be cross-thread stack access problems <a href="https://software.intel.com/en-us/node/595554">https://software.intel.com/en-us/node/595554</a> but the stack variables we pass by references seem to be created in same thread we use it: <a href="https://github.com/openstreetmap/osm2pgsql/blob/70b27884eabbdf43ccaf71d4a92d1daa5e30556f/output-pgsql.cpp#L309">https://github.com/openstreetmap/osm2pgsql/blob/70b27884eabbdf43ccaf71d4a92d1daa5e30556f/output-pgsql.cpp#L309</a> </p>
<p>Will try to run at work under Intel Inspector. It should tell if there are any thread-related problems left.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/openstreetmap/osm2pgsql/pull/498#issuecomment-155357227">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AD2-7jNW0l1kyE7McJyaB377BBDaa13Mks5pEaKIgaJpZM4GeIs1.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="url" href="https://github.com/openstreetmap/osm2pgsql/pull/498#issuecomment-155357227"></link>
<meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>