Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diva segfaults for crtbegin.o #8

Closed
marxin opened this issue Sep 19, 2017 · 1 comment
Closed

Diva segfaults for crtbegin.o #8

marxin opened this issue Sep 19, 2017 · 1 comment
Labels

Comments

@marxin
Copy link

marxin commented Sep 19, 2017

Running for arbitrary crt{begin,end}.o file:

valgrind ./bin/diva /usr/lib64/gcc/x86_64-suse-linux/7/crtbegin.o
==28869== Memcheck, a memory error detector
==28869== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==28869== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==28869== Command: ./bin/diva /usr/lib64/gcc/x86_64-suse-linux/7/crtbegin.o
==28869== 
==28869== Conditional jump or move depends on uninitialised value(s)
==28869==    at 0x4E4F007: dwarf_errno (dwarf_error.c:123)
==28869==    by 0x5704A8: ElfDwarfReader::LibDwarfError::LibDwarfError(Dwarf_Error_s*, Dwarf_Debug_s*) (LibDwarfHelpers.cpp:49)
==28869==    by 0x570682: ElfDwarfReader::DwarfDebugData::DwarfDebugData(int) (LibDwarfHelpers.cpp:85)
==28869==    by 0x56738F: ElfDwarfReader::DwarfReader::createScopes() (ElfDwarfReader.cpp:123)
==28869==    by 0x57A59C: LibScopeView::Reader::executeActions() (Reader.cpp:71)
==28869==    by 0x564724: main (main.cpp:91)
==28869== 
==28869== Use of uninitialised value of size 8
==28869==    at 0x4E4F014: dwarf_errno (dwarf_error.c:127)
==28869==    by 0x5704A8: ElfDwarfReader::LibDwarfError::LibDwarfError(Dwarf_Error_s*, Dwarf_Debug_s*) (LibDwarfHelpers.cpp:49)
==28869==    by 0x570682: ElfDwarfReader::DwarfDebugData::DwarfDebugData(int) (LibDwarfHelpers.cpp:85)
==28869==    by 0x56738F: ElfDwarfReader::DwarfReader::createScopes() (ElfDwarfReader.cpp:123)
==28869==    by 0x57A59C: LibScopeView::Reader::executeActions() (Reader.cpp:71)
==28869==    by 0x564724: main (main.cpp:91)
==28869== 
==28869== Invalid read of size 8
==28869==    at 0x4E4F014: dwarf_errno (dwarf_error.c:127)
==28869==    by 0x5704A8: ElfDwarfReader::LibDwarfError::LibDwarfError(Dwarf_Error_s*, Dwarf_Debug_s*) (LibDwarfHelpers.cpp:49)
==28869==    by 0x570682: ElfDwarfReader::DwarfDebugData::DwarfDebugData(int) (LibDwarfHelpers.cpp:85)
==28869==    by 0x56738F: ElfDwarfReader::DwarfReader::createScopes() (ElfDwarfReader.cpp:123)
==28869==    by 0x57A59C: LibScopeView::Reader::executeActions() (Reader.cpp:71)
==28869==    by 0x564724: main (main.cpp:91)
==28869==  Address 0x629ada0 is 0 bytes inside a block of size 46 free'd
==28869==    at 0x4C2E7BB: operator delete(void*) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==28869==    by 0x56736D: ElfDwarfReader::DwarfReader::createScopes() (ElfDwarfReader.cpp:122)
==28869==    by 0x57A59C: LibScopeView::Reader::executeActions() (Reader.cpp:71)
==28869==    by 0x564724: main (main.cpp:91)
==28869==  Block was alloc'd at
==28869==    at 0x4C2D6FF: operator new(unsigned long) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==28869==    by 0x545DC1: void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char*>(char*, char*, std::forward_iterator_tag) (basic_string.tcc:219)
==28869==    by 0x5C593E: _M_construct_aux<char*> (basic_string.h:220)
==28869==    by 0x5C593E: _M_construct<char*> (basic_string.h:239)
==28869==    by 0x5C593E: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (basic_string.h:424)
==28869==    by 0x54215D: LibScopeView::ViewSpecification::getInputFile[abi:cxx11]() const (ViewSpecification.h:108)
==28869==    by 0x564CD8: LibScopeView::Reader::getInputFile[abi:cxx11]() const (Reader.h:129)
==28869==    by 0x56734B: ElfDwarfReader::DwarfReader::createScopes() (ElfDwarfReader.cpp:122)
==28869==    by 0x57A59C: LibScopeView::Reader::executeActions() (Reader.cpp:71)
==28869==    by 0x564724: main (main.cpp:91)
==28869== 
==28869== Conditional jump or move depends on uninitialised value(s)
==28869==    at 0x4E4F026: dwarf_errmsg (dwarf_error.c:136)
==28869==    by 0x5704D3: ElfDwarfReader::LibDwarfError::LibDwarfError(Dwarf_Error_s*, Dwarf_Debug_s*) (LibDwarfHelpers.cpp:49)
==28869==    by 0x570682: ElfDwarfReader::DwarfDebugData::DwarfDebugData(int) (LibDwarfHelpers.cpp:85)
==28869==    by 0x56738F: ElfDwarfReader::DwarfReader::createScopes() (ElfDwarfReader.cpp:123)
==28869==    by 0x57A59C: LibScopeView::Reader::executeActions() (Reader.cpp:71)
==28869==    by 0x564724: main (main.cpp:91)
==28869== 
==28869== Use of uninitialised value of size 8
==28869==    at 0x4E4F035: dwarf_errmsg (dwarf_error.c:140)
==28869==    by 0x5704D3: ElfDwarfReader::LibDwarfError::LibDwarfError(Dwarf_Error_s*, Dwarf_Debug_s*) (LibDwarfHelpers.cpp:49)
==28869==    by 0x570682: ElfDwarfReader::DwarfDebugData::DwarfDebugData(int) (LibDwarfHelpers.cpp:85)
==28869==    by 0x56738F: ElfDwarfReader::DwarfReader::createScopes() (ElfDwarfReader.cpp:123)
==28869==    by 0x57A59C: LibScopeView::Reader::executeActions() (Reader.cpp:71)
==28869==    by 0x564724: main (main.cpp:91)
==28869== 
==28869== Invalid read of size 8
==28869==    at 0x4E4F035: dwarf_errmsg (dwarf_error.c:140)
==28869==    by 0x5704D3: ElfDwarfReader::LibDwarfError::LibDwarfError(Dwarf_Error_s*, Dwarf_Debug_s*) (LibDwarfHelpers.cpp:49)
==28869==    by 0x570682: ElfDwarfReader::DwarfDebugData::DwarfDebugData(int) (LibDwarfHelpers.cpp:85)
==28869==    by 0x56738F: ElfDwarfReader::DwarfReader::createScopes() (ElfDwarfReader.cpp:123)
==28869==    by 0x57A59C: LibScopeView::Reader::executeActions() (Reader.cpp:71)
==28869==    by 0x564724: main (main.cpp:91)
==28869==  Address 0x629ada0 is 0 bytes inside a block of size 46 free'd
==28869==    at 0x4C2E7BB: operator delete(void*) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==28869==    by 0x56736D: ElfDwarfReader::DwarfReader::createScopes() (ElfDwarfReader.cpp:122)
==28869==    by 0x57A59C: LibScopeView::Reader::executeActions() (Reader.cpp:71)
==28869==    by 0x564724: main (main.cpp:91)
==28869==  Block was alloc'd at
==28869==    at 0x4C2D6FF: operator new(unsigned long) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==28869==    by 0x545DC1: void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char*>(char*, char*, std::forward_iterator_tag) (basic_string.tcc:219)
==28869==    by 0x5C593E: _M_construct_aux<char*> (basic_string.h:220)
==28869==    by 0x5C593E: _M_construct<char*> (basic_string.h:239)
==28869==    by 0x5C593E: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (basic_string.h:424)
==28869==    by 0x54215D: LibScopeView::ViewSpecification::getInputFile[abi:cxx11]() const (ViewSpecification.h:108)
==28869==    by 0x564CD8: LibScopeView::Reader::getInputFile[abi:cxx11]() const (Reader.h:129)
==28869==    by 0x56734B: ElfDwarfReader::DwarfReader::createScopes() (ElfDwarfReader.cpp:122)
==28869==    by 0x57A59C: LibScopeView::Reader::executeActions() (Reader.cpp:71)
==28869==    by 0x564724: main (main.cpp:91)
==28869== 
==28869== Conditional jump or move depends on uninitialised value(s)
==28869==    at 0x4C2E271: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==28869==    by 0x570521: ElfDwarfReader::LibDwarfError::LibDwarfError(Dwarf_Error_s*, Dwarf_Debug_s*) (LibDwarfHelpers.cpp:61)
==28869==    by 0x570682: ElfDwarfReader::DwarfDebugData::DwarfDebugData(int) (LibDwarfHelpers.cpp:85)
==28869==    by 0x56738F: ElfDwarfReader::DwarfReader::createScopes() (ElfDwarfReader.cpp:123)
==28869==    by 0x57A59C: LibScopeView::Reader::executeActions() (Reader.cpp:71)
==28869==    by 0x564724: main (main.cpp:91)
==28869== 
==28869== Invalid free() / delete / delete[] / realloc()
==28869==    at 0x4C2E2BB: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==28869==    by 0x570521: ElfDwarfReader::LibDwarfError::LibDwarfError(Dwarf_Error_s*, Dwarf_Debug_s*) (LibDwarfHelpers.cpp:61)
==28869==    by 0x570682: ElfDwarfReader::DwarfDebugData::DwarfDebugData(int) (LibDwarfHelpers.cpp:85)
==28869==    by 0x56738F: ElfDwarfReader::DwarfReader::createScopes() (ElfDwarfReader.cpp:123)
==28869==    by 0x57A59C: LibScopeView::Reader::executeActions() (Reader.cpp:71)
==28869==    by 0x564724: main (main.cpp:91)
==28869==  Address 0x629ada0 is 0 bytes inside a block of size 46 free'd
==28869==    at 0x4C2E7BB: operator delete(void*) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==28869==    by 0x56736D: ElfDwarfReader::DwarfReader::createScopes() (ElfDwarfReader.cpp:122)
==28869==    by 0x57A59C: LibScopeView::Reader::executeActions() (Reader.cpp:71)
==28869==    by 0x564724: main (main.cpp:91)
==28869==  Block was alloc'd at
==28869==    at 0x4C2D6FF: operator new(unsigned long) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==28869==    by 0x545DC1: void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char*>(char*, char*, std::forward_iterator_tag) (basic_string.tcc:219)
==28869==    by 0x5C593E: _M_construct_aux<char*> (basic_string.h:220)
==28869==    by 0x5C593E: _M_construct<char*> (basic_string.h:239)
==28869==    by 0x5C593E: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (basic_string.h:424)
==28869==    by 0x54215D: LibScopeView::ViewSpecification::getInputFile[abi:cxx11]() const (ViewSpecification.h:108)
==28869==    by 0x564CD8: LibScopeView::Reader::getInputFile[abi:cxx11]() const (Reader.h:129)
==28869==    by 0x56734B: ElfDwarfReader::DwarfReader::createScopes() (ElfDwarfReader.cpp:122)
==28869==    by 0x57A59C: LibScopeView::Reader::executeActions() (Reader.cpp:71)
==28869==    by 0x564724: main (main.cpp:91)
@FlameTop FlameTop added the bug label Sep 19, 2017
@SeanEveson
Copy link
Contributor

Thanks for the bug report.

Repro: repro.zip

SeanEveson added a commit to SeanEveson/DIVA that referenced this issue Sep 22, 2017
FlameTop added a commit that referenced this issue Sep 22, 2017
Fix Issue #8, Crash when handling some files with no debug data.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants