add testcases for #732 #1065 #1102

This commit is contained in:
Ken Sato
2018-06-07 10:11:23 +09:00
parent 139123dc12
commit 9bb48186e6
35 changed files with 1653 additions and 0 deletions

38
test/issues/1065/CT_001.sh Executable file
View File

@@ -0,0 +1,38 @@
#!/bin/sh
TESTNAME=CT_001
arg_path=`realpath ./dummy_file`
. ./config
fail=0
echo "*** ${TESTNAME} start *******************"
real_path=`realpath ${arg_path}`
echo "file map: ${arg_path}"
${MCEXEC} ./file_map ${arg_path} | tee ./${TESTNAME}.log
if [ X$? != X0 ]; then
fail=1
fi
echo ""
echo "** grep ${real_path} from maps"
grep -a -e "${real_path}$" ./${TESTNAME}.log
if [ X$? = X0 ]; then
echo "[OK] ${real_path} is found"
else
echo "[NG] ${real_path} is not found"
fail=1
fi
if [ X$fail = X0 ]; then
echo "*** ${TESTNAME} PASSED"
else
echo "*** ${TESTNAME} FAILED"
fi
echo ""
rm ./${TESTNAME}.log

38
test/issues/1065/CT_002.sh Executable file
View File

@@ -0,0 +1,38 @@
#!/bin/sh
TESTNAME=CT_002
arg_path=./dummy_file
. ./config
fail=0
echo "*** ${TESTNAME} start *******************"
real_path=`realpath ${arg_path}`
echo "file map: ${arg_path}"
${MCEXEC} ./file_map ${arg_path} | tee ./${TESTNAME}.log
if [ X$? != X0 ]; then
fail=1
fi
echo ""
echo "** grep ${real_path} from maps"
grep -a -e "${real_path}$" ./${TESTNAME}.log
if [ X$? = X0 ]; then
echo "[OK] ${real_path} is found"
else
echo "[NG] ${real_path} is not found"
fail=1
fi
if [ X$fail = X0 ]; then
echo "*** ${TESTNAME} PASSED"
else
echo "*** ${TESTNAME} FAILED"
fi
echo ""
rm ./${TESTNAME}.log

38
test/issues/1065/CT_003.sh Executable file
View File

@@ -0,0 +1,38 @@
#!/bin/sh
TESTNAME=CT_003
arg_path=./lnk_to_dummy
. ./config
fail=0
echo "*** ${TESTNAME} start *******************"
real_path=`realpath ${arg_path}`
echo "file map: ${arg_path}"
${MCEXEC} ./file_map ${arg_path} | tee ./${TESTNAME}.log
if [ X$? != X0 ]; then
fail=1
fi
echo ""
echo "** grep ${real_path} from maps"
grep -a -e "${real_path}$" ./${TESTNAME}.log
if [ X$? = X0 ]; then
echo "[OK] ${real_path} is found"
else
echo "[NG] ${real_path} is not found"
fail=1
fi
if [ X$fail = X0 ]; then
echo "*** ${TESTNAME} PASSED"
else
echo "*** ${TESTNAME} FAILED"
fi
echo ""
rm ./${TESTNAME}.log

52
test/issues/1065/CT_004.sh Executable file
View File

@@ -0,0 +1,52 @@
#!/bin/sh
TESTNAME=CT_004
test_program=./print_maps
. ./config
fail=0
echo "*** ${TESTNAME} start *******************"
real_path=`realpath ${test_program}`
interp_path=`readelf -l ${test_program} | grep "interpreter:" | sed -r 's/.*\[.*interpreter:\s(.*)\].*/\1/'`
interp_real_path=`realpath ${interp_path}`
echo "exec : ${test_program}"
${MCEXEC} ${test_program} | tee ./${TESTNAME}.log
if [ X$? != X0 ]; then
fail=1
fi
echo ""
echo "** grep ${real_path} from maps"
grep -a -e "${real_path}$" ./${TESTNAME}.log
if [ X$? = X0 ]; then
echo "[OK] ${real_path} is found"
else
echo "[NG] ${real_path} is not found"
fail=1
fi
echo ""
echo "** grep ${interp_real_path} from maps"
grep -a -e "${interp_real_path}$" ./${TESTNAME}.log
if [ X$? = X0 ]; then
echo "[OK] ${interp_real_path} is found"
else
echo "[NG] ${interp_real_path} is not found"
fail=1
fi
if [ X$fail = X0 ]; then
echo "*** ${TESTNAME} PASSED"
else
echo "*** ${TESTNAME} FAILED"
fi
echo ""
rm ./${TESTNAME}.log

