Hi dmtcp folks, I am running dmtcp 2.4.5 release on a red hat 6.6 (see detailed in in appendix below) and run into the following problem: * the vdso section is re-located after mtcp_check_vdso is executed in mtcp_restart - personality flag ADDR_NO_RANDOMIZE is not set when mtcp_restart is executed * leads mtcp_restart to set ADDR_NO_RANDOMIZE and re-exec mtcp_restart in mtcp_check_vdso * after the re-exec the vdso section is in a different location -> in turn this breaks restore for some processes as the new vdso overlaps with the location where mtcp_restart wants to re-locate itself to
I didn't really tried newer dmtcp-* releases as the corresponding code seem the same in master. I tried to reconstruct the whole scenario without dmtcp as in the c file test.c (see appendix below). Surprisingly to me the vdso section was not relocated when running this test program. I wanted to ask the following: * Do you have any experience or explanation why the vdso section moves in mtcp_restart after setting ADDR_NO_RANDOMIZE and re-execing but not in the test program? Is the re-location maybe not related to setting ADDR_NO_RANDOMIZE? * Generally, do we need to set ADDR_NO_RANDOMIZE in mtcp_check_vdso if ASLR is turned off globally (/proc/sys/kernel/randomize_va_space == 0)? Thanks a lot for any feedback or thoughts. Cheers Johannes Appendix: [test.c]: =============================================================== #include <sys/personality.h> #include <unistd.h> #include <stdio.h> #include <stdlib.h> int main() { int pers = personality (0xfffffffful); printf("personality=0x%x, ADDR_NO_RANDOMIZE=%d, ADDR_COMPAT_LAYOUT=%d\n", pers, (pers&ADDR_NO_RANDOMIZE?1:0), (pers&ADDR_COMPAT_LAYOUT?1:0)); personality ((pers | ADDR_NO_RANDOMIZE) & ~ADDR_COMPAT_LAYOUT); pers = personality (0xfffffffful); printf("personality=0x%x, ADDR_NO_RANDOMIZE=%d, ADDR_COMPAT_LAYOUT=%d\n", pers, (pers&ADDR_NO_RANDOMIZE?1:0), (pers&ADDR_COMPAT_LAYOUT?1:0)); { FILE* f = fopen("/proc/self/maps", "r"); int c; while ((c = getc(f)) != EOF) { printf("%c", c); } } if (!getenv("REEXEC")) { char* envp[] = { "REEXEC=1", 0}; execve("./test",0,envp); } return 0; } =============================================================== [env]: =============================================================== DMTCP version: 2.4.5 Date built: Tue Mar 19 08:47:01 CET 2019 config.log: ./configure --prefix=<PATH>/dmtcp-gcc-6.2.0/2.4.5 CXXFLAGS=-g3 -O0 -DDEBUG CFLAGS=-g3 -O0 -DDEBUG --enable-debug --disable-m32 --disable-pthread-mutex-wrappers --d isable-openmp --disable-infiniband-support --disable-forked-checkpointing --disable-fast-restart --disable-delta-compression Description: CentOS release 6.6 (Final) Codename: Final Linux 2.6.32-696.30.1.el6.x86_64 #1 SMP Tue May 22 03:28:18 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux Compiler: gcc Using built-in specs. COLLECT_GCC=/SDR/main/linux64/bin/gcc COLLECT_LTO_WRAPPER=/SDR/linux64/gcc/6.2.0/bin/../libexec/gcc/x86_64-pc-linux-gnu/6.2.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /sdrsandbox/linux64/gcc520/src/gcc-6.2.0/configure --disable-nls --enable-languages=c++,fortran --with-gnu-as --with-gnu-ld --enable-__cxa_atexit --with-cpu=generic --prefix=/SDR/linux64/ gcc/6.2.0 Thread model: posix gcc version 6.2.0 (GCC) CFLAGS: -DDEBUG -g -O0 -Wall CXXFLAGS: -DDEBUG -g -O0 -Wall CPPFLAGS: LDFLAGS: openjdk version "1.8.0_171" OpenJDK Runtime Environment (build 1.8.0_171-b10) OpenJDK 64-Bit Server VM (build 25.171-b10, mixed mode) lrwxrwxrwx 1 root root 12 Apr 12 2018 /lib64/libc.so.6 -> libc-2.12.so lrwxrwxrwx 1 root root 12 Apr 12 2018 /lib/libc.so.6 -> libc-2.12.so -rw------- 1 root root 217016 Mar 19 08:46 /var/db/nscd/hosts -rw-r--r-- 1 root root 5 Dec 8 10:22 /var/run/nscd/nscd.pid srw-rw-rw- 1 root root 0 Dec 8 10:22 /var/run/nscd/socket =============================================================== _______________________________________________ Dmtcp-forum mailing list Dmtcp-forum@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dmtcp-forum