2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 14:25:49 +00:00
Kir Kolyshkin 8ea0ba7dd0 string.h: fix memset over-optimization with clang
We found a weird case of parasite code dying of SIGSEGV when clang
is used as a compiler (see [1] for more details).

Apparently, it was caused by clang optimizing our builtin_memset()
by inserting a call to memset(). It is a valid compiler optimization,
aside from the fact that in our code memset() is defined as a weak
alias to builtin_memset(), which of course lead to infinite recursion
and stack growth.

This might be a bug in compiler, but there are ways to avoid it:

1. Rewrite builtin_memset() in asm (note it needs to be done
   for every architecture supported).
2. Disable compiler optimizations for this code (say, by using -O0).
3. Declare the pointer inside builtin_memcpy() as volatile.

The last approach looks more appealing -- mostly for being simple.

[1] https://github.com/xemul/criu/issues/279

travis-ci: success for string.h: fix memset over-optimization with clang
Cc: Andrei Vagin <avagin@virtuozzo.com>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-03 18:04:22 +03:00
2016-06-28 13:04:58 +03:00
2016-12-21 11:23:02 +03:00
2012-03-25 23:31:20 +04:00
2016-08-11 16:18:43 +03:00
2012-07-30 13:52:37 +04:00
2017-01-16 12:06:01 +03:00

CRIU (Checkpoint and Restore in Userspace)

An utility to checkpoint/restore tasks. Using this tool, you can freeze a running application (or part of it) and checkpoint it to a hard drive as a collection of files. You can then use the files to restore and run the application from the point it was frozen at. The distinctive feature of the CRIU project is that it is mainly implemented in user space.

The project home is at http://criu.org.

Pages worth starting with are:

A video tour on basic CRIU features

CRIU introduction

How to contribute

Description
No description provided
Readme 81 MiB
Languages
C 86%
Python 6.1%
Java 2.6%
Shell 2.6%
Makefile 2%
Other 0.7%