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

Assertion failure running "rr sources" #3033

Closed
jesup opened this issue Jan 11, 2022 · 3 comments
Closed

Assertion failure running "rr sources" #3033

jesup opened this issue Jan 11, 2022 · 3 comments

Comments

@jesup
Copy link

jesup commented Jan 11, 2022

Copied from Matrix

Got an "unknown error" trying to upload an rr trace to pernosco; rr sources crashes as well:
/builddir/build/BUILD/gcc-11.2.1-20210728/obj-x86_64-redhat-linux/x86_64-redhat-linux/libstdc++-v3/include/bits/basic_string.h:1058: std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator[](std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference = char&; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]: Assertion '__pos <= size()' failed. Abort (core dumped) Exit 134

This was with a fresh clobber build, and fresh capture
rr is 5.5.0
built from commit da40aa5

@jesup
Copy link
Author

jesup commented Jan 11, 2022

Stack backtrace:

(gdb) where
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:49
#1 0x00007ffff79608a4 in __GI_abort () at abort.c:79
#2 0x00007ffff7d52858 in std::__replacement_assert (
__file=__file@entry=0x7ffff7e2cea0 "/builddir/build/BUILD/gcc-11.2.1-20210728/obj-x86_64-redhat-linux/x86_64-redhat-linux/libstdc++-v3/include/bits/basic_string.h", __line=__line@entry=1058,
__function=__function@entry=0x7ffff7e2f660 "std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator[](std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type) [with _Ch"...,
__condition=__condition@entry=0x7ffff7e2cd11 "__pos <= size()")
at /usr/src/debug/gcc-11.2.1-1.fc34.x86_64/obj-x86_64-redhat-linux/x86_64-redhat-linux/libstdc++-v3/include/x86_64-redhat-linux/bits/c++config.h:514
#3 0x00007ffff7dd124b in std::__cxx11::basic_string<char, std::char_traits, std::allocator >::operator[] (this=,
__pos=)
at /usr/src/debug/gcc-11.2.1-1.fc34.x86_64/obj-x86_64-redhat-linux/x86_64-redhat-linux/libstdc++-v3/include/bits/basic_string.h:1058
#4 std::__cxx11::basic_string<char, std::char_traits, std::allocator >::operator[] (this=, __pos=)
at /usr/src/debug/gcc-11.2.1-1.fc34.x86_64/obj-x86_64-redhat-linux/x86_64-redhat-linux/libstdc++-v3/include/bits/basic_string.h:1054
#5 0x0000000000938398 in rr::normalize_file_name (s="/usr/lib/debug/../../../../.dwz/.dwz/.dwz/.dwz/.dwz/.dwz/") at src/util.cc:2297
#6 0x00000000008e22c9 in rr::find_auxiliary_file (original_file_name="/usr/lib64/gio/modules/libgvfsdbus.so",
aux_file_name="../../../../.dwz/gvfs-1.48.1-1.fc34.x86_64", full_file_name="/usr/lib/debug/../../../../.dwz/.dwz/.dwz/.dwz/.dwz/.dwz/")
at src/SourcesCommand.cc:403
#7 0x00000000008e3306 in rr::try_debuglink_file (trace_file_reader=..., trace_relative_name="mmap_pack_106_libgvfsdbus.so",
original_file_name="/usr/lib64/gio/modules/libgvfsdbus.so", file_names=0x7fffffffd210, aux_file_name="libgvfsdbus.so-1.48.1-1.fc34.x86_64.debug",
comp_dir_substitutions=std::map with 0 elements, dwos=0x7fffffffd1c0, external_debug_info=0x7fffffffd1e0, dir_exists_cache=...)
at src/SourcesCommand.cc:534
#8 0x00000000008e48ad in rr::sources (binary_file_names=std::map with 242 elements = {...}, comp_dir_substitutions=std::map with 0 elements,
is_explicit=false) at src/SourcesCommand.cc:788
#9 0x00000000008e5f5a in rr::SourcesCommand::run (this=0xb3ea20 rr::SourcesCommand::singleton, args=std::vector of length 0, capacity 2)
at src/SourcesCommand.cc:986
#10 0x00000000009502fd in main (argc=3, argv=0x7fffffffd9b8) at src/main.cc:251

@jesup
Copy link
Author

jesup commented Jan 11, 2022

in find_auxiliary_file(), we call normalize_file_name on
full_file_name = "/usr/lib/debug/" + aux_file_name;
aux_file_name is ../../../../.dwz/gvfs-1.48.1-1.fc34.x86_64
when it crashed in normalize_file_name, the string had been changed to /usr/lib/debug/../../../../.dwz/.dwz/.dwz/.dwz/.dwz/.dwz/
quickly I'll note that s_len is 57, and we crash on s[out] = s[i], and out is 58 and i is 53

@khuey
Copy link
Collaborator

khuey commented Jan 13, 2022

Should be fixed by a8b2c01

@khuey khuey closed this as completed Jan 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants