I've come across an error that has me rather stumped. I was testing some exception handling code and found that my program was crashing with an "Access violation reading location 0x0000000000000000." error in the <ostream> header. Figuring it was probably a problem where I accidentally double delete'd something or forgot to release a handle somewhere I started commenting out code to try and narrow down what is causing it. This is where things got weird. I've been able to reproduce it with a very minimal set of code (still larger than I'd like to post here though...). The thing is if I comment out a few functions that are never run, it will compile and run fine, no errors. If I reintroduce the code (ie. uncomment it), these same functions that are never called and never run, it will produce the error.
I'm currently using VS2012 express edition. I've tried it with both the default toolset and the November CTP toolset (with identical results). I've tried it with both 32 and 64-bit and under both debug and release and all give the same results. I've played with every compiler and linker setting I can think of to no avail.
Anyone have any idea of what I should try next?