- 11 Apr, 2017 9 commits
-
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Pavel Emelyanov authored
v2: Use logerr where needed. Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
An abstract name can contain zero characters. Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
In this patch, we replace all zero characters to '@'. ==30==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60300000e3ca at pc 0x7f34144b6be1 bp 0x7ffee7b6bb20 sp 0x7ffee7b6b298 READ of size 26 at 0x60300000e3ca thread T0 #0 0x7f34144b6be0 (/lib64/libasan.so.3+0x8dbe0) #1 0x7f34144b8e4d in __interceptor_vsnprintf (/lib64/libasan.so.3+0x8fe4d) #2 0x4966cb in vprint_on_level criu/log.c:228 #3 0x496b64 in print_on_level criu/log.c:249 #4 0x505c94 in collect_one_unixsk criu/sk-unix.c:1401 #5 0x4e7ae3 in collect_image criu/protobuf.c:213 #6 0x462c5c in root_prepare_shared criu/cr-restore.c:247 #7 0x462c5c in restore_task_with_children criu/cr-restore.c:1420 #8 0x7f34132d70ec in __clone (/lib64/libc.so.6+0x1030ec) 0x60300000e3ca is located 0 bytes to the right of 26-byte region [0x60300000e3b0,0x60300000e3ca) allocated by thread T0 here: #0 0x7f34144efe70 in malloc (/lib64/libasan.so.3+0xc6e70) #1 0x7f3413bdb021 (/lib64/libprotobuf-c.so.1+0x6021) Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
Using open_proc/fopen_proc/__open_proc is better since - it uses openat - it comes with nice error reporting Let's use it in places where we can. Even if it does not give any improvements (such as in cr-check.c), error message unification is good enough reason to do so. Requested-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
Replace 8-spaces with a tab in code. Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
So, in places where we have errno available (and it makes sense to show it), we want to use pr_perror(). In places where errno is not set/used, use pr_err(). Cc: Dengguangxing <dengguangxing@huawei.com> Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
1. No newline (pr_perror() already adds one for you) 2. No colon before file name, e.g. WAS: Can't open file: /some/file: permission denied NOW: Can't open file /some/file: permission denied Cc: Kirill Tkhai <ktkhai@virtuozzo.com> Cc: Dengguangxing <dengguangxing@huawei.com> Reviewed-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
Unlike pr_perror(), pr_err() does not append a newline. Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
- 02 Apr, 2017 31 commits
-
-
Andrei Vagin authored
It's very hard to understand an error without a context Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Pavel Emelyanov authored
The contents of sysvshm areas is sometimes dumped twice. First time it goes via cr_dump_shmem(), since each attachment of the segment is noted by the add_shmem_area() and thus gets into the list scanned by the former call(). Second time it is dumped by dump_ipc_shm_pages(). Another thing is that in the 1st dump memory gets into the standard pagemap/pages image pair, while in the 2nd time it's all written as plain byte array into ipcns-shm.img. At restore contents is read from the ipcns-shm.img (2nd). While the first way is preferred, let's (temporarily) eliminate it. Historically these segments were dumped and restored the 2nd way. Signed-off-by:
Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
This is just to prevent a compiler warning. Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
When this test is compiled on ARMv7, we get this: > maps03.c: In function 'main': > maps03.c:15:31: error: result of '10l << 30' requires 35 bits > to represent, but 'long int' only has 32 bits [-Werror=shift-overflow=] > mem = (void *)mmap(NULL, (10L << 30), PROT_READ | PROT_WRITE, > ^~ Surely, the nature of the test looks like it needs 64-bit addressing. Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
Make it possible to use a custom message telling why the test is skipped. Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
Makefile knows that a binary depends on .o file, and the .o file depends on .c file, and adds the per-target variables even in the indirect case. Therefore, .o suffix is not needed here. Note that it not hurts to leave it as is, so this commit is done only for the sake of keeping things simple. Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
This test name was added by commit 1ce1cca2, but there is no test. We do not use these lists since zdtm.py was introduced, therefore the error went unnoticed. I found it while running "make dep". Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
This commit expands the success with lib/Makefile to the rest of ztdm/Makefiles. In particular, it moves the common part to Makefile.inc and let {lib,static,transition}/Makefile use it. This results in: - dependencies being handled properly; - reduction of makefiles length due to unification; - possibly more proper dependencies and builds. While at it, let's also: - make rules for criu-rtc.so silent; - set default CC=gcc; - remove duplicate -m32 from CFLAGS. Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
In GNU make, 'override' means change a variable even if it was set from the make command line (as in "make VAR=value"). As we do not intend to modify CFLAGS/LDFLAGS from the command line, 'override' can be dropped. Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
Brevity is the soul of wit. Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
When optimizing our Travis runs, I noticed that test/zdtm/lib is built 3 times in a row -- first time the binaries, 2nd and 3rd time the deps, in parallel (sic!). I took a look at Makefile and found this, and some more problems, like: - dependencies are generated but not included - cleandep does not depend on clean - groups.c dependencies are not generated (or used) - "make all" does not make groups binary - overcomplicated and unused groups.{pid,out,cleanout} targets - extra -f flag to rm - etc. This patch (hopefully) fixes all of the above. In addition, it provides a few enhancements: - enables "silent make" rules, so now lib/ is in line with the rest of zdtm - adds "dep" target (not used, just for convenience) Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
Commit 299e4b4 ("travis: enable ccache for docker/qemu builds") combined multiple RUN statements in Dockerfiles into a single one, which is good for performance (as there is an intermediate cache created after each statement). Unfortunately, it partially did so by combining statements with use of semicolons, meaning we are ignoring non-zero exit codes. As a result, failure from make are ignored and Travis builds are all green. To fix, replace all occurences of semicolon with &&. Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
Since commit 93db22b ("compel: no -r for ARM ldflags") and commit ce043d3 ("compel: make plugins .a archives") the generated parasite/restorer blobs for 32-bit ARM are no longer relocatable, and so their ELF header has e_type of ET_EXEC (rather than ET_REL). As a result, we have "Unsupported header detected" message and a failure from compel hgen. This commit allows e_type == ET_EXEC in case NO_RELOCS is defined. I am not sure if it's OK to still allow ET_REL -- maybe Dmitry can chime in on that. Cc: Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kirill Tkhai authored
revert_unix_sk_cwd() may rewrite errno, so call pr_perror() firstly. Signed-off-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Andrei Vagin authored
A static test has to be stopped, because zdtm.py compares file descriptors before and after c/r. Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
Commit d9486bd7 ("arm/pie/build: do not produce relocatable parasite object") removed -r from LDFLAGS used to compile criu pie. This functionality somehow never made it to criu-dev, and was also lost in master then compel was ported to it. Make it work with compel. Unfortunately it was not as simple as I initially thought, as -r flag to ld was built into nmk. This patch removes it, and adds it to all places that need intermediate linking. Cc: Dmitry Safonov <dsafonov@virtuozzo.com> Cc: Cyrill Gorcunov <gorcunov@openvz.org> Acked-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
The objective is to only do parasite code linking once -- when we link parasite objects with compel plugin(s). So, let's use ar (rather than ld) here. This way we'll have a single ld invocation with the proper flags (from compel ldflags) etc. There are two tricks in doing it: 1. The order of objects while linking is important. Therefore, compel plugins should be the last to add to ld command line. 2. Somehow ld doesn't want to include parasite-head.o in the output (probably because no one else references it), so we have to force it in with the modification to our linker scripts. NB: compel makefiles are still a big mess, but I'll get there. Acked-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
When performing static linking, the order of objects is important (when the linker finds an undefined reference, it looks forward, never back). Therefore, sorting objects breaks things. Required for the next patch. Cc: Cyrill Gorcunov <gorcunov@openvz.org> Acked-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
1. Remove .FORCE, it's not used. 2. Consolidate CFLAGS stripping into a single line. Acked-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
The way criu/pie/Makefile is currently written, ld is run twice: 1. link $(NAME-obj-y) objects to NAME.built-in.o 2. link NAME.built-in.o, pie.lib.a, and compel plugins to NAME.built-in.bin.o (with compel ldflags and linker script) There is absolutely no need for such two-stage linking, but it was OK. It is not OK now, as "compel ldflags" for ARM doesn't need -r, and we can't run the first stage with -r and the second stage without it. So, let's simplify linking using a single ld invocation. This is my third attempt in doing it, I think I nailed it this time -- it is now clean and (relatively) simple. While at it: - fix compel linker script dependency (it was not working); - rearrange the Makefile so variables goes first, then rules; - remove a comment about mount implementation in restorer. NOTE that compel is called with ./ prefix so the file paths it prints are also prefixed with ./, which is needed for objectify macro to ignore those. Acked-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
1. Remove useless LDFLAGS -- dynamic linker is not used here. 2. Remove $(iquotes) -- there are none defined here. 3. Consolidate filter-out statements into a single one. Acked-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
This is an addition to commit 3a7e027b ("criu: pie -- Switch to use compel shipped lds scripts"). Acked-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
There are too many directories in the include path. Let's remove this one, and refer to the blobs with pie/ prefix. Acked-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
This is a missing hunk from commit 85b04c8b "Makefiles: nuke $(SRC_DIR)" which has somehow escaped from my attention. Acked-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Stanislav Kinsburskiy authored
It can be passed as link to real object. Signed-off-by:
Stanislav Kinsburskiy <skinsbursky@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
Usually we print the PID we wait for, let's do the same here. Probably just a typo. Cc: Kirill Tkhai <ktkhai@virtuozzo.com> Reviewed-by:
Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Kir Kolyshkin authored
I guess this is a followup to commit 59e80d4f. 1 s/determinate/figure out/ (there is no "determinate" verb in English) 2 moved 'with' to the end Cc: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Kir Kolyshkin <kir@openvz.org> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Stanislav Kinsburskiy authored
These helpers are valuable and can be used outside. Signed-off-by:
Stanislav Kinsburskiy <skinsbursky@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-
Pavel Tikhomirov authored
Before dump: 438 437 0:51 /mtest /zdtm/static/mnt_ext_manual.test rw,relatime - tmpfs zdtm_auto_ext_mnt rw 439 437 0:51 /mtest /zdtm/static/mnt_ext_manual_private_shared_bind.test rw,relatime shared:144 - tmpfs zdtm_auto_ext_mnt rw 440 437 0:51 /mtest /zdtm/static/mnt_ext_manual_bind.test rw,relatime shared:144 - tmpfs zdtm_auto_ext_mnt rw 441 437 0:51 /mtest /zdtm/static/mnt_ext_manual_slave_shared_bind.test rw,relatime shared:145 master:144 - tmpfs zdtm_auto_ext_mnt rw 442 437 0:51 /mtest /zdtm/static/mnt_ext_manual_slave_bind.test rw,relatime master:145 - tmpfs zdtm_auto_ext_mnt rw >From log: mount mnt_ext_manual_slave_bind is restored as slave of mnt_ext_manual_slave_shared_bind, which is restored as slave of mnt_ext_manual_private_shared_bind, which is restored as shared of mnt_ext_manual_bind, which is restored as private bind of external, that is exactly the same way mnt_is_external() looks for external. v2: fix test to cover all cases in mnt_is_external() Signed-off-by:
Pavel Tikhomirov <ptikhomirov@virtuozzo.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
-