53
test/issues/1065/CT_005.sh Executable file
View File

@@ -0,0 +1,53 @@
#!/bin/sh
TESTNAME=CT_005
test_program=./static_print_maps
ref_program=./print_maps
. ./config
fail=0
echo "*** ${TESTNAME} start *******************"
real_path=`realpath ${test_program}`
interp_path=`readelf -l ${ref_program} | grep "interpreter:" | sed -r 's/.*\[.*interpreter:\s(.*)\].*/\1/'`
interp_real_path=`realpath ${interp_path}`
echo "exec : ${test_program}"
${MCEXEC} ${test_program} | tee ./${TESTNAME}.log
if [ X$? != X0 ]; then
fail=1
fi
echo ""
echo "** grep ${real_path} from maps"
grep -a -e "${real_path}$" ./${TESTNAME}.log
if [ X$? = X0 ]; then
echo "[OK] ${real_path} is found"
else
echo "[NG] ${real_path} is not found"
fail=1
fi
echo ""
echo "** grep ${interp_real_path} from maps"
grep -a -e "${interp_real_path}$" ./${TESTNAME}.log
if [ X$? != X0 ]; then
echo "[OK] ${interp_real_path} is not found"
else
echo "[NG] ${interp_real_path} is found"
fail=1
fi
if [ X$fail = X0 ]; then
echo "*** ${TESTNAME} PASSED"
else
echo "*** ${TESTNAME} FAILED"
fi
echo ""
rm ./${TESTNAME}.log

23
test/issues/1065/CT_006.sh Executable file
View File

@@ -0,0 +1,23 @@
#!/bin/sh
TESTNAME=CT_006
. ./config
fail=0
echo "*** ${TESTNAME} start *******************"
${MCEXEC} cat /proc/self/maps
if [ $? = 0 ]; then
echo "[OK] shell script is running normaly"
else
fail=1
fi
if [ X$fail = X0 ]; then
echo "*** ${TESTNAME} PASSED"
else
echo "*** ${TESTNAME} FAILED"
fi
echo ""

67
test/issues/1065/CT_007.sh Executable file
View File

@@ -0,0 +1,67 @@
#!/bin/sh
TESTNAME=CT_007
exec_program="./print_maps_and_cmdline"
test_program="./call_execve ${exec_program}"
. ./config
fail=0
echo "*** ${TESTNAME} start *******************"
real_path=`realpath ${exec_program}`
interp_path=`readelf -l ${exec_program} | grep "interpreter:" | sed -r 's/.*\[.*interpreter:\s(.*)\].*/\1/'`
interp_real_path=`realpath ${interp_path}`
echo "exec : ${test_program}"
#${test_program} | tee ./${TESTNAME}.log
${MCEXEC} ${test_program} 1> ./${TESTNAME}_maps.log 2> ./${TESTNAME}_cmdline.log
if [ X$? != X0 ]; then
fail=1
fi
cat ./${TESTNAME}_maps.log
echo ""
echo "** grep ${real_path} from maps"
grep -a -e "${real_path}$" ./${TESTNAME}_maps.log
if [ X$? = X0 ]; then
echo "[OK] ${real_path} is found"
else
echo "[NG] ${real_path} is not found"
fail=1
fi
echo ""
echo "** grep ${interp_real_path} from maps"
grep -a -e "${interp_real_path}$" ./${TESTNAME}_maps.log
if [ X$? = X0 ]; then
echo "[OK] ${interp_real_path} is found"
else
echo "[NG] ${interp_real_path} is not found"
fail=1
fi
cat ./${TESTNAME}_cmdline.log
echo ""
echo "** grep ${exec_program} from cmdline"
grep -a -e "${exec_program}" ./${TESTNAME}_cmdline.log
if [ X$? = X0 ]; then
echo "[OK] ${exec_program} is found"
else
echo "[NG] ${exec_program} is not found"
fail=1
fi
if [ X$fail = X0 ]; then
echo "*** ${TESTNAME} PASSED"
else
echo "*** ${TESTNAME} FAILED"
fi
echo ""
rm ./${TESTNAME}_maps.log
rm ./${TESTNAME}_cmdline.log

66
test/issues/1065/CT_008.sh Executable file
View File

@@ -0,0 +1,66 @@
#!/bin/sh
TESTNAME=CT_008
exec_program="./print_maps_and_cmdline"
test_program="./call_execve.sh ${exec_program}"
. ./config
fail=0
echo "*** ${TESTNAME} start *******************"
real_path=`realpath ${exec_program}`
interp_path=`readelf -l ${exec_program} | grep "interpreter:" | sed -r 's/.*\[.*interpreter:\s(.*)\].*/\1/'`
interp_real_path=`realpath ${interp_path}`
echo "exec : ${test_program}"
${MCEXEC} ${test_program} 1> ./${TESTNAME}_maps.log 2> ./${TESTNAME}_cmdline.log
if [ X$? != X0 ]; then
fail=1
fi
cat ./${TESTNAME}_maps.log
echo ""
echo "** grep ${real_path} from maps"
grep -a -e "${real_path}$" ./${TESTNAME}_maps.log
if [ X$? = X0 ]; then
echo "[OK] ${real_path} is found"
else
echo "[NG] ${real_path} is not found"
fail=1
fi
echo ""
echo "** grep ${interp_real_path} from maps"
grep -a -e "${interp_real_path}$" ./${TESTNAME}_maps.log
if [ X$? = X0 ]; then
echo "[OK] ${interp_real_path} is found"
else
echo "[NG] ${interp_real_path} is not found"
fail=1
fi
cat ./${TESTNAME}_cmdline.log
echo ""
echo "** grep ${exec_program} from cmdline"
grep -a -e "${exec_program}" ./${TESTNAME}_cmdline.log
if [ X$? = X0 ]; then
echo "[OK] ${exec_program} is found"
else
echo "[NG] ${exec_program} is not found"
fail=1
fi
if [ X$fail = X0 ]; then
echo "*** ${TESTNAME} PASSED"
else
echo "*** ${TESTNAME} FAILED"
fi
echo ""
#rm ./${TESTNAME}_maps.log
#rm ./${TESTNAME}_cmdline.log

View File

View File

@@ -0,0 +1,3 @@
STKN:[main] This is shell script
STKN:[main_loop] filename:./call_execve shell:0x(nil)
STKN:[main_loop] filename:./print_maps_and_cmdline shell:0x(nil)

45
test/issues/1065/Makefile Normal file
View File

@@ -0,0 +1,45 @@
CC = gcc
MCK_DIR=/home/satoken/ppos
MCEXEC=$(MCK_DIR)/bin/mcexec
TARGET= file_map print_maps static_print_maps call_execve print_maps_and_cmdline config
CPPFLAGS =
LDFLAGS =
all: $(TARGET)
file_map: file_map.c
$(CC) -o $@ $^ $(LDFLAGS)
print_maps: print_maps.c
$(CC) -o $@ $^ $(LDFLAGS)
print_maps_and_cmdline: print_maps_and_cmdline.c
$(CC) -o $@ $^ $(LDFLAGS)
static_print_maps: print_maps.c
$(CC) -o $@ $^ $(LDFLAGS) -static
call_execve: call_execve.c
$(CC) -o $@ $^ $(LDFLAGS)
config:
@echo "MCEXEC=$(MCEXEC)" > ./config
init:
ln -nfs ./dummy_file ./lnk_to_dummy
test: init all
./CT_001.sh
./CT_002.sh
./CT_003.sh
./CT_004.sh
./CT_005.sh
./CT_006.sh
./CT_007.sh
./CT_008.sh
clean:
rm -f $(TARGET) *.o ./lnk_to_dummy

32
test/issues/1065/README Normal file
View File

