Boost C++ Libraries: Ticket #9131: Memcheck reports invalid read in exit() on boost 1.54 on Ubuntu 12.04 https://svn.boost.org/trac10/ticket/9131 <pre class="wiki">==10361== Memcheck, a memory error detector ==10361== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al. ==10361== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info ==10361== Command: target/test/integration_test ==10361== ==10361== Invalid read of size 8 ==10361== at 0x5AE7E18: wcscmp (wcscmp.S:479) ==10361== by 0x55A0113: std::moneypunct&lt;wchar_t, false&gt;::~moneypunct() (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16) ==10361== by 0x55A0198: std::moneypunct&lt;wchar_t, false&gt;::~moneypunct() (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16) ==10361== by 0x5594A79: std::locale::_Impl::~_Impl() (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16) ==10361== by 0x5594C4C: std::locale::~locale() (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16) ==10361== by 0x5A81D1C: __cxa_finalize (cxa_finalize.c:56) ==10361== by 0x6733E55: ??? (in /usr/lib/libboost_filesystem.so.1.54.0) ==10361== by 0x6744A20: ??? (in /usr/lib/libboost_filesystem.so.1.54.0) ==10361== by 0x5A81900: __run_exit_handlers (exit.c:78) ==10361== by 0x5A81984: exit (exit.c:100) ==10361== by 0x5A67773: (below main) (libc-start.c:258) ==10361== Address 0x6b5fe98 is 0 bytes after a block of size 8 alloc'd ==10361== at 0x4C2AC27: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==10361== by 0x559FDED: std::moneypunct&lt;wchar_t, false&gt;::_M_initialize_moneypunct(__locale_struct*, char const*) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16) ==10361== by 0x559711E: std::locale::_Impl::_Impl(char const*, unsigned long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16) ==10361== by 0x559765E: std::locale::locale(char const*) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16) ==10361== by 0x6741733: boost::filesystem::path::codecvt() (in /usr/lib/libboost_filesystem.so.1.54.0) ==10361== by 0x50BF59E: boost::log::v2_mt_posix::sinks::text_file_backend::set_file_name_pattern_internal(boost::filesystem::path const&amp;) (in /usr/lib/libboost_log.so.1.54.0) ==10361== by 0x50C103D: boost::log::v2_mt_posix::sinks::text_file_backend::construct(boost::filesystem::path const&amp;, std::_Ios_Openmode, unsigned long, boost::log::v2_mt_posix::aux::light_function&lt;bool ()()&gt; const&amp;, bool) (in /usr/lib/libboost_log.so.1.54.0) ==10361== by 0x413815: void boost::log::v2_mt_posix::sinks::text_file_backend::construct&lt;boost::parameter::aux::tagged_argument&lt;boost::log::v2_mt_posix::keywords::tag::file_name, char const [14]&gt; &gt;(boost::parameter::aux::tagged_argument&lt;boost::log::v2_mt_posix::keywords::tag::file_name, char const [14]&gt; const&amp;) (text_file_backend.hpp:511) ==10361== by 0x412F5E: boost::log::v2_mt_posix::sinks::text_file_backend::text_file_backend&lt;boost::parameter::aux::tagged_argument&lt;boost::log::v2_mt_posix::keywords::tag::file_name, char const [14]&gt; &gt;(boost::parameter::aux::tagged_argument&lt;boost::log::v2_mt_posix::keywords::tag::file_name, char const [14]&gt; const&amp;) (text_file_backend.hpp:386) ==10361== by 0x41280A: boost::detail::sp_if_not_array&lt;boost::log::v2_mt_posix::sinks::text_file_backend&gt;::type boost::make_shared&lt;boost::log::v2_mt_posix::sinks::text_file_backend, boost::parameter::aux::tagged_argument&lt;boost::log::v2_mt_posix::keywords::tag::file_name, char const [14]&gt; const, &gt;(boost::parameter::aux::tagged_argument&lt;boost::log::v2_mt_posix::keywords::tag::file_name, char const [14]&gt; const&amp;&amp;, ) (make_shared_object.hpp:218) ==10361== by 0x41066E: main (integration_test.cpp:17) ==10361== ==10361== Invalid read of size 8 ==10361== at 0x5AE7E18: wcscmp (wcscmp.S:479) ==10361== by 0x55A0003: std::moneypunct&lt;wchar_t, true&gt;::~moneypunct() (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16) ==10361== by 0x55A0088: std::moneypunct&lt;wchar_t, true&gt;::~moneypunct() (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16) ==10361== by 0x5594A79: std::locale::_Impl::~_Impl() (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16) ==10361== by 0x5594C4C: std::locale::~locale() (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16) ==10361== by 0x5A81D1C: __cxa_finalize (cxa_finalize.c:56) ==10361== by 0x6733E55: ??? (in /usr/lib/libboost_filesystem.so.1.54.0) ==10361== by 0x6744A20: ??? (in /usr/lib/libboost_filesystem.so.1.54.0) ==10361== by 0x5A81900: __run_exit_handlers (exit.c:78) ==10361== by 0x5A81984: exit (exit.c:100) ==10361== by 0x5A67773: (below main) (libc-start.c:258) ==10361== Address 0x6b600c8 is 0 bytes after a block of size 8 alloc'd ==10361== at 0x4C2AC27: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==10361== by 0x559F7FD: std::moneypunct&lt;wchar_t, true&gt;::_M_initialize_moneypunct(__locale_struct*, char const*) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16) ==10361== by 0x559716B: std::locale::_Impl::_Impl(char const*, unsigned long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16) ==10361== by 0x559765E: std::locale::locale(char const*) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16) ==10361== by 0x6741733: boost::filesystem::path::codecvt() (in /usr/lib/libboost_filesystem.so.1.54.0) ==10361== by 0x50BF59E: boost::log::v2_mt_posix::sinks::text_file_backend::set_file_name_pattern_internal(boost::filesystem::path const&amp;) (in /usr/lib/libboost_log.so.1.54.0) ==10361== by 0x50C103D: boost::log::v2_mt_posix::sinks::text_file_backend::construct(boost::filesystem::path const&amp;, std::_Ios_Openmode, unsigned long, boost::log::v2_mt_posix::aux::light_function&lt;bool ()()&gt; const&amp;, bool) (in /usr/lib/libboost_log.so.1.54.0) ==10361== by 0x413815: void boost::log::v2_mt_posix::sinks::text_file_backend::construct&lt;boost::parameter::aux::tagged_argument&lt;boost::log::v2_mt_posix::keywords::tag::file_name, char const [14]&gt; &gt;(boost::parameter::aux::tagged_argument&lt;boost::log::v2_mt_posix::keywords::tag::file_name, char const [14]&gt; const&amp;) (text_file_backend.hpp:511) ==10361== by 0x412F5E: boost::log::v2_mt_posix::sinks::text_file_backend::text_file_backend&lt;boost::parameter::aux::tagged_argument&lt;boost::log::v2_mt_posix::keywords::tag::file_name, char const [14]&gt; &gt;(boost::parameter::aux::tagged_argument&lt;boost::log::v2_mt_posix::keywords::tag::file_name, char const [14]&gt; const&amp;) (text_file_backend.hpp:386) ==10361== by 0x41280A: boost::detail::sp_if_not_array&lt;boost::log::v2_mt_posix::sinks::text_file_backend&gt;::type boost::make_shared&lt;boost::log::v2_mt_posix::sinks::text_file_backend, boost::parameter::aux::tagged_argument&lt;boost::log::v2_mt_posix::keywords::tag::file_name, char const [14]&gt; const, &gt;(boost::parameter::aux::tagged_argument&lt;boost::log::v2_mt_posix::keywords::tag::file_name, char const [14]&gt; const&amp;&amp;, ) (make_shared_object.hpp:218) ==10361== by 0x41066E: main (integration_test.cpp:17) </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9131 Trac 1.4.3 asturman@… Thu, 19 Sep 2013 08:41:24 GMT attachment set https://svn.boost.org/trac10/ticket/9131 https://svn.boost.org/trac10/ticket/9131 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">invalid_read.cpp</span> </li> </ul> <p> test case </p> Ticket scrawl@… Fri, 28 Feb 2014 16:43:16 GMT <link>https://svn.boost.org/trac10/ticket/9131#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9131#comment:1</guid> <description> <p> Happens for me in 1.49.0 too </p> </description> <category>Ticket</category> </item> <item> <author>scrawl <scrawl@…></author> <pubDate>Fri, 28 Feb 2014 16:47:54 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9131#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9131#comment:2</guid> <description> <p> I think it's not a boost issue, but a problem that valgrind has with the underlying wcscmp being used: <a class="ext-link" href="https://bugs.kde.org/show_bug.cgi?id=307828"><span class="icon">​</span>https://bugs.kde.org/show_bug.cgi?id=307828</a> </p> <p> According to that link, it should be fixed in valgrind 3.9 (I'm currently on 3.7) </p> </description> <category>Ticket</category> </item> </channel> </rss>