Re: protoc crash in libstdc++

From: George Liaskos <geo.liaskos_at_gmail.com>
Date: Tue, 18 Dec 2012 20:49:53 +0200
==90885== Memcheck, a memory error detector
==90885== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==90885== Using Valgrind-3.8.0 and LibVEX; rerun with -h for copyright info
==90885== Command: ./protoc
==90885==
==90885== Invalid read of size 8
==90885==    at 0x1388506: std::ostream::sentry::sentry(std::ostream&)
(ostream.tcc:55)
==90885==    by 0x13884CC: std::ostream::sentry::sentry(std::ostream&)
(ostream:62)
==90885==    by 0x138AA4A: std::basic_ostream<char,
std::char_traits<char> >& std::__ostream_insert<char,
std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&, char const*, long) (ostream_insert.h:83)
==90885==    by 0x40599B:
google::protobuf::compiler::CommandLineInterface::ParseArguments(int,
char const* const*) (ostream:517)
==90885==    by 0x40491F:
google::protobuf::compiler::CommandLineInterface::Run(int, char const*
const*) (command_line_interface.cc:588)
==90885==    by 0x4329D0: main (main.cc:63)
==90885==  Address 0xffffffffffffffe8 is not stack'd, malloc'd or
(recently) free'd
==90885==
==90885==
==90885== Process terminating with default action of signal 11
(SIGSEGV): dumping core
==90885==  Access not within mapped region at address 0xFFFFFFFFFFFFFFE8
==90885==    at 0x1388506: std::ostream::sentry::sentry(std::ostream&)
(ostream.tcc:55)
==90885==    by 0x13884CC: std::ostream::sentry::sentry(std::ostream&)
(ostream:62)
==90885==    by 0x138AA4A: std::basic_ostream<char,
std::char_traits<char> >& std::__ostream_insert<char,
std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&, char const*, long) (ostream_insert.h:83)
==90885==    by 0x40599B:
google::protobuf::compiler::CommandLineInterface::ParseArguments(int,
char const* const*) (ostream:517)
==90885==    by 0x40491F:
google::protobuf::compiler::CommandLineInterface::Run(int, char const*
const*) (command_line_interface.cc:588)
==90885==    by 0x4329D0: main (main.cc:63)
==90885==  If you believe this happened as a result of a stack
==90885==  overflow in your program's main thread (unlikely but
==90885==  possible), you can try to increase the size of the
==90885==  main thread stack using the --main-stacksize= flag.
==90885==  The main thread stack size used in this run was 16777216.
==90885==
==90885== HEAP SUMMARY:
==90885==     in use at exit: 1,949 bytes in 20 blocks
==90885==   total heap usage: 20 allocs, 0 frees, 1,949 bytes allocated
==90885==
==90885== 26 bytes in 1 blocks are possibly lost in loss record 3 of 20
==90885==    at 0x10BBFB6: malloc (in
/usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==90885==    by 0x1FD595A: operator new(unsigned long) (in
/usr/lib/libsupc++.so.1)
==90885==    by 0x1375465:
__gnu_cxx::new_allocator<char>::allocate(unsigned long, void const*)
(new_allocator.h:91)
==90885==    by 0x1375373: std::string::_Rep::_S_create(unsigned long,
unsigned long, std::allocator<char> const&) (basic_string.tcc:588)
==90885==    by 0x137A8AF: char* std::string::_S_construct<char
const*>(char const*, char const*, std::allocator<char> const&,
std::forward_iterator_tag) (basic_string.tcc:150)
==90885==    by 0x137AB34: char* std::string::_S_construct_aux<char
const*>(char const*, char const*, std::allocator<char> const&,
std::__false_type) (basic_string.h:1453)
==90885==    by 0x1376644: char* std::string::_S_construct<char
const*>(char const*, char const*, std::allocator<char> const&)
(basic_string.h:1468)
==90885==    by 0x13766F4: std::basic_string<char,
std::char_traits<char>, std::allocator<char> >::basic_string(char
const*, std::allocator<char> const&) (basic_string.h:226)
==90885==    by 0x1376674: std::basic_string<char,
std::char_traits<char>, std::allocator<char> >::basic_string(char
const*, std::allocator<char> const&) (basic_string.h:228)
==90885==    by 0x4057CF:
google::protobuf::compiler::CommandLineInterface::ParseArguments(int,
char const* const*) (command_line_interface.cc:784)
==90885==    by 0x40491F:
google::protobuf::compiler::CommandLineInterface::Run(int, char const*
const*) (command_line_interface.cc:588)
==90885==    by 0x4329D0: main (main.cc:63)
==90885==
==90885== 32 bytes in 1 blocks are possibly lost in loss record 4 of 20
==90885==    at 0x10BBFB6: malloc (in
/usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==90885==    by 0x1FD595A: operator new(unsigned long) (in
/usr/lib/libsupc++.so.1)
==90885==    by 0x1375465:
__gnu_cxx::new_allocator<char>::allocate(unsigned long, void const*)
(new_allocator.h:91)
==90885==    by 0x1375373: std::string::_Rep::_S_create(unsigned long,
unsigned long, std::allocator<char> const&) (basic_string.tcc:588)
==90885==    by 0x137A8AF: char* std::string::_S_construct<char
const*>(char const*, char const*, std::allocator<char> const&,
std::forward_iterator_tag) (basic_string.tcc:150)
==90885==    by 0x137AB34: char* std::string::_S_construct_aux<char
const*>(char const*, char const*, std::allocator<char> const&,
std::__false_type) (basic_string.h:1453)
==90885==    by 0x1376644: char* std::string::_S_construct<char
const*>(char const*, char const*, std::allocator<char> const&)
(basic_string.h:1468)
==90885==    by 0x13766F4: std::basic_string<char,
std::char_traits<char>, std::allocator<char> >::basic_string(char
const*, std::allocator<char> const&) (basic_string.h:226)
==90885==    by 0x1376674: std::basic_string<char,
std::char_traits<char>, std::allocator<char> >::basic_string(char
const*, std::allocator<char> const&) (basic_string.h:228)
==90885==    by 0x432816: main (main.cc:45)
==90885==
==90885== 33 bytes in 1 blocks are possibly lost in loss record 5 of 20
==90885==    at 0x10BBFB6: malloc (in
/usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==90885==    by 0x1FD595A: operator new(unsigned long) (in
/usr/lib/libsupc++.so.1)
==90885==    by 0x1375465:
__gnu_cxx::new_allocator<char>::allocate(unsigned long, void const*)
(new_allocator.h:91)
==90885==    by 0x1375373: std::string::_Rep::_S_create(unsigned long,
unsigned long, std::allocator<char> const&) (basic_string.tcc:588)
==90885==    by 0x1375D65: std::string::_M_mutate(unsigned long,
unsigned long, unsigned long) (basic_string.tcc:460)
==90885==    by 0x1377A62: std::string::_M_replace_safe(unsigned long,
unsigned long, char const*, unsigned long) (basic_string.tcc:665)
==90885==    by 0x1377974: std::string::assign(char const*, unsigned
long) (basic_string.tcc:268)
==90885==    by 0x4055EA:
google::protobuf::compiler::CommandLineInterface::ParseArguments(int,
char const* const*) (basic_string.h:919)
==90885==    by 0x40491F:
google::protobuf::compiler::CommandLineInterface::Run(int, char const*
const*) (command_line_interface.cc:588)
==90885==    by 0x4329D0: main (main.cc:63)
==90885==
==90885== 34 bytes in 1 blocks are possibly lost in loss record 6 of 20
==90885==    at 0x10BBFB6: malloc (in
/usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==90885==    by 0x1FD595A: operator new(unsigned long) (in
/usr/lib/libsupc++.so.1)
==90885==    by 0x1375465:
__gnu_cxx::new_allocator<char>::allocate(unsigned long, void const*)
(new_allocator.h:91)
==90885==    by 0x1375373: std::string::_Rep::_S_create(unsigned long,
unsigned long, std::allocator<char> const&) (basic_string.tcc:588)
==90885==    by 0x137A8AF: char* std::string::_S_construct<char
const*>(char const*, char const*, std::allocator<char> const&,
std::forward_iterator_tag) (basic_string.tcc:150)
==90885==    by 0x137AB34: char* std::string::_S_construct_aux<char
const*>(char const*, char const*, std::allocator<char> const&,
std::__false_type) (basic_string.h:1453)
==90885==    by 0x1376644: char* std::string::_S_construct<char
const*>(char const*, char const*, std::allocator<char> const&)
(basic_string.h:1468)
==90885==    by 0x13766F4: std::basic_string<char,
std::char_traits<char>, std::allocator<char> >::basic_string(char
const*, std::allocator<char> const&) (basic_string.h:226)
==90885==    by 0x1376674: std::basic_string<char,
std::char_traits<char>, std::allocator<char> >::basic_string(char
const*, std::allocator<char> const&) (basic_string.h:228)
==90885==    by 0x432861: main (main.cc:49)
==90885==
==90885== 35 bytes in 1 blocks are possibly lost in loss record 7 of 20
==90885==    at 0x10BBFB6: malloc (in
/usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==90885==    by 0x1FD595A: operator new(unsigned long) (in
/usr/lib/libsupc++.so.1)
==90885==    by 0x1375465:
__gnu_cxx::new_allocator<char>::allocate(unsigned long, void const*)
(new_allocator.h:91)
==90885==    by 0x1375373: std::string::_Rep::_S_create(unsigned long,
unsigned long, std::allocator<char> const&) (basic_string.tcc:588)
==90885==    by 0x137A8AF: char* std::string::_S_construct<char
const*>(char const*, char const*, std::allocator<char> const&,
std::forward_iterator_tag) (basic_string.tcc:150)
==90885==    by 0x137AB34: char* std::string::_S_construct_aux<char
const*>(char const*, char const*, std::allocator<char> const&,
std::__false_type) (basic_string.h:1453)
==90885==    by 0x1376644: char* std::string::_S_construct<char
const*>(char const*, char const*, std::allocator<char> const&)
(basic_string.h:1468)
==90885==    by 0x13766F4: std::basic_string<char,
std::char_traits<char>, std::allocator<char> >::basic_string(char
const*, std::allocator<char> const&) (basic_string.h:226)
==90885==    by 0x1376674: std::basic_string<char,
std::char_traits<char>, std::allocator<char> >::basic_string(char
const*, std::allocator<char> const&) (basic_string.h:228)
==90885==    by 0x4328E3: main (main.cc:54)
==90885==
==90885== 37 bytes in 1 blocks are possibly lost in loss record 8 of 20
==90885==    at 0x10BBFB6: malloc (in
/usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==90885==    by 0x1FD595A: operator new(unsigned long) (in
/usr/lib/libsupc++.so.1)
==90885==    by 0x1375465:
__gnu_cxx::new_allocator<char>::allocate(unsigned long, void const*)
(new_allocator.h:91)
==90885==    by 0x1375373: std::string::_Rep::_S_create(unsigned long,
unsigned long, std::allocator<char> const&) (basic_string.tcc:588)
==90885==    by 0x137A8AF: char* std::string::_S_construct<char
const*>(char const*, char const*, std::allocator<char> const&,
std::forward_iterator_tag) (basic_string.tcc:150)
==90885==    by 0x137AB34: char* std::string::_S_construct_aux<char
const*>(char const*, char const*, std::allocator<char> const&,
std::__false_type) (basic_string.h:1453)
==90885==    by 0x1376644: char* std::string::_S_construct<char
const*>(char const*, char const*, std::allocator<char> const&)
(basic_string.h:1468)
==90885==    by 0x13766F4: std::basic_string<char,
std::char_traits<char>, std::allocator<char> >::basic_string(char
const*, std::allocator<char> const&) (basic_string.h:226)
==90885==    by 0x1376674: std::basic_string<char,
std::char_traits<char>, std::allocator<char> >::basic_string(char
const*, std::allocator<char> const&) (basic_string.h:228)
==90885==    by 0x432965: main (main.cc:60)
==90885==
==90885== 51 bytes in 1 blocks are possibly lost in loss record 9 of 20
==90885==    at 0x10BBFB6: malloc (in
/usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==90885==    by 0x1FD595A: operator new(unsigned long) (in
/usr/lib/libsupc++.so.1)
==90885==    by 0x1375465:
__gnu_cxx::new_allocator<char>::allocate(unsigned long, void const*)
(new_allocator.h:91)
==90885==    by 0x1375373: std::string::_Rep::_S_create(unsigned long,
unsigned long, std::allocator<char> const&) (basic_string.tcc:588)
==90885==    by 0x137A8AF: char* std::string::_S_construct<char
const*>(char const*, char const*, std::allocator<char> const&,
std::forward_iterator_tag) (basic_string.tcc:150)
==90885==    by 0x137AB34: char* std::string::_S_construct_aux<char
const*>(char const*, char const*, std::allocator<char> const&,
std::__false_type) (basic_string.h:1453)
==90885==    by 0x1376644: char* std::string::_S_construct<char
const*>(char const*, char const*, std::allocator<char> const&)
(basic_string.h:1468)
==90885==    by 0x13766F4: std::basic_string<char,
std::char_traits<char>, std::allocator<char> >::basic_string(char
const*, std::allocator<char> const&) (basic_string.h:226)
==90885==    by 0x1376674: std::basic_string<char,
std::char_traits<char>, std::allocator<char> >::basic_string(char
const*, std::allocator<char> const&) (basic_string.h:228)
==90885==    by 0x432900: main (main.cc:54)
==90885==
==90885== 53 bytes in 1 blocks are possibly lost in loss record 10 of 20
==90885==    at 0x10BBFB6: malloc (in
/usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==90885==    by 0x1FD595A: operator new(unsigned long) (in
/usr/lib/libsupc++.so.1)
==90885==    by 0x1375465:
__gnu_cxx::new_allocator<char>::allocate(unsigned long, void const*)
(new_allocator.h:91)
==90885==    by 0x1375373: std::string::_Rep::_S_create(unsigned long,
unsigned long, std::allocator<char> const&) (basic_string.tcc:588)
==90885==    by 0x137A8AF: char* std::string::_S_construct<char
const*>(char const*, char const*, std::allocator<char> const&,
std::forward_iterator_tag) (basic_string.tcc:150)
==90885==    by 0x137AB34: char* std::string::_S_construct_aux<char
const*>(char const*, char const*, std::allocator<char> const&,
std::__false_type) (basic_string.h:1453)
==90885==    by 0x1376644: char* std::string::_S_construct<char
const*>(char const*, char const*, std::allocator<char> const&)
(basic_string.h:1468)
==90885==    by 0x13766F4: std::basic_string<char,
std::char_traits<char>, std::allocator<char> >::basic_string(char
const*, std::allocator<char> const&) (basic_string.h:226)
==90885==    by 0x1376674: std::basic_string<char,
std::char_traits<char>, std::allocator<char> >::basic_string(char
const*, std::allocator<char> const&) (basic_string.h:228)
==90885==    by 0x432982: main (main.cc:60)
==90885==
==90885== 56 bytes in 1 blocks are possibly lost in loss record 14 of 20
==90885==    at 0x10BBFB6: malloc (in
/usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==90885==    by 0x1FD595A: operator new(unsigned long) (in
/usr/lib/libsupc++.so.1)
==90885==    by 0x1375465:
__gnu_cxx::new_allocator<char>::allocate(unsigned long, void const*)
(new_allocator.h:91)
==90885==    by 0x1375373: std::string::_Rep::_S_create(unsigned long,
unsigned long, std::allocator<char> const&) (basic_string.tcc:588)
==90885==    by 0x137A8AF: char* std::string::_S_construct<char
const*>(char const*, char const*, std::allocator<char> const&,
std::forward_iterator_tag) (basic_string.tcc:150)
==90885==    by 0x137AB34: char* std::string::_S_construct_aux<char
const*>(char const*, char const*, std::allocator<char> const&,
std::__false_type) (basic_string.h:1453)
==90885==    by 0x1376644: char* std::string::_S_construct<char
const*>(char const*, char const*, std::allocator<char> const&)
(basic_string.h:1468)
==90885==    by 0x13766F4: std::basic_string<char,
std::char_traits<char>, std::allocator<char> >::basic_string(char
const*, std::allocator<char> const&) (basic_string.h:226)
==90885==    by 0x1376674: std::basic_string<char,
std::char_traits<char>, std::allocator<char> >::basic_string(char
const*, std::allocator<char> const&) (basic_string.h:228)
==90885==    by 0x43287E: main (main.cc:49)
==90885==
==90885== LEAK SUMMARY:
==90885==    definitely lost: 0 bytes in 0 blocks
==90885==    indirectly lost: 0 bytes in 0 blocks
==90885==      possibly lost: 357 bytes in 9 blocks
==90885==    still reachable: 1,592 bytes in 11 blocks
==90885==         suppressed: 0 bytes in 0 blocks
==90885== Reachable blocks (those to which a pointer was found) are not shown.
==90885== To see them, rerun with: --leak-check=full --show-reachable=yes
==90885==
==90885== For counts of detected and suppressed errors, rerun with: -v
==90885== ERROR SUMMARY: 10 errors from 10 contexts (suppressed: 0 from 0)
Segmentation fault

On Tue, Dec 18, 2012 at 2:24 PM, Roman Divacky <rdivacky_at_freebsd.org> wrote:
> On Tue, Dec 18, 2012 at 01:21:42PM +0100, Ren? Ladan wrote:
>> Hi,
>>
>> the following backtrace is from a crash that happened when building
>> www/chromium with clang.  The chromium port builds a binary protoc which
>> crashes when built with clang.
>>
>> Program received signal SIGSEGV, Segmentation fault.
>> [Switching to Thread 802006400 (LWP 100869)]
>> 0x0000000800996506 in std::ostream::sentry::sentry(std::ostream&) ()
>> from /usr/lib/libstdc++.so.6
>> (gdb) bt
>> #0  0x0000000800996506 in std::ostream::sentry::sentry(std::ostream&) ()
>> from /usr/lib/libstdc++.so.6
>> #1  0x00000008009964cd in std::basic_ostream<char>::sentry::sentry
>> (this=0x7fffffffcf88, __os=...) at /usr/include/c++/4.2/ostream:62
>> #2  0x0000000800998a4b in std::__ostream_insert<char,
>> std::char_traits<char> > (__out=..., __s=0x485df0 "Missing input file.",
>> __n=19)
>>    at
>> /usr/src/gnu/lib/libstdc++/../../../contrib/libstdc++/include/bits/ostream_insert.h:83
>> #3  0x000000000040592c in operator<<<std::char_traits<char> >
>> (this=<optimized out>, __out=..., __out=..., __s=<optimized out>) at
>> /usr/include/c++/4.2/ostream:517
>> #4  google::protobuf::compiler::CommandLineInterface::ParseArguments
>> (this=<optimized out>, argc=1, argv=0x7fffffffd640) at
>> third_party/protobuf/src/google/protobuf/compiler/command_line_interface.cc:790
>> #5  0x00000000004048b0 in
>> google::protobuf::compiler::CommandLineInterface::Run
>> (this=0x7fffffffd4d0, argc=-12408, argv=0x7fffffffcf88)
>>    at
>> third_party/protobuf/src/google/protobuf/compiler/command_line_interface.cc:588
>> #6  0x0000000000432957 in main (argc=-12408, argv=0x7fffffffcf88) at
>                                        ^^^^^^
>                                               wow :)
>
>
> Can you run this under valgrind?
>
> Roman
> _______________________________________________
> freebsd-current_at_freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe_at_freebsd.org"
Received on Tue Dec 18 2012 - 17:50:39 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:33 UTC