Makefile:305: warning: overriding recipe for target 'shm-unaligned.pid'
Makefile:290: warning: ignoring old recipe for target 'shm-unaligned.pid'
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
CID 161665 (#1 of 1): Uninitialized pointer read (UNINIT)
14. uninit_use: Using uninitialized value vma.
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
CID 161664 (#1 of 1): Resource leak (RESOURCE_LEAK)
11. leaked_storage: Variable re going out of scope leaks the storage it points to.
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
CRIU dump should fail if criu can't handle something.
v2: add a separate patch to remove noauto for a few tests
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Looks like noauto was set by mistake for these tests
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This allows pre-dump scripts to know CT root_item pid
and enter into its namespaces.
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This one is a little big ugly, see comments for details. At some point we
should invent a better way to do these special cases, since we have them
for freezer, cpuset, and now devices. Perhaps something like fstype, where
you can ask the cgroup how to restore itself.
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
CC: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
In particular add support for the new controllers:
* perf_event (nothing here, but may be used by the perf tool so we should
keep it)
* net_cls
* net_prio
* pids
Also add support for many more memory properties that were not implemented
in the first pass, but the container may use.
Note that this commit omits the "devices" controller, because that needs to
be checkpointed and restored in a special way.
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
CC: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
We'll use this in the next patchset where we want to dump global properties
of the freezer cgroup, but none of the special ones for this cgroup,
because they're handled separately.
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
CC: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
List "unix_sockets" is used to link external sockets.
Change this, to link all unix sockets there. To differ
really external sockets in fix_external_unix_sockets(),
we may check for socket's already_dumped value.
This may be useful to traverse over all unix sockets
in a namespace.
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Export current to allow to use find_unused_fd()
from everywhere.
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
I suggest to add support for coveralls.io.
It can't show all coverage, as we don't run all tests on travis,
but still everyone who forked CRIU can see instant coverage of
his Travis build. As a nice feature, it will show code cover
increasing/decreasing just after you push a commit - which
could give you a nice hint about content of a new tests.
For this feature, we need to build CRIU with `make GCOV=1`,
which adds --coverage and disables optimizations.
The resulting report looks like this:
https://coveralls.io/builds/6439346
I was thinking about codecov.io also, but it has fewer community,
less fixed issues on github - so I choose this service.
Just a random fun fact:
file-ids.c covered completely on tests, except -ENOMEM return.
Maybe it worth to run fault injections tests on Travis.
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
The s_dev as well as mnt_id may change during container
migration, so exclude them from the comparision.
Signed-off-by: Cyrill Gorcunov <gorcunov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
It can be dead-lokced:
#0 0x00007fafbf49f6ac in __lll_lock_wait_private () from /lib64/libc.so.6
#1 0x00007fafbf44af1c in _L_lock_2460 () from /lib64/libc.so.6
#2 0x00007fafbf44ad57 in __tz_convert () from /lib64/libc.so.6
#3 0x00000000004022e2 in test_msg (format=0x404508 "Receive signal %d\n") at msg.c:51
#4 <signal handler called>
#5 0x00007fafbf3f2483 in __GI__IO_vfscanf () from /lib64/libc.so.6
#6 0x00007fafbf408f27 in vsscanf () from /lib64/libc.so.6
#7 0x00007fafbf4032f7 in sscanf () from /lib64/libc.so.6
#8 0x00007fafbf449ba6 in __tzset_parse_tz () from /lib64/libc.so.6
#9 0x00007fafbf44c4cb in __tzfile_compute () from /lib64/libc.so.6
#10 0x00007fafbf44ae17 in __tz_convert () from /lib64/libc.so.6
#11 0x00000000004022e2 in test_msg (format=format@entry=0x40458c "PASS\n") at msg.c:51
#12 0x0000000000401ceb in main (argc=<optimized out>, argv=<optimized out>) at ptrace_sig.c:172
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Tested-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Seems @rpc-> part has been sneaked out (forgot to
push into index), as result it built fine locally,
but not when applied from the patch.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
For handling --cgroup-props, --cgroup-props-file and
--cgroup-dump-controller from RPC interface.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
I found the meaning of comparing basename-s for mounts in mount_qual(),
which was removed in v2.1-49-gbcf40bf.
I think it was an attempt to detect siblings (propagated mounts).
Actually it's wrong to compare only basenames for such mounts and
we need to generate full paths for them.
For example:
28 25 0:25 / /sys/fs/cgroup/devices rw shared:10 - cgroup cgroup rw,devices
29 28 0:49 / /sys/fs/cgroup/devices/101/xxx/yyy ...
38 35 0:25 /101 /sys/fs/cgroup/devices/ rw master:10 - cgroup cgroup rw,devices
39 38 0:49 / /sys/fs/cgroup/devices/xxx/yyy ...
28 and 38 are in the one shared group. 29 and 39 siblings and probably
one of them was mounted and another one was propagated.
This patch adds a function to generate a sibling mount point and
use it to propagate mounts
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
mount.c is too big already and the next patch adds one more such functions
with a few unit test, so it's better to add one more source file.
v2: fix compilation on arm and ppc
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This lock will have to be moved into the libsocr which is
not nice, so pull this out of the restore_tcp_queues.
And, since we're extending the section anyway, pull it away
from sk-tcp.c at all. Makes the code a little bit cleaner.
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Convert criu images to coredumps and check if they are
readable by readelf.
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
In automated tests we use test/crit-recode.py because of performance
benefits(no need to launch python interpreter more than once), but
manual test is still useful for manual testing, so lets make it
work again.
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This patch introduces a new subproject called "criu-coredump". The name
is pretty much self-explanatory, it allows generating coredumps from
criu images. Coredumps are readable and usable by gdb. The structure is
something in the middle of kernel-generated and gdb-generated core dumps.
This is a first iteration of core-dump patch series. It introduces
ability to generate gdb-operatable core dump only for x86_64 machines.
To support other architectures there will be a set to introduce proper
structures for notes section of the core dump. It is also worth noting,
that we still leave some notes(SIGINFO primarily) not fullfilled, as
I still need to figure out what to put in there in our case, where no
signal is involved in triggering core dump generation and other
caveats like zeroed vvar(we have problems with it withing CRIU itself
as well as gdb has some difficalties with it) and vsyscall vmas.
One can already use produced core dump with gdb, there is also
a quick simple demo https://asciinema.org/a/18936 .
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
For example in containers case there might be a number
of controllers mounted on the node which we should not
carry inside image when container is migrated. So
add ability to dump predefined controllers only
specified via command line --cgroup-dump-controller
option.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
We have some common predefined properties such as "cpuset.cpus" and etc gathered
in @cgp_predefined set, but there might be situation when only predefined ones
are not enough, so add ability to specify properties via --cgroup-props
and/or --cgroup-props-file options.
For example one may pass file with content
"cpu":
- "strategy": "merge"
- "properties": ["cpu.shares", "cpu.cfs_period_us"]
to dump custom properties for cpu controller.
The description is implemented in almost valid yaml, probably we will
need to support the various forms, but oneline is enough for now.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
So, we have some nice new features, again aimed at better integration,
also have massive restorer blob preparation rework and several nasty
bugfixes in mounts code.
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
I think we can improve error messages to distinguish task's kills
from segfaults from ptrace failures & etc.
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Acked-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Test should not assume that page size is 4096.
The test was failing on ppc64 where page size is usually 64K.
Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
It's possible to create sysvshmem segment with size not being
multiple of page_size. And this very size will be reported
everywhere in the interfaces.
Support this type of segments too.
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
join user namespace is not fully tested yet. So it is
not recommended to use this.
add a warning message when user tries to use join-ns with
user-namespace.
Signed-off-by: Deng Guangxing <dengguangxing@huawei.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>