Loading and saving recordings

When suitably licensed, UDB can load and save LiveRecorder recordings.

Loading recordings

Loading a LiveRecorder recording loads the execution history of the program loaded from the recording file, including any debug symbols, so that it is ready to be replayed. It also loads bookmarks created by the same user when previously replaying the recording.

Load a recording using the uload command in UDB, or by specifying the filename on the UDB command line.

Loading a recording from the command line

You can specify a LiveRecorder recording when starting UDB. When a recording is passed as a command-line argument to udb, it is automatically loaded. For example:

$ udb recording.undo
Reading symbols from /tmp/undodb.2413529.1708020048.5014203.050aa3bc7ddb30ed/debuggee-1-x2tncdst/symbol-files/lib/x86_64-linux-gnu/libm.so.6...
Reading symbols from /tmp/undodb.2413529.1708020048.5014203.050aa3bc7ddb30ed/debuggee-1-x2tncdst/symbol-files/usr/lib/debug/.build-id/2d/28b51427b49abcd41dcf611f8f3aa6a2811734.debug...
Reading symbols from /tmp/undodb.2413529.1708020048.5014203.050aa3bc7ddb30ed/debuggee-1-x2tncdst/symbol-files/lib/x86_64-linux-gnu/libc.so.6...
Reading symbols from /tmp/undodb.2413529.1708020048.5014203.050aa3bc7ddb30ed/debuggee-1-x2tncdst/symbol-files/usr/lib/debug/.build-id/04/01bd8da6edab3e45399d62571357ab12545133.debug...
Reading symbols from /tmp/undodb.2413529.1708020048.5014203.050aa3bc7ddb30ed/debuggee-1-x2tncdst/symbol-files/lib64/ld-linux-x86-64.so.2...
Reading symbols from /tmp/undodb.2413529.1708020048.5014203.050aa3bc7ddb30ed/debuggee-1-x2tncdst/symbol-files/usr/lib/debug/.build-id/42/86bd11475e673b194ee969f5f9e9759695e644.debug...
0x00005590ee755080 in _start ()
start 1> continue
Continuing.

Program received signal SIGABRT, Aborted.
Have reached end of recorded history.

The recorded program has exited.
You can use UDB reverse commands to go backwards; see "help udb" for details.

__pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6,
    no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
44      ./nptl/pthread_kill.c: No such file or directory.
end 217,026> backtrace
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6,
    no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
#1  0x00007fb2ff026d2f in __pthread_kill_internal (signo=6, threadid=<optimized out>)
    at ./nptl/pthread_kill.c:78
#2  0x00007fb2fefd7ef2 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007fb2fefc2472 in __GI_abort () at ./stdlib/abort.c:79
#4  0x00005590ee7553a8 in main () at cache.c:85

uload [-e|-goto-end] filename

Load a LiveRecorder recording.

The filename argument names the recording file.

For example:

$ udb
not running> uload recording.undo
0x00005590ee755080 in _start ()

The debugged program is at the beginning of recorded history. Start debugging
from here or, to proceed towards the end, use:
    continue - to replay from the beginning
    ugo end  - to jump straight to the end of history
start 1 at-start> continue
Continuing.

Program received signal SIGABRT, Aborted.
Have reached end of recorded history.

The recorded program has exited.
You can use UDB reverse commands to go backwards; see "help udb" for details.

__pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6,
    no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
44      ./nptl/pthread_kill.c: No such file or directory.
-e, -goto-end

Jump to the end of execution history immediately after loading. This has the same effect as the ugo end command, but can be substantially faster.

$ udb
not running> uload -e recording.undo
0x00005590ee755080 in _start ()

Performing "ugo end" to jump to the end of the recording. Press ^C to
interrupt this and go back to the start.

info recording-version

The Undo version used to create the loaded LiveRecorder recording.

For example:

end 217,026> info recording-version
7.2.0

Going to the end of execution history after loading

By default, UDB starts replaying the recording from the beginning of execution history, but when investigating a crash it is often more convenient to start at the end.

Use the udb --load-goto-end command-line option to start debugging the loaded recording from the end of execution history. This is significantly faster than loading the recording and issuing the ugo end command as separate steps. For example:

$ udb --load-goto-end recording.undo
Reading symbols from /tmp/undodb.2413804.1708020053.8986695.e15802c9d054f0b7/debuggee-1-878strxt/symbol-files/lib/x86_64-linux-gnu/libm.so.6...
Reading symbols from /usr/lib/debug/.build-id/2d/28b51427b49abcd41dcf611f8f3aa6a2811734.debug...
Reading symbols from /usr/lib/debug/.build-id/42/86bd11475e673b194ee969f5f9e9759695e644.debug...
0x00005590ee755080 in _start ()

Performing "ugo end" to jump to the end of the recording. Press ^C to
interrupt this and go back to the start.

end 217,026> backtrace
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6,
    no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
#1  0x00007fb2ff026d2f in __pthread_kill_internal (signo=6, threadid=<optimized out>)
    at ./nptl/pthread_kill.c:78
#2  0x00007fb2fefd7ef2 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007fb2fefc2472 in __GI_abort () at ./stdlib/abort.c:79
#4  0x00005590ee7553a8 in main () at cache.c:85

This can be configured for all UDB sessions by setting UNDO_load_goto_end=true in the environment.

Replaying on a different CPU

Replaying a recording that was created on a different CPU requires that the replay CPU supports all the instructions used by the program when it was recorded. UDB refuses to load a recording if these requirements cannot be satisfied, although a warning may be shown instead when loading recordings made with older versions of LiveRecorder.

The info replayability command shows the CPU features required to replay the loaded recording.

info replayability

The CPU features required to replay the loaded LiveRecorder recording.

The features are reported in the same style as they appear in the flags fields of /proc/cpuinfo. A feature is listed if the program executed an instruction requiring that feature when it was originally recorded. Any hardware which supports all of the listed features can be used to replay this recording.

For example:

end 217,026> info replayability
The CPU features required to replay 'recording.undo' are: avx avx2 bmi1 lm sse
sse2 xsave xsavec.

Backwards compatibility

UDB can load LiveRecorder recordings that were generated by older versions of UDB or LiveRecorder.

The current version of UDB can load recordings generated by any stable version of UDB or LiveRecorder in the 6.x release series.

Support for old versions will be dropped when required in future releases, and this will be announced in the UDB changelog. Generally we aim to preserve support for recordings made by versions that are up to three years old, with older releases supported on a best-effort basis.

UDB cannot typically load recordings that were generated by newer versions of UDB or LiveRecorder.

Note

Loading recordings made by newer UDB or LiveRecorder versions may succeed if our internal recording format was not updated in the newer version, but you should avoid relying on this behaviour.

Attempting to load a recording made by a release that is too old or too new will cause an error message to be printed in your UDB session and the load will fail.

Saving recordings

usave [filename]

Save execution history as a LiveRecorder recording.

The optional filename argument names the recording file. If omitted, a suitable filename is automatically generated.

The recording can be loaded into UDB using the uload command.

Recording File Locking

Recordings are locked while they are being written in ordrevent other Undo processes from accessing them before they are mpleted.

Attempts to save a recording to a file path that is already being saved to will fail:

$ live-record -o recording.undo true
live-record: Maximum event log size is 1G.
live-record: Saving to 'recording.undo'...
live-record: Failed to save recording recording.undo: Recording is being written in another process..
live-record: Detaching...

Attempts to load a recording that is being saved to will also fail:

$ udb recording.undo
Failed to load LiveRecorder recording.
because: Recording is being written in another process.

New in version 6.5.