@@ -0,0 +1,32 @@
CT_001:
ファイル実体を指す絶対パスを指定したファイルマップを実行する
-> /proc/<PID>/maps にファイル実体の絶対パスで表示される
CT_002:
ファイル実体を指す相対パスを指定したファイルマップを実行する
-> /proc/<PID>/maps にファイル実体の絶対パスで表示される
CT_003:
ファイル実体を指すシンボリックリンクを指定したファイルマップを実行する
-> /proc/<PID>/maps にファイル実体の絶対パスで表示される
CT_004:
ELF形式のプログラムを実行する
-> /proc/<PID>/maps に実行したプログラムと、そのinterpの絶対パスが表示される
CT_005:
static linkでビルドされたELF形式のプログラムを実行する
-> /proc/<PID>/maps に実行したプログラムと、そのinterpの絶対パスが表示される
CT_006:
シェルスクリプトを実行する
-> シェルスクリプトが正しく実行される
CT_007:
execveを行うプログラムを実行する
-> execveされたプログラムが正常に実行され、/proc下のmaps, cmdline から新しい情報が取得できる
CT_008:
execveを行うプログラムをシェルスクリプトから実行する
-> execveされたプログラムが正常に実行され、/proc下のmaps, cmdline から新しい情報が取得できる

View File

@@ -0,0 +1,28 @@
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char* argv[])
{
char* command;
char* exargv[] = {NULL, NULL};
char* exenvp[] = {NULL};
int rc;
if (argc < 2) {
printf("Error: too few arguments\n");
return -1;
}
exargv[0] = argv[1];
rc = execve(argv[1], exargv, exenvp);
/* Don't reach here */
if (rc == -1) {
perror("Error: failed to execve");
}
return -1;
}

View File

@@ -0,0 +1,4 @@
#!/bin/sh
./call_execve $*

View File

@@ -0,0 +1 @@
This is Test file for mmap.

View File

