Opened 9 years ago

Last modified 9 years ago

#9131 new Bugs

Memcheck reports invalid read in exit() on boost 1.54 on Ubuntu 12.04

Reported by: asturman@… Owned by: Beman Dawes
Milestone: To Be Determined Component: filesystem
Version: Boost 1.54.0 Severity: Problem
Keywords: Cc:

Description

==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<wchar_t, false>::~moneypunct() (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16)
==10361==    by 0x55A0198: std::moneypunct<wchar_t, false>::~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<wchar_t, false>::_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&) (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&, std::_Ios_Openmode, unsigned long, boost::log::v2_mt_posix::aux::light_function<bool ()()> const&, bool) (in /usr/lib/libboost_log.so.1.54.0)
==10361==    by 0x413815: void boost::log::v2_mt_posix::sinks::text_file_backend::construct<boost::parameter::aux::tagged_argument<boost::log::v2_mt_posix::keywords::tag::file_name, char const [14]> >(boost::parameter::aux::tagged_argument<boost::log::v2_mt_posix::keywords::tag::file_name, char const [14]> const&) (text_file_backend.hpp:511)
==10361==    by 0x412F5E: boost::log::v2_mt_posix::sinks::text_file_backend::text_file_backend<boost::parameter::aux::tagged_argument<boost::log::v2_mt_posix::keywords::tag::file_name, char const [14]> >(boost::parameter::aux::tagged_argument<boost::log::v2_mt_posix::keywords::tag::file_name, char const [14]> const&) (text_file_backend.hpp:386)
==10361==    by 0x41280A: boost::detail::sp_if_not_array<boost::log::v2_mt_posix::sinks::text_file_backend>::type boost::make_shared<boost::log::v2_mt_posix::sinks::text_file_backend, boost::parameter::aux::tagged_argument<boost::log::v2_mt_posix::keywords::tag::file_name, char const [14]> const, >(boost::parameter::aux::tagged_argument<boost::log::v2_mt_posix::keywords::tag::file_name, char const [14]> const&&, ) (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<wchar_t, true>::~moneypunct() (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16)
==10361==    by 0x55A0088: std::moneypunct<wchar_t, true>::~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<wchar_t, true>::_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&) (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&, std::_Ios_Openmode, unsigned long, boost::log::v2_mt_posix::aux::light_function<bool ()()> const&, bool) (in /usr/lib/libboost_log.so.1.54.0)
==10361==    by 0x413815: void boost::log::v2_mt_posix::sinks::text_file_backend::construct<boost::parameter::aux::tagged_argument<boost::log::v2_mt_posix::keywords::tag::file_name, char const [14]> >(boost::parameter::aux::tagged_argument<boost::log::v2_mt_posix::keywords::tag::file_name, char const [14]> const&) (text_file_backend.hpp:511)
==10361==    by 0x412F5E: boost::log::v2_mt_posix::sinks::text_file_backend::text_file_backend<boost::parameter::aux::tagged_argument<boost::log::v2_mt_posix::keywords::tag::file_name, char const [14]> >(boost::parameter::aux::tagged_argument<boost::log::v2_mt_posix::keywords::tag::file_name, char const [14]> const&) (text_file_backend.hpp:386)
==10361==    by 0x41280A: boost::detail::sp_if_not_array<boost::log::v2_mt_posix::sinks::text_file_backend>::type boost::make_shared<boost::log::v2_mt_posix::sinks::text_file_backend, boost::parameter::aux::tagged_argument<boost::log::v2_mt_posix::keywords::tag::file_name, char const [14]> const, >(boost::parameter::aux::tagged_argument<boost::log::v2_mt_posix::keywords::tag::file_name, char const [14]> const&&, ) (make_shared_object.hpp:218)
==10361==    by 0x41066E: main (integration_test.cpp:17)

Attachments (1)

invalid_read.cpp (807 bytes ) - added by asturman@… 9 years ago.
test case

Download all attachments as: .zip

Change History (3)

by asturman@…, 9 years ago

Attachment: invalid_read.cpp added

test case

comment:1 by scrawl@…, 9 years ago

Happens for me in 1.49.0 too

comment:2 by scrawl <scrawl@…>, 9 years ago

I think it's not a boost issue, but a problem that valgrind has with the underlying wcscmp being used: https://bugs.kde.org/show_bug.cgi?id=307828

According to that link, it should be fixed in valgrind 3.9 (I'm currently on 3.7)

Note: See TracTickets for help on using tickets.