Criu-coredump

From CRIU
Jump to navigation Jump to search

Generate valid core dump from CRIU images.

Description[edit]

Criu-coredump is a tool that takes a directory with CRIU images and produces Elf cores.

It consists of a python script(criu/coredump/criu-coredump) for cmdline use, as well as a python module(criu/coredump/criu_coredump) to manipulate generated cores on a deeper level.

Prerequisites[edit]

As the main goal of CRIU is to be able to save process tree on disk to be restored later, the amount of information its images contain is much bigger than what is typically contained in a core dump(i.e. memory + few notes). That and the fact that CRIU provides a number of convenient API's, in theory gives anyone an ability to use CRIU for debugging their applications, i.e. like the abandoned google-coredumper allows you to generate core dumps at any time. But in practice, there are no tools that have native support for criu images, making it impossible to conveniently use them for such purpose. So it would be nice if we could convert criu images into much more common core dumps to be used with a great variety of available tools.

Limitations[edit]

For now only x86_64 is supported. The matter of supporting other architectures supported by CRIU is to use proper constants in elf header and provide proper arch-dependent notes.

Some notes in coredump are not fullfilled(i.e. SIGINFO).

VVAR and VSYSCALL vmas are just filled with zeroes, as CRIU doesn't currently provide them. VVAR is a tricky one and gdb also has problems dumping it[1]. VSYSCALL in theory could just be read from current process, so it should be quite easy to fix.

Usage[edit]

criu-coredump [-h] [-i IN] [-p PID] [-o OUT]                         
                                                                            
CRIU core dump                                                              
                                                                            
optional arguments:                                                         
  -h, --help         show this help message and exit                        
  -i IN, --in IN     directory where to get images from                     
  -p PID, --pid PID  generate coredump for specific pid(all pids py default)
  -o OUT, --out OUT  directory to write coredumps to                        

Project resources[edit]

Demo of a previous version of criu-coredump, when it was planned to be a part of CRIT.