When using RR with gdb 7.12.1 to debug the 'opt' binary in LLVM I get weird errors:

Open
#1,955 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
cpp, linux

Research direction

Reproduce the recorded crash with the shown rr record command, then run rr replay using gdb 7.12.1 and collect the GdbConnection log referenced in the issue. Compare the replay state and backtrace with the original assertion; done means identifying the cause of the unusable replay or documenting a confirmed compatibility fix.

Written by the indexing model from the issue text.

Description

I have a buggy binary, it assert fails:

% rr record ./dbg/bin/opt -S -passes=inline,argpromotion -o - /home/chandlerc/src/llvm.git/test/Transforms/ArgumentPromotion/crash.ll                                                                                                                                                      
rr: Saving execution to trace directory `/home/chandlerc/.local/share/rr/opt-1'.
opt: ../../lib/Analysis/LazyCallGraph.cpp:1692: void llvm::LazyCallGraph::removeDeadFunction(llvm::Function &): Assertion `RC.Parents.empty() && "Cannot have parents of a dead RefSCC!"' failed.
#0 0x00000000043275bc llvm::sys::PrintStackTrace(llvm::raw_ostream&) /home/chandlerc/src/llvm.git/build/dbg/../../lib/Support/Unix/Signals.inc:402:11
#1 0x0000000004327ba9 PrintStackTraceSignalHandler(void*) /home/chandlerc/src/llvm.git/build/dbg/../../lib/Support/Unix/Signals.inc:466:1
#2 0x00000000043246e7 llvm::sys::RunSignalHandlers() /home/chandlerc/src/llvm.git/build/dbg/../../lib/Support/Signals.cpp:0:5
#3 0x0000000004327f30 SignalHandler(int) /home/chandlerc/src/llvm.git/build/dbg/../../lib/Support/Unix/Signals.inc:256:1
#4 0x00007f586a086030 __restore_rt (/lib64/libpthread.so.0+0x11030)
#5 0x0000000070000002
Stack dump:
0.      Program arguments: ./dbg/bin/opt -S -passes=inline,argpromotion -o - /home/chandlerc/src/llvm.git/test/Transforms/ArgumentPromotion/crash.ll 
zsh: abort      rr record ./dbg/bin/opt -S -passes=inline,argpromotion -o - 

When I go to replay:

% rr replay                                                                                                                          
GNU gdb (Gentoo 7.12.1 vanilla) 7.12.1
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/chandlerc/.local/share/rr/latest-trace/mmap_clone_4_opt...done.
Really redefine built-in command "restart"? (y or n) [answered Y; input not from terminal]
>>> >>> >>> >>> ... ... >>> ... ... >>> ... ... ... 
>>> 
Remote debugging using :33958
warning: unable to open /proc file '/proc/33946/task/33946/maps'
warning: remote target does not support file transfer, attempting to access files from local filesystem.
Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols found)...done.
0x00007f586a292bc0 in ?? () from /lib64/ld-linux-x86-64.so.2
(rr) bt
#0  0x00007f586a292bc0 in ?? () from /lib64/ld-linux-x86-64.so.2
#1  0x0000000000000006 in ?? ()
#2  0x00007ffcf349d7b9 in ?? ()
#3  0x00007ffcf349d7c7 in ?? ()
#4  0x00007ffcf349d7ca in ?? ()
#5  0x00007ffcf349d7e6 in ?? ()
#6  0x00007ffcf349d7e9 in ?? ()
#7  0x00007ffcf349d7eb in ?? ()
#8  0x0000000000000000 in ?? ()
(rr) r
0x00007f586a292bc3 in ?? () from /lib64/ld-linux-x86-64.so.2
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/chandlerc/.local/share/rr/opt-1/mmap_clone_4_opt 
warning: unable to open /proc file '/proc/33946/task/33946/maps'

Program stopped.
0x00007f586a292bc0 in ?? () from /lib64/ld-linux-x86-64.so.2
(rr) bt
#0  0x00007f586a292bc0 in ?? () from /lib64/ld-linux-x86-64.so.2
#1  0x0000000000000006 in ?? ()
#2  0x00007ffcf349d7b9 in ?? ()
#3  0x00007ffcf349d7c7 in ?? ()
#4  0x00007ffcf349d7ca in ?? ()
#5  0x00007ffcf349d7e6 in ?? ()
#6  0x00007ffcf349d7e9 in ?? ()
#7  0x00007ffcf349d7eb in ?? ()
#8  0x0000000000000000 in ?? ()
(rr) q

RR version is master 9961466.

Adding RR_LOG=GdbConnection based on what was suggested in another issue shows (in a gist due to size): https://gist.github.com/8d4ab83290063fc74b08f68c3181d8a7

Let me know if I can provide more details!

Dominant language
C++
Stars
10.7k
Forks
662
Avg merge
2d 3h
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rr-debugger/rr

All issues in rr-debugger/rr

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.