CARE

Description

CARE monitors the execution of the specified command to create an archive that contains all the material required to re-execute it in the same context. That way, the command will be reproducible everywhere, even on Linux systems that are supposed to be not compatible with the original Linux system. CARE is typically useful to get reliable bug reports, demonstrations, artifact evaluation, tutorials, portable applications, minimal rootfs, file-system coverage, ...

By design, CARE does not record events at all. Instead, it archives environment variables and accessed file-system components -- before modification -- during the so-called initial execution. Then, to reproduce this execution, the re-execute.sh script embedded into the archive restores the environment variables and relaunches the command confined into the saved file-system. That way, both initial and reproduced executions should produce the same results as they use the same context, assuming they do not rely on external events -- like key strokes or network packets -- or that these external events are replayed manually or automatically, using umockdev for instance. That means it is possible to alter explicitly the reproduced executions by changing content of the saved file-system, or by replaying different external events.

Privacy

To ensure that no sensitive file can possibly leak into the archive, CARE conceals recursively the content of $HOME and /tmp, that is, they appear empty during the original execution. Although, for consistency reasons, the content of $PWD is revealed even if it is nested into the two previous paths.

As a consequence, a program executed under CARE may behave unexpectedly because a required path is not accessible anymore. In this case, such a path has to be revealed explicitly. For details, see the options --concealed-path and --revealed-path, and the file concealed-accesses.txt as well.

It is advised to inspect the archived content before sharing it.

Example

In this example, Alice wants to report to Bob that the compilation of PRoot v2.4 raises an unexpected warning:

alice$ make -C PRoot-2.4/src/

make: Entering directory `PRoot-2.4/src'
[...]
CC    path/proc.o
./path/proc.c: In function 'readlink_proc':
./path/proc.c:132:3: warning: ignoring return value of 'strtol'
[...]

Technically, Alice uses Ubuntu 11.04 for x86, whereas Bob uses Slackware 13.37 on x86_64. Both distros are supposed to be shipped with GCC 4.5.2, however Bob is not able to reproduce this issue on his system:

bob$ make -C PRoot-2.4/src/

make: Entering directory `PRoot-2.4/src'
[...]
CC    path/proc.o
[...]

Since they don't have much time to investigate this issue by iterating between each other, they decide to use CARE. First, Alice prepends care to her command:

alice$ care make -C PRoot-2.4/src/

care info: concealed path: $HOME
care info: concealed path: /tmp
care info: revealed path: $PWD
care info: ----------------------------------------------------------------------
make: Entering directory `PRoot-2.4/src'
[...]
CC    path/proc.o
./path/proc.c: In function 'readlink_proc':
./path/proc.c:132:3: warning: ignoring return value of 'strtol'
[...]
care info: ----------------------------------------------------------------------
care info: Hints:
care info:   - search for "conceal" in `care -h` if the execution didn't go as expected.
care info:   - use `./care-130213072430.bin` to extract the output archive.

Then she sends the care-130213072430.bin file to Bob. Now, he should be able to reproduce her issue on his system:

bob$ ./care-130213072430.bin
[...]
bob$ ./care-130213072430/re-execute.sh

make: Entering directory `PRoot-2.4/src'
[...]
CC    path/proc.o
./path/proc.c: In function 'readlink_proc':
./path/proc.c:132:3: warning: ignoring return value of 'strtol'
[...]

So far so good! This compiler warning doesn't make sense to Bob since strtol is used there to check a string format; the return value is useless, only the errno value matters. Further investigations are required, so Bob re-execute Alice's GCC differently to get more details:

bob$ ./care-130213072430/re-execute.sh gcc --version

gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

The same invocation on his system returns something slightly different:

bob$ gcc --version

gcc (GCC) 4.5.2
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

This confirms that both GCC versions are the same, however Alice's one seems to have been modified by Ubuntu. Although, according to the web page related to this Ubuntu package [1] , no changes regarding strtol were made. So Bob decides to search into the files coming from Alice's system, that is, the rootfs directory in the archive:

bob$ grep -wIrl strtol ./care-130213072430/rootfs

care-130213072430/rootfs/usr/include/inttypes.h
care-130213072430/rootfs/usr/include/stdlib.h
[...]

Here, the file usr/include/stdlib.h contains a declaration of strtol with the "warn unused result" attribute. On Ubuntu, this file belongs to the EGLIBC package, and its related web page [2] shows that this attribute was actually wrongly introduced by the official EGLIBC developers. Ultimately Bob should notify them in this regard.

Thanks to CARE, Bob was able to reproduce the issue reported by Alice without effort. For investigations purpose, he was able to re-execute programs differently and to search into the relevant files.

[1] https://launchpad.net/ubuntu/oneiric/+source/gcc-4.5/4.5.2-8ubuntu4

[2] https://launchpad.net/ubuntu/+source/eglibc/2.13-0ubuntu13.2

Downloads

CARE is heavily based on PRoot, that's why they are both hosted in the same repository: https://github.com/proot-me/proot. Previous CARE releases were packaged at https://github.com/proot-me/proot-static-build/releases, however, that repository has since been archived. The latest builds can be found under the job artifacts for the GitLab CI/CD Pipelines for each commit.

Support

Feel free to send your questions, bug reports, suggestions, and patches to the mailing-list or to the forum, or chat with us on Gitter; but please be sure that your answer isn't in the user manual first.

top