Open jamesu opened 10 years ago
Huh. Were you asking about this on IRC today? I'm going to guess that unit tests would not necessarily cover this since we're talking about globals? (I don't actually know how interned strings work. Time to do some research.) Thinking in the context of this sort of thing (automated memory leak checks) which I am pushing to get included in stock T3D unit testing when we move to gtest.
Just wanted to say thanks for all these reports! I wish we were quicker at responding to them - you just report very daunting-sounding issues :P.
Yeah, it also seems this may be related to linker order, or it could be that OSX deals with shared library's differently when terminating. This bug seems to have started cropping up when we moved to a single .app build on OSX.
In a release build on OSX, (xcode 5.1.1), when global intern'd string (such as the GFX Semantics) is released upon shutdown memory corruption can occur. Specifically it seems the associated StringData is corrupted leading to a crash. This may propagate to other systems creating odd behaviour in random locations.
Adding a check such as follows seems to "fix" the problem
I'm still not too sure why this problem is occurring in the first place since adding watchpoints on the relevant memory addresses seems to indicate nothing is amiss, although I find it a little odd that the engine is creating a whole bunch of objects with allocated memory before the engine is initialized.