📜 ⬆️ ⬇️

Quick Mozilla debugger with recording and playback

Mozilla has released a tool that will surely make life easier for many: it is the RR framework under Linux for recording and then playing the program progress. Reproduction is absolutely deterministic, that is, with the same registers and memory addresses - and invariably with the same failure (if it was). In other words, you can endlessly drive tests, and as soon as a bug appears - take your time to study it offline, scrolling the record as many times as you like. All process and flow trees are logged.

RR is designed to accurately reproduce bugs that manifest themselves unpredictably. In such cases, when debugging with standard tools, it makes no sense to start the program again: it’s not a fact that the bug manifests itself again. This problem constantly spoils the life of developers. That is why Mozilla decided to create such a framework.

RR raises debugging to a new level: before leaving for lunch, leave a script for tests with different parameters, and by your return RR will record at least one execution with an error. You can scroll through this entry and understand what the problem is.

Theoretically, GDB is also able to unwind the execution of a program, but in reality this function in RR is implemented an order of magnitude better. The main thing that was able to solve the problem with performance: the reproduction of the program occurs at almost the same speed as the normal performance, because RR records only changing fragments and does not touch most of the program.
')
The diagram shows how much the recording speed and playback speed of the recorded program differ from its native performance (overhead).


Relatively large overhead reftest due to the fact that the current configuration of Gecko for Linux works through the X-server

Unfortunately, the debugger supports only x86 32-bit processes so far, but this restriction will probably be removed in future versions. Another limitation of the first version is emulation of a single-core machine only. To record parallel computations, you can't do without hardware support, so you won't get rid of this limitation so easily. And yet, the debugger works only on Intel Ivy Bridge and Sandy Bridge processors.

Creating the RR 1.0 debug tool took Mozilla developers two years. Code on github .

Source: https://habr.com/ru/post/217251/


All Articles