I've been stuck trying to investigate a very strange program crash. The stack trace basically look like this
msvcr100.dll!malloc(unsigned int size) Line 89 C
msvcr100.dll!operator new(unsigned int size) Line 59 C++
msvcp100.dll!std::num_put<char,std::ostreambuf_iterator<char,std::char_traits<char> > >::_Getcat(const std::locale::facet * * _Ppf, const std::locale * _Ploc) Line 1054 C++
msvcp100.dll!std::use_facet<std::num_put<char,std::ostreambuf_iterator<char,std::char_traits<char> > > >(const std::locale & _Loc) Line 518 C++
msvcp100.dll!std::basic_ostream<char,std::char_traits<char> >::operator<<(int) Line 287 C++
What comes next after that is a line from my code which is just a simple cout << operator to print an integer
cout << "Error is " << ret << endl;
I can't work out what causes this crash. I knew I'm not running out of memory since the process only uses only around 2000 kbytes right before crashing.
Since it's only printing a local integer variable, I don't see illegal memory access involved either.
Program was compiled with Visual Studio 2010 (v100) with Win32 Release profile and I've confirmed the production server has Microsoft Visual C++ 2010 x86 Redistributable installed.
Where else should I look for clues for the cause of this?