sidkshatriya / rd

rd is a record/replay debugger written in rust
Other
961 stars 14 forks source link

Error message when using rd executable copied elsewhere is somewhat unhelpful #10

Open vi opened 3 years ago

vi commented 3 years ago

If I, thinking that rd executable is self-contained and does not require any accessories, copy target/release/rd to some ~/bin/ and try recording something, I get rather long error output:

rd: Saving execution to trace directory "/mnt/bkel/vi/.local/share/rd/ls-0".
[FATAL src/session/address_space.rs:2341]
 (task 9345 (rec: 9345) at time 14)
 -> Assertion `child_fd != -ENOENT' failed to hold. rd_page file not found: "/mnt/bkel/vi/bin2/../share/rd/rd_page_64"
Tail of trace dump: 0-14
{
  real_time:197574.205267 global_time:1, event:`SYSCALL: prctl' (state:ENTERING_SYSCALL) tid:9345, ticks:2
rax:0xffffffffffffffda rbx:0x9 rcx:0xffffffffffffffff rdx:0x7ffe041d4dd0 rsi:0x2 rdi:0x16 rbp:0x55d0403ac650 rsp:0x7ffe041d4b70 r8:0x0 r9:0x0 r10:0x0 r11:0x246 r12:0x2481 r13:0x3e9 r14:0x2 r15:0x55d0404d82f0 rip:0x7f3c3a23d5cd eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0x9d fs_base:0x7f3c3a13e500 gs_base:0x0
}
{
  real_time:197574.206015 global_time:2, event:`SYSCALL: prctl' (state:EXITING_SYSCALL) tid:9345, ticks:2
rax:0x0 rbx:0x9 rcx:0xffffffffffffffff rdx:0x7ffe041d4dd0 rsi:0x2 rdi:0x16 rbp:0x55d0403ac650 rsp:0x7ffe041d4b70 r8:0x0 r9:0x0 r10:0x0 r11:0x246 r12:0x2481 r13:0x3e9 r14:0x2 r15:0x55d0404d82f0 rip:0x7f3c3a23d5cd eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0x9d fs_base:0x7f3c3a13e500 gs_base:0x0
}
... (skipped more of them)
=== Start rd backtrace:
   0: rd::log::emergency_debug
   1: rd::session::task::task_common::post_exec_syscall_common
   2: rd::record_syscall::process_execve
   3: rd::record_syscall::rec_process_syscall_arch
   4: rd::session::record_session::RecordSession::syscall_state_changed
   5: rd::session::record_session::RecordSession::record_step
   6: rd::commands::record_command::RecordCommand::record
   7: rd::main
   8: std::sys_common::backtrace::__rust_begin_short_backtrace
   9: std::rt::lang_start::{{closure}}
  10: main
  11: __libc_start_main
  12: _start

=== End rd backtrace
Launch gdb with
  gdb '-l' '10000' '-ex' 'set sysroot /' '-ex' 'target extended-remote 127.0.0.1:9345' /usr/bin/ls

and if locks up until I ^C.

I think rd should detect absence of required files earlier and provide nicer error message about installation method being wrong.

sidkshatriya commented 3 years ago

You are correct to state that rd executable is not self contained. It needs some support files. Agree -- it would be great if there were better messages here.

(Now that you are aware what the issue is, have you been able to get rd to run properly? What distro are you using?)

vi commented 3 years ago

Yes, it runs properly if started from a symlink that goes to /full/path/to/rd/target/release/rd. It's amd64 Debian 11 bullseye.

sidkshatriya commented 3 years ago

Thanks for the info -- Good to know that its working on Debian 11 amd64.

You can also run the ./install.sh script. This will avoid any need for manual symlinking.

See https://github.com/sidkshatriya/rd#installing-rd