I'm not sure what the reference about _SECURE_SCL_
you found said, but I've had really crazy and hard to debug problems when linking code having different values for this variable and the results are very similar to the ones you describe.
What I guess happen is that the stl libraries symbols look identical regardless of what _SECURE_SCL_
is defined to. However some data structure sizes or other important things seems to change. Since stl code tends to be inlined, duplicate symbols may be present during linking. When the compiler decide not to inline a function call the linker can choose any of the versions it finds and if it happens to use the one where _SECURE_SCL_
has a different value than yours you get random crashes in situations like the one you described.
And, yes I've seen libraries distributed as static libraries (as opposed to source code) causing my code to crash because of this.
So if you find no more reasonable explanation for your crash, make sure the variable is set to the same value in all libraries you use that uses stl.
This might not be the cause of your problem, but it's really one of the most annoying and hard to debug problems I've run into in a long time so when you gave me a post to whine about it, I couldn't restrain myself :)
Good luck