出于某种原因,仅在调试模式下(带flages -g3)我有Boost Locale格式函数的分段错误。
// at ../../source/EntryPoint/Application.cpp:110
logInfo("sdfsdf");
内部没有任何transforamtions使用boost :: locale :: format
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff3a893c3 in std::basic_ostream<char, std::char_traits<char> >& std::operator<< <char, std::char_traits<char>, std::allocator<char> >(std::basic_ostream<char, std::char_traits<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) () from /usr/lib/libstdc++.so.6
(gdb) bt
#0 0x00007ffff3a893c3 in std::basic_ostream<char, std::char_traits<char> >& std::operator<< <char, std::char_traits<char>, std::allocator<char> >(std::basic_ostream<char, std::char_traits<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) () from /usr/lib/libstdc++.so.6
#1 0x0000000000d8392b in boost::locale::details::formattible<char>::write<std::string> (output=..., ptr=0x7fffffffd340)
at /usr/include/boost/locale/format.hpp:92
#2 0x0000000000d837b6 in boost::locale::details::operator<< (out=..., fmt=...)
at /usr/include/boost/locale/format.hpp:78
#3 0x0000000000d8319e in boost::locale::basic_format<char>::format_output (
this=0x7fffffffd410, out=..., sformat="[{1} | {2}]: ({3}, {4})")
at /usr/include/boost/locale/format.hpp:395
#4 0x0000000000d82b45 in boost::locale::basic_format<char>::write (
this=0x7fffffffd410, out=...) at /usr/include/boost/locale/format.hpp:269
#5 0x0000000000d8277f in boost::locale::basic_format<char>::str (
this=0x7fffffffd410, loc=...) at /usr/include/boost/locale/format.hpp:254
#6 0x0000000000d823eb in Uni::Logging::Private::Formatter::_format<std::string&, std::string&, char const*&, int const&> (
this=0x135afa0 <Uni::Logging::Private::Formatter::get()::_instance>,
message="[{1} | {2}]: ({3}, {4})") at /opt/Uni/source/Logging/format.hpp:30
#7 0x0000000000d8221b in Uni::Logging::Private::Formatter::format<std::string&, std::string&, char const*&, int const&> (message="[{1} | {2}]: ({3}, {4})")
at /opt/Uni/source/Logging/format.hpp:19
---Type <return> to continue, or q <return> to quit---
#8 0x0000000000d8210e in Uni::Logging::format<std::string&, std::string&, char const*&, int const&> (message="[{1} | {2}]: ({3}, {4})")
at /opt/Uni/source/Logging/format.hpp:77
#9 0x0000000000e465a3 in Uni::Logging::SimpleLogger::log<>(int const&, char const*, int const&, std::string const&) (
this=0x135b048 <_ZL30Uni_Logging_globalSimpleLogger>,
severity=@0x7fffffffd76c: 2,
notifiedFilePath=0x103bcd8 "../../source/EntryPoint/Application.cpp",
notifiedLineNumber=@0x7fffffffd768: 110, message="sdfsdf")
at /opt/Uni/source/Logging/SimpleLogger.hpp:49
#10 0x0000000000e8f753 in FsiSimulation::EntryPoint::ApplicationPrivateImplementation::ApplicationPrivateImplementation (this=0x13662d0, in=0x7fffffffd820,
argc_=@0x7fffffffd81c: 1, argv_=0x7fffffffd938)
at ../../source/EntryPoint/Application.cpp:110
#11 0x0000000000e8b72b in FsiSimulation::EntryPoint::Application::Application (
this=0x7fffffffd820, argc=@0x7fffffffd81c: 1, argv=0x7fffffffd938)
at ../../source/EntryPoint/Application.cpp:158
#12 0x0000000000e8b517 in main (argc=1, argv=0x7fffffffd938)
at ../../source/EntryPoint/main.cpp:7
再次使用相同的代码,我在发布模式下不会出现任何分段错误。任何想法如何跟踪问题?