netgen/ng
Monty Montgomery de7ffc5906 Eliminate a "C++ initialization order fiasco" for geometryregister
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.
2022-05-22 11:29:10 -04:00
..
Togl2.1 fix tcl/tk build flags 2022-05-05 18:08:29 +02:00
Togl-1.7 Fix various typos 2022-03-25 18:22:05 -04:00
acisgeom.tcl parallel / non parallel 2011-07-15 08:04:25 +00:00
CMakeLists.txt fix ngsolve loading 2022-05-07 15:13:35 +02:00
csgeom.tcl Fix various typos 2022-03-25 18:22:05 -04:00
demoview.cpp Remove redundant declaration 2019-12-10 14:10:18 +01:00
demoview.hpp Rename Array to NgArray 2019-07-09 10:39:16 +02:00
dialog.tcl Fix various typos 2022-03-25 18:22:05 -04:00
drawing_togl17.tcl allow 2d plainview to be moved using meta key 2019-09-22 14:37:14 +02:00
drawing.tcl allow 2d plainview to be moved using meta key 2019-09-22 14:37:14 +02:00
encoding.hpp fix warnings, remove deprecated function call 2019-08-28 16:19:12 +02:00
fonts.hpp [gl] fix for ListBase (thx to Alexander Schlueter) 2016-04-24 22:11:42 +02:00
gui.cpp pip installer 2021-10-27 16:51:41 +02:00
menustat.tcl Fix various typos 2022-03-25 18:22:05 -04:00
netgen.ocf * More documentation within the netgen.ocf file 2009-10-04 15:20:56 +00:00
netgenpy.cpp Don't load gui libraries when importing netgen 2022-05-06 10:59:59 +02:00
ng_acis.hpp autotools 2009-01-12 23:40:13 +00:00
ng.tcl rework build system, separate gui and non-gui code 2022-05-05 14:39:31 +02:00
ngappinit.cpp MPI unification 2022-04-26 22:07:31 +02:00
ngguipy.cpp rework build system, separate gui and non-gui code 2022-05-05 14:39:31 +02:00
nghelp.tcl Misc. typos 2017-12-09 22:21:40 -05:00
ngicon.tcl adding tcl - files 2009-01-17 20:52:26 +00:00
ngpkg.cpp Eliminate a "C++ initialization order fiasco" for geometryregister 2022-05-22 11:29:10 -04:00
ngshell.tcl Misc. typo fixes 2017-07-25 23:29:41 -04:00
ngtcl.cpp netgen-std includes before tcl 2022-05-07 20:40:40 +02:00
ngtesting.tcl Misc. typo fixes 2017-07-25 23:29:41 -04:00
ngvisual.tcl allow changing number of colors in colorbar 2021-10-06 16:01:48 +02:00
occgeom.tcl fixes in occ geometry dialog 2016-11-12 02:27:13 +01:00
onetcl.cpp rework build system, separate gui and non-gui code 2022-05-05 14:39:31 +02:00
onetcl.py DLL_HEADER in onetcl 2020-03-02 16:56:46 +00:00
parallelfunc.cpp MPI unification 2022-04-26 22:07:31 +02:00
parallelfunc.hpp parallel command processing 2012-07-05 11:05:33 +00:00
parameters.tcl * Converted the minimum edge length used for subdividing geometry edges during the meshing phase into a user defined parameter accessible from the GUI 2014-01-25 21:17:16 +00:00
sockets.tcl Removed socket entry from special menu 2016-11-10 11:45:06 +01:00
stlgeom.tcl fix geom2d/stl init 2015-10-19 13:49:09 +02:00
togl_1_7.h DLL_HEADER, togl include 2015-01-16 10:29:25 +00:00
variables.tcl allow changing number of colors in colorbar 2021-10-06 16:01:48 +02:00