Closed Rtoax closed 2 months ago
The detail:
ulpatch/tests/hello$ sudo ./test.sh -u patch-pthread.ulp -d
...
15:29:11 [DEBUG][ehdr.c ehdr_magic_ok:20] Wrong ELF magic
15:29:11 [DEBUG][task.c task_syscall:1948] result 7f0cd6b8b000
15:29:11 [DEBUG][task.c task_syscall:1948] result fffffffffffffff3
15:29:11 [DEBUG][task.c task_syscall:1948] result 0
15:29:11 [ERROR][patch.c create_mmap_vma_file:233] remote open failed.
After fix https://github.com/Rtoax/ulpatch/issues/15, this issue still not be solved.
$ sudo opensnoop.bt | grep hello
19875 ulpatch 8 0 /home/rongtao/Git/ulpatch/tests/hello/hello
19875 ulpatch 9 0 /home/rongtao/Git/ulpatch/tests/hello/hello
19509 hello -1 13 /tmp/ulpatch/19509/map_files/patch-BAsaXo
19877 ulpinfo 6 0 /home/rongtao/Git/ulpatch/tests/hello/hello
19877 ulpinfo 7 0 /home/rongtao/Git/ulpatch/tests/hello/hello
$ ll /tmp/ulpatch/19509/map_files/patch-BAsaXo
-rw-r--r-- 1 root root 1824 May 7 18:34 /tmp/ulpatch/19509/map_files/patch-BAsaXo
Because the remove task hello
don't have the permission to open the patch file. If i run hello
with sudo
, problem solved. I think we should get the target task permission and set the patch file to that permission.
This issue was fixed by commit https://github.com/Rtoax/ulpatch/commit/82297ea5f5c54aaa397ea23d290d3549884f08e1