Crash in loadlocale()
I am porting a C++ app from Windows to OSX (10.6.8) and I'm getting a seemingly
thread related crash in std::ostream::operator<<(). The function loadlocale crashes with
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000004
Any ideas why this might be happening?
Here are the relevant stack traces.
Thread 5 Crashed:
0 libSystem.B.dylib 0x9824ab85 __numeric_load_locale + 133
1 libSystem.B.dylib 0x98178599 loadlocale + 308
2 libstdc++.6.dylib 0x9aa14205 std::__convert_from_v(int* const&, char*, int, char const*, ...) + 143
3 libstdc++.6.dylib 0x9aa0db5e std::ostreambuf_iterator<char, std::char_traits<char> > std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::_M_insert_float<double>(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, char, double) const + 192
4 libstdc++.6.dylib 0x9aa0ddb4 std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::do_put(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, double) const + 64
5 libstdc++.6.dylib 0x9aa08583 std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::put(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, double) const + 59
6 libstdc++.6.dylib 0x9aa169dd std::ostream& std::ostream::_M_insert<double>(double) + 181
7 libstdc++.6.dylib 0x9aa16a76 std::ostream::operator<<(float) + 28
...
Thread 6:
0 libSystem.B.dylib 0x98148e0a open$NOCANCEL$UNIX2003 + 10
1 libSystem.B.dylib 0x9824b46b __part_load_locale + 204
2 libSystem.B.dylib 0x9824acf0 __numeric_load_locale + 496
3 libSystem.B.dylib 0x98178599 loadlocale + 308
4 libstdc++.6.dylib 0x9aa1423e std::__convert_from_v(int* const&, char*, int, char const*, ...) + 200
5 libstdc++.6.dylib 0x9aa0db5e std::ostreambuf_iterator<char, std::char_traits<char> > std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::_M_insert_float<double>(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, char, double) const + 192
6 libstdc++.6.dylib 0x9aa0ddb4 std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::do_put(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, double) const + 64
7 libstdc++.6.dylib 0x9aa08583 std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::put(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, double) const + 59
8 libstdc++.6.dylib 0x9aa169dd std::ostream& std::ostream::_M_insert<double>(double) + 181
Glenn