@@ -0,0 +1,46 @@
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <sys/mman.h>
#define FILE_SIZE 1024
#define CMD_SIZE 128
int main(int argc, char* argv[])
{
int fd;
void *file_map;
long page_size, file_map_size;
char command[CMD_SIZE];
if (argc < 2) {
printf("Error: too few arguments\n");
return -1;
}
fd = open(argv[1], O_RDWR);
if (fd < 0) {
printf("Error: open %s\n", argv[1]);
return -1;
}
page_size = sysconf(_SC_PAGESIZE);
file_map_size = (FILE_SIZE / page_size + 1) * page_size;
file_map = mmap(0, file_map_size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
if (file_map == MAP_FAILED) {
printf("Error: mmap file\n");
return -1;
}
sprintf(command, "cat /proc/%d/maps", getpid());
system(command);
close(fd);
munmap(file_map, file_map_size);
return 0;
}

View File

@@ -0,0 +1,13 @@
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
int main(void)
{
char command[128];
sprintf(command, "cat /proc/%d/maps", getpid());
system(command);
return 0;
}

View File

@@ -0,0 +1,21 @@
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#define CMD_SIZE 128
int main(void)
{
char command[CMD_SIZE];
memset(command, '0', CMD_SIZE);
sprintf(command, "cat /proc/%d/maps", getpid());
system(command);
memset(command, '0', CMD_SIZE);
sprintf(command, "cat /proc/%d/cmdline 1>&2", getpid());
system(command);
return 0;
}

225
test/issues/1065/result.log Normal file
View File

@@ -0,0 +1,225 @@
./CT_001.sh
*** CT_001 start *******************
file map: /home/satoken/2018_work/04/test/dummy_file
000000400000-000000401000 r-xs 0 0:0 0 /home/satoken/2018_work/04/test/file_map
000000600000-000000601000 r--s 0 0:0 0 /home/satoken/2018_work/04/test/file_map
000000601000-000000602000 rw-s 0 0:0 0 /home/satoken/2018_work/04/test/file_map
2aaaaa9f8000-2aaaaaa00000 rw-s 0 0:0 0
2aaaaaa00000-2aaaaaa21000 r-xs 0 0:0 0 /usr/lib64/ld-2.17.so
2aaaaac21000-2aaaaac22000 r--s 0 0:0 0 /usr/lib64/ld-2.17.so
2aaaaac22000-2aaaaac23000 rw-s 0 0:0 0 /usr/lib64/ld-2.17.so
2aaaaac23000-2aaaaac24000 rw-p 0 0:0 0
2aaaaac24000-2aaaaac26000 r-xs 0 0:0 0 [vdso]
2aaaaac26000-2aaaaac27000 rw-p 0 0:0 0
2aaaaac4d000-2aaaaac4e000 rw-p 0 0:0 0
2aaaaac4e000-2aaaaae06000 r-xp 0 0:0 0 /usr/lib64/libc-2.17.so
2aaaaae06000-2aaaab006000 ---p 0 0:0 0 /usr/lib64/libc-2.17.so
2aaaab006000-2aaaab00a000 r--p 0 0:0 0 /usr/lib64/libc-2.17.so
2aaaab00a000-2aaaab00c000 rw-p 0 0:0 0 /usr/lib64/libc-2.17.so
2aaaab00c000-2aaaab011000 rw-p 0 0:0 0
2aaaab011000-2aaaab013000 rw-p 0 0:0 0
2aaaab013000-2aaaab014000 rw-s 0 0:0 0 /home/satoken/2018_work/04/test/dummy_file
547fff800000-548000000000 rw-s 0 0:0 0 [stack]
** grep /home/satoken/2018_work/04/test/dummy_file from maps
2aaaab013000-2aaaab014000 rw-s 0 0:0 0 /home/satoken/2018_work/04/test/dummy_file
[OK] /home/satoken/2018_work/04/test/dummy_file is found
*** CT_001 PASSED
./CT_002.sh
*** CT_002 start *******************
file map: ./dummy_file
000000400000-000000401000 r-xs 0 0:0 0 /home/satoken/2018_work/04/test/file_map
000000600000-000000601000 r--s 0 0:0 0 /home/satoken/2018_work/04/test/file_map
000000601000-000000602000 rw-s 0 0:0 0 /home/satoken/2018_work/04/test/file_map
2aaaaa9f8000-2aaaaaa00000 rw-s 0 0:0 0
2aaaaaa00000-2aaaaaa21000 r-xs 0 0:0 0 /usr/lib64/ld-2.17.so
2aaaaac21000-2aaaaac22000 r--s 0 0:0 0 /usr/lib64/ld-2.17.so
2aaaaac22000-2aaaaac23000 rw-s 0 0:0 0 /usr/lib64/ld-2.17.so
2aaaaac23000-2aaaaac24000 rw-p 0 0:0 0
2aaaaac24000-2aaaaac26000 r-xs 0 0:0 0 [vdso]
2aaaaac26000-2aaaaac27000 rw-p 0 0:0 0
2aaaaac4d000-2aaaaac4e000 rw-p 0 0:0 0
2aaaaac4e000-2aaaaae06000 r-xp 0 0:0 0 /usr/lib64/libc-2.17.so
2aaaaae06000-2aaaab006000 ---p 0 0:0 0 /usr/lib64/libc-2.17.so
2aaaab006000-2aaaab00a000 r--p 0 0:0 0 /usr/lib64/libc-2.17.so
2aaaab00a000-2aaaab00c000 rw-p 0 0:0 0 /usr/lib64/libc-2.17.so
2aaaab00c000-2aaaab011000 rw-p 0 0:0 0
2aaaab011000-2aaaab013000 rw-p 0 0:0 0
2aaaab013000-2aaaab014000 rw-s 0 0:0 0 /home/satoken/2018_work/04/test/dummy_file
547fff800000-548000000000 rw-s 0 0:0 0 [stack]
** grep /home/satoken/2018_work/04/test/dummy_file from maps
2aaaab013000-2aaaab014000 rw-s 0 0:0 0 /home/satoken/2018_work/04/test/dummy_file
[OK] /home/satoken/2018_work/04/test/dummy_file is found
*** CT_002 PASSED
./CT_003.sh
*** CT_003 start *******************
file map: ./lnk_to_dummy
000000400000-000000401000 r-xs 0 0:0 0 /home/satoken/2018_work/04/test/file_map
000000600000-000000601000 r--s 0 0:0 0 /home/satoken/2018_work/04/test/file_map
000000601000-000000602000 rw-s 0 0:0 0 /home/satoken/2018_work/04/test/file_map
2aaaaa9f8000-2aaaaaa00000 rw-s 0 0:0 0
2aaaaaa00000-2aaaaaa21000 r-xs 0 0:0 0 /usr/lib64/ld-2.17.so
2aaaaac21000-2aaaaac22000 r--s 0 0:0 0 /usr/lib64/ld-2.17.so
2aaaaac22000-2aaaaac23000 rw-s 0 0:0 0 /usr/lib64/ld-2.17.so
2aaaaac23000-2aaaaac24000 rw-p 0 0:0 0
2aaaaac24000-2aaaaac26000 r-xs 0 0:0 0 [vdso]
2aaaaac26000-2aaaaac27000 rw-p 0 0:0 0
2aaaaac4d000-2aaaaac4e000 rw-p 0 0:0 0
2aaaaac4e000-2aaaaae06000 r-xp 0 0:0 0 /usr/lib64/libc-2.17.so
2aaaaae06000-2aaaab006000 ---p 0 0:0 0 /usr/lib64/libc-2.17.so
2aaaab006000-2aaaab00a000 r--p 0 0:0 0 /usr/lib64/libc-2.17.so
2aaaab00a000-2aaaab00c000 rw-p 0 0:0 0 /usr/lib64/libc-2.17.so
2aaaab00c000-2aaaab011000 rw-p 0 0:0 0
2aaaab011000-2aaaab013000 rw-p 0 0:0 0
2aaaab013000-2aaaab014000 rw-s 0 0:0 0 /home/satoken/2018_work/04/test/dummy_file
547fff800000-548000000000 rw-s 0 0:0 0 [stack]
** grep /home/satoken/2018_work/04/test/dummy_file from maps
2aaaab013000-2aaaab014000 rw-s 0 0:0 0 /home/satoken/2018_work/04/test/dummy_file
[OK] /home/satoken/2018_work/04/test/dummy_file is found
*** CT_003 PASSED
./CT_004.sh
*** CT_004 start *******************
exec : ./print_maps
000000400000-000000401000 r-xs 0 0:0 0 /home/satoken/2018_work/04/test/print_maps
000000600000-000000601000 r--s 0 0:0 0 /home/satoken/2018_work/04/test/print_maps
000000601000-000000602000 rw-s 0 0:0 0 /home/satoken/2018_work/04/test/print_maps
2aaaaa9f8000-2aaaaaa00000 rw-s 0 0:0 0
2aaaaaa00000-2aaaaaa21000 r-xs 0 0:0 0 /usr/lib64/ld-2.17.so
2aaaaac21000-2aaaaac22000 r--s 0 0:0 0 /usr/lib64/ld-2.17.so
2aaaaac22000-2aaaaac23000 rw-s 0 0:0 0 /usr/lib64/ld-2.17.so
2aaaaac23000-2aaaaac24000 rw-p 0 0:0 0
2aaaaac24000-2aaaaac26000 r-xs 0 0:0 0 [vdso]
2aaaaac26000-2aaaaac27000 rw-p 0 0:0 0
2aaaaac4d000-2aaaaac4e000 rw-p 0 0:0 0
2aaaaac4e000-2aaaaae06000 r-xp 0 0:0 0 /usr/lib64/libc-2.17.so
2aaaaae06000-2aaaab006000 ---p 0 0:0 0 /usr/lib64/libc-2.17.so
2aaaab006000-2aaaab00a000 r--p 0 0:0 0 /usr/lib64/libc-2.17.so
2aaaab00a000-2aaaab00c000 rw-p 0 0:0 0 /usr/lib64/libc-2.17.so
2aaaab00c000-2aaaab011000 rw-p 0 0:0 0
2aaaab011000-2aaaab013000 rw-p 0 0:0 0
547fff800000-548000000000 rw-s 0 0:0 0 [stack]
** grep /home/satoken/2018_work/04/test/print_maps from maps
000000400000-000000401000 r-xs 0 0:0 0 /home/satoken/2018_work/04/test/print_maps
000000600000-000000601000 r--s 0 0:0 0 /home/satoken/2018_work/04/test/print_maps
000000601000-000000602000 rw-s 0 0:0 0 /home/satoken/2018_work/04/test/print_maps
[OK] /home/satoken/2018_work/04/test/print_maps is found
** grep /usr/lib64/ld-2.17.so from maps
2aaaaaa00000-2aaaaaa21000 r-xs 0 0:0 0 /usr/lib64/ld-2.17.so
2aaaaac21000-2aaaaac22000 r--s 0 0:0 0 /usr/lib64/ld-2.17.so
2aaaaac22000-2aaaaac23000 rw-s 0 0:0 0 /usr/lib64/ld-2.17.so
[OK] /usr/lib64/ld-2.17.so is found
*** CT_004 PASSED
./CT_005.sh
*** CT_005 start *******************
exec : ./static_print_maps
000000400000-0000004b8000 r-xs 0 0:0 0 /home/satoken/2018_work/04/test/static_print_maps
0000006b7000-0000006ba000 rw-s 0 0:0 0 /home/satoken/2018_work/04/test/static_print_maps
0000006ba000-0000006bc000 rw-p 0 0:0 0
000000800000-000000802000 rw-s 0 0:0 0 [heap]
000000802000-000000823000 rw-s 0 0:0 0 [heap]
000000823000-000000824000 rw-s 0 0:0 0 [heap]
2aaaaa9f8000-2aaaaaa00000 rw-s 0 0:0 0
2aaaaaa00000-2aaaaaa02000 r-xs 0 0:0 0 [vdso]
547fff800000-548000000000 rw-s 0 0:0 0 [stack]
** grep /home/satoken/2018_work/04/test/static_print_maps from maps
000000400000-0000004b8000 r-xs 0 0:0 0 /home/satoken/2018_work/04/test/static_print_maps
0000006b7000-0000006ba000 rw-s 0 0:0 0 /home/satoken/2018_work/04/test/static_print_maps
[OK] /home/satoken/2018_work/04/test/static_print_maps is found
** grep /usr/lib64/ld-2.17.so from maps
[OK] /usr/lib64/ld-2.17.so is not found
*** CT_005 PASSED
./CT_006.sh
*** CT_006 start *******************
000000400000-00000040b000 r-xs 0 0:0 0 /usr/bin/cat
00000060b000-00000060c000 r--s 0 0:0 0 /usr/bin/cat
00000060c000-00000060d000 rw-s 0 0:0 0 /usr/bin/cat
000000800000-000000821000 rw-s 0 0:0 0 [heap]
2aaaaa9f8000-2aaaaaa00000 rw-s 0 0:0 0
2aaaaaa00000-2aaaaaa21000 r-xs 0 0:0 0 /usr/lib64/ld-2.17.so
2aaaaac21000-2aaaaac22000 r--s 0 0:0 0 /usr/lib64/ld-2.17.so
2aaaaac22000-2aaaaac23000 rw-s 0 0:0 0 /usr/lib64/ld-2.17.so
2aaaaac23000-2aaaaac24000 rw-p 0 0:0 0
2aaaaac24000-2aaaaac26000 r-xs 0 0:0 0 [vdso]
2aaaaac26000-2aaaaac27000 rw-p 0 0:0 0
2aaaaac4d000-2aaaaac4e000 rw-p 0 0:0 0
2aaaaac4e000-2aaaaae06000 r-xp 0 0:0 0 /usr/lib64/libc-2.17.so
2aaaaae06000-2aaaab006000 ---p 0 0:0 0 /usr/lib64/libc-2.17.so
2aaaab006000-2aaaab00a000 r--p 0 0:0 0 /usr/lib64/libc-2.17.so
2aaaab00a000-2aaaab00c000 rw-p 0 0:0 0 /usr/lib64/libc-2.17.so
2aaaab00c000-2aaaab011000 rw-p 0 0:0 0
2aaaab011000-2aaaab013000 rw-p 0 0:0 0
2aaaab013000-2aaab153c000 r--p 0 0:0 0 /usr/lib/locale/locale-archive
547fff800000-548000000000 rw-s 0 0:0 0 [stack]
[OK] shell script is running normaly
*** CT_006 PASSED
./CT_007.sh
*** CT_007 start *******************
exec : ./call_execve ./print_maps_and_cmdline
000000400000-000000401000 r-xs 0 0:0 0 /home/satoken/2018_work/04/test/print_maps_and_cmdline
000000600000-000000601000 r--s 0 0:0 0 /home/satoken/2018_work/04/test/print_maps_and_cmdline
000000601000-000000602000 rw-s 0 0:0 0 /home/satoken/2018_work/04/test/print_maps_and_cmdline
2aaaaa9f8000-2aaaaaa00000 rw-s 0 0:0 0
2aaaaaa00000-2aaaaaa21000 r-xs 0 0:0 0 /usr/lib64/ld-2.17.so
2aaaaac21000-2aaaaac22000 r--s 0 0:0 0 /usr/lib64/ld-2.17.so
2aaaaac22000-2aaaaac23000 rw-s 0 0:0 0 /usr/lib64/ld-2.17.so
2aaaaac23000-2aaaaac24000 rw-p 0 0:0 0
2aaaaac24000-2aaaaac26000 r-xs 0 0:0 0 [vdso]
2aaaaac26000-2aaaaac27000 rw-p 0 0:0 0
2aaaaac4d000-2aaaaae05000 r-xp 0 0:0 0 /usr/lib64/libc-2.17.so
2aaaaae05000-2aaaab005000 ---p 0 0:0 0 /usr/lib64/libc-2.17.so
2aaaab005000-2aaaab009000 r--p 0 0:0 0 /usr/lib64/libc-2.17.so
2aaaab009000-2aaaab00b000 rw-p 0 0:0 0 /usr/lib64/libc-2.17.so
2aaaab00b000-2aaaab010000 rw-p 0 0:0 0
2aaaab010000-2aaaab011000 rw-p 0 0:0 0
2aaaab011000-2aaaab013000 rw-p 0 0:0 0
547fff800000-548000000000 rw-s 0 0:0 0 [stack]
STKN:[main_loop] filename:./print_maps_and_cmdline shell:0x(nil)
STKN:[main_loop] filename:/bin/sh shell:0x(nil)
STKN:[main_loop] filename:./print_maps_and_cmdline shell:0x(nil)
** grep /home/satoken/2018_work/04/test/print_maps_and_cmdline from maps
000000400000-000000401000 r-xs 0 0:0 0 /home/satoken/2018_work/04/test/print_maps_and_cmdline
000000600000-000000601000 r--s 0 0:0 0 /home/satoken/2018_work/04/test/print_maps_and_cmdline
000000601000-000000602000 rw-s 0 0:0 0 /home/satoken/2018_work/04/test/print_maps_and_cmdline
[OK] /home/satoken/2018_work/04/test/print_maps_and_cmdline is found
** grep /usr/lib64/ld-2.17.so from maps
2aaaaaa00000-2aaaaaa21000 r-xs 0 0:0 0 /usr/lib64/ld-2.17.so
2aaaaac21000-2aaaaac22000 r--s 0 0:0 0 /usr/lib64/ld-2.17.so
2aaaaac22000-2aaaaac23000 rw-s 0 0:0 0 /usr/lib64/ld-2.17.so
[OK] /usr/lib64/ld-2.17.so is found
./print_maps_and_cmdlineso.6o.
** grep ./print_maps_and_cmdline from cmdline
./print_maps_and_cmdlineso.6o.
[OK] ./print_maps_and_cmdline is found
*** CT_007 PASSED
./CT_008.sh
*** CT_008 start *******************
exec : ./call_execve.sh ./print_maps_and_cmdline
./CT_008.sh: line 18: 25571 Segmentation fault (core dumped) ${MCEXEC} ${test_program} > ./${TESTNAME}_maps.log 2> ./${TESTNAME}_cmdline.log
STKN:[main] This is shell script
STKN:[main_loop] filename:./call_execve shell:0x(nil)
STKN:[main_loop] filename:./print_maps_and_cmdline shell:0x(nil)
** grep /home/satoken/2018_work/04/test/print_maps_and_cmdline from maps
[NG] /home/satoken/2018_work/04/test/print_maps_and_cmdline is not found
** grep /usr/lib64/ld-2.17.so from maps
[NG] /usr/lib64/ld-2.17.so is not found
** grep ./print_maps_and_cmdline from cmdline
[NG] ./print_maps_and_cmdline is not found
*** CT_008 FAILED