mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-28 23:00:34 +05:00
de7ffc5906
Current initialization of the global geometryregister suffers from a classic 'initialization order fiasco'. Depending on the order the compilation units are loaded/linked, the initialization of the global geometryregisterarray is not guaranteed to happen (and indeed often does not happen) before it is used. This leads to entries being appended before it's initialized (usually 'suceeding, but potentially causing memory corruption if the segment at that point isn't zeroed), initialization then happening halfway through (wiping the initial entries) and then the last entries being the only ones that show up. The net effect is either a crash at startup, or several geometry types seeming to be missing. Eg, step files will oad, but STL files are just ignored. The bug is actively observed on, eg, Linux. This patch implements a simple 'initialize at first access' convention for the array, eliminating the ordering problem. I've not reviewed the rest of the source for other potential examples of the fiasco pattern; this fixes only the geometryregister, since that was actively biting. |
||
---|---|---|
.. | ||
core | ||
csg | ||
general | ||
geom2d | ||
gprim | ||
include | ||
interface | ||
linalg | ||
meshing | ||
occ | ||
stlgeom | ||
visualization | ||
CMakeLists.txt |