Hi, (very sorry if resend the mail, it seems that my email client has issue) I am trying to build cgit on riscv64 arch. But it fails due to test case failed: ``` not ok 1 - do not access $HOME: # # test_no_home_access '' # not ok 2 - do not access $HOME: foo # # test_no_home_access 'foo' # not ok 3 - do not access $HOME: foo/refs # # test_no_home_access 'foo/refs' # not ok 4 - do not access $HOME: foo/log # # test_no_home_access 'foo/log' # not ok 5 - do not access $HOME: foo/tree # # test_no_home_access 'foo/tree' # not ok 6 - do not access $HOME: foo/tree/file-1 # # test_no_home_access 'foo/tree/file-1' # not ok 7 - do not access $HOME: foo/commit # # test_no_home_access 'foo/commit' # not ok 8 - do not access $HOME: foo/diff # # test_no_home_access 'foo/diff' # not ok 9 - do not access $HOME: foo/patch # # test_no_home_access 'foo/patch' # not ok 10 - do not access $HOME: foo/snapshot/master.tar.gz # # test_no_home_access 'foo/snapshot/master.tar.gz' # # failed 10 among 10 test(s) 1..10 make[1]: *** [Makefile:12: t0109-gitconfig.sh] Error 1 make: *** [Makefile:83: test] Error 2 ``` I have real riscv64 hardware by hand so I can test it, so any help will be appericated! Bo
Hi Bo, On Tue, 19 Jul 2022 10:44:57 +0800, Bo YU <tsu.yubo@gmail.com> wrote: > Hi, > (very sorry if resend the mail, it seems that my email client has issue) > I am trying to build cgit on riscv64 arch. But it fails due to > test case failed: [...] > not ok 10 - do not access $HOME: foo/snapshot/master.tar.gz > # > # test_no_home_access 'foo/snapshot/master.tar.gz' > # > # failed 10 among 10 test(s) > 1..10 > make[1]: *** [Makefile:12: t0109-gitconfig.sh] Error 1 > make: *** [Makefile:83: test] Error 2 Are you using qemu-user? That test uses strace, which in turn uses the ptrace() system call. qemu-user does not support ptrace(). At least it didn't when I tried a couple of years ago. Best Regards, Samuel
[-- Attachment #1: Type: text/plain, Size: 6189 bytes --] Hi, Thank you for quick reply. >[...] >> not ok 10 - do not access $HOME: foo/snapshot/master.tar.gz >> # >> # test_no_home_access 'foo/snapshot/master.tar.gz' >> # >> # failed 10 among 10 test(s) >> 1..10 >> make[1]: *** [Makefile:12: t0109-gitconfig.sh] Error 1 >> make: *** [Makefile:83: test] Error 2 > > >Are you using qemu-user? It is interesting. In fact, I build it on real riscv64 hardware(Unmatched boards). ``` vimer@unmatched:~/build/07/31_cgit/cgit-master/tests$ uname -a Linux unmatched 5.18.0-2-riscv64 #1 SMP Debian 5.18.5-1 (2022-06-16) riscv64 GNU/Linux ``` > >That test uses strace, which in turn uses the ptrace() system call. >qemu-user does not support ptrace(). At least it didn't when I tried a couple of years ago. I just test strace cmd after see your hint, but it looks ok(If I do wrong please conrect me) ``` vimer@unmatched:~/build/07/31_cgit/cgit-master/tests$ strace -o strace.out ls Makefile t0001-validate-git-versions.sh t0102-summary.sh t0106-diff.sh t0110-rawdiff.sh valgrind filters t0010-validate-html.sh t0103-log.sh t0107-snapshot.sh t0111-filter.sh setup.sh t0020-validate-cache.sh t0104-tree.sh t0108-patch.sh test-results strace.out t0101-index.sh t0105-commit.sh t0109-gitconfig.sh 'trash directory.t0109-gitconfig' vimer@unmatched:~/build/07/31_cgit/cgit-master/tests$ cat strace.out execve("/usr/bin/ls", ["ls"], 0x3fcc1ab530 /* 22 vars */) = 0 brk(NULL) = 0x2abe9aa000 faccessat(AT_FDCWD, "/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=67387, ...}, AT_EMPTY_PATH) = 0 mmap(NULL, 67387, PROT_READ, MAP_PRIVATE, 3, 0) = 0x3f92a36000 close(3) = 0 openat(AT_FDCWD, "/lib/riscv64-linux-gnu/libselinux.so.1", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\363\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 832) = 832 newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=131280, ...}, AT_EMPTY_PATH) = 0 mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x3f92a34000 mmap(NULL, 142984, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3f92a11000 mmap(0x3f92a30000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1e000) = 0x3f92a30000 mmap(0x3f92a32000, 7816, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3f92a32000 close(3) = 0 openat(AT_FDCWD, "/lib/riscv64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0\363\0\1\0\0\0\370\10\2\0\0\0\0\0"..., 832) = 832 newfstatat(3, "", {st_mode=S_IFREG|0755, st_size=1086160, ...}, AT_EMPTY_PATH) = 0 mmap(NULL, 1117952, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3f92900000 mmap(0x3f92a03000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x102000) = 0x3f92a03000 mmap(0x3f92a09000, 32512, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3f92a09000 close(3) = 0 openat(AT_FDCWD, "/lib/riscv64-linux-gnu/libpcre2-8.so.0", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\363\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 832) = 832 newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=342600, ...}, AT_EMPTY_PATH) = 0 mmap(NULL, 344904, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3f928ab000 mmap(0x3f928fe000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x52000) = 0x3f928fe000 close(3) = 0 openat(AT_FDCWD, "/lib/riscv64-linux-gnu/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\363\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 832) = 832 newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=10376, ...}, AT_EMPTY_PATH) = 0 mmap(NULL, 12616, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3f928a7000 mmap(0x3f928a9000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x3f928a9000 close(3) = 0 mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x3f928a5000 mprotect(0x3f92a03000, 16384, PROT_READ) = 0 [...] mprotect(0x3f928a9000, 4096, PROT_READ) = 0 munmap(0x3f92a36000, 67387) = 0 statfs("/sys/fs/selinux", 0x3fcf981390) = -1 ENOENT (No such file or directory) statfs("/selinux", 0x3fcf981390) = -1 ENOENT (No such file or directory) brk(NULL) = 0x2abe9aa000 brk(0x2abe9cb000) = 0x2abe9cb000 openat(AT_FDCWD, "/proc/filesystems", O_RDONLY|O_CLOEXEC) = 3 newfstatat(3, "", {st_mode=S_IFREG|0444, st_size=0, ...}, AT_EMPTY_PATH) = 0 read(3, "nodev\tsysfs\nnodev\ttmpfs\nnodev\tbd"..., 1024) = 340 read(3, "", 1024) = 0 close(3) = 0 faccessat(AT_FDCWD, "/etc/selinux/config", F_OK) = -1 ENOENT (No such file or directory) ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(1, TIOCGWINSZ, {ws_row=38, ws_col=137, ws_xpixel=0, ws_ypixel=0}) = 0 openat(AT_FDCWD, ".", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3 newfstatat(3, "", {st_mode=S_IFDIR|0755, st_size=4096, ...}, AT_EMPTY_PATH) = 0 getdents64(3, 0x2abe9af2e0 /* 24 entries */, 32768) = 912 getdents64(3, 0x2abe9af2e0 /* 0 entries */, 32768) = 0 close(3) = 0 newfstatat(1, "", {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0x2), ...}, AT_EMPTY_PATH) = 0 write(1, " Makefile t0001-validate-git"..., 117) = 117 write(1, " filters t0010-validate-htm"..., 96) = 96 write(1, " setup.sh t0020-validate-cac"..., 95) = 95 write(1, " strace.out t0101-index.sh\t\t "..., 109) = 109 close(1) = 0 close(2) = 0 exit_group(0) = ? +++ exited with 0 +++ ``` Or the test cmd does not cover the cases? Bo -- Best Regards [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --]
Hi,
On Tue, 19 Jul 2022 16:02:30 +0800, Bo YU <tsu.yubo@gmail.com> wrote:
> >Are you using qemu-user?
>
> It is interesting. In fact, I build it on real riscv64
> hardware(Unmatched boards).
>
> ```
> vimer@unmatched:~/build/07/31_cgit/cgit-master/tests$ uname -a
> Linux unmatched 5.18.0-2-riscv64 #1 SMP Debian 5.18.5-1 (2022-06-16) riscv64 GNU/Linux
> ```
> >
> >That test uses strace, which in turn uses the ptrace() system call.
> >qemu-user does not support ptrace(). At least it didn't when I tried a couple of years ago.
>
> I just test strace cmd after see your hint, but it looks ok(If I do
> wrong please conrect me)
The strace output looks good to me. But did you check the strace.out file, that the test creates?
The test will fail if it contains this string:
/path/to/some/place/that/does/not/possibly/exist
Maybe something is causing that string to be printed.
Best Regards,
Samuel
[-- Attachment #1: Type: text/plain, Size: 3548 bytes --] HriI, On Tue, Jul 19, 2022 at 10:15:55AM +0200, Samuel Lid�n Borell wrote: >The strace output looks good to me. But did you check the strace.out file, that the test creates? >The test will fail if it contains this string: >/path/to/some/place/that/does/not/possibly/exist > >Maybe something is causing that string to be printed. > ``` strace -o t0109.out ./t0109-gitconfig.sh I just grep the log I think that it is usefully: write(1, "\33[1m\33[31mnot ok 7 - do not acces"..., 58) = 58 pipe2([8, 9], 0) = 0 clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x3faefb7c70) = 388102 close(9) = 0 clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x3faefb7c70) = 388103 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=388102, si_uid=0, si_status=0, si_utime=0, si_stime=0} --- rt_sigreturn({mask=[]}) = 388103 close(8) = 0 close(-1) = -1 EBADF (Bad file descriptor) wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 388102 wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 388103 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=388103, si_uid=0, si_status=0, si_utime=0, si_stime=0} --- rt_sigreturn({mask=[]}) = 388103 wait4(-1, 0x3ffabbc3ec, WNOHANG, NULL) = -1 ECHILD (No child processes) fcntl(1, F_DUPFD, 10) = 11 close(1) = 0 fcntl(11, F_SETFD, FD_CLOEXEC) = 0 dup3(3, 1, 0) = 1 write(1, "\n", 1) = 1 dup3(11, 1, 0) = 1 close(11) = 0 fcntl(1, F_DUPFD, 10) = 11 close(1) = 0 fcntl(11, F_SETFD, FD_CLOEXEC) = 0 dup3(3, 1, 0) = 1 write(1, "\33[36mexpecting success of 0109.8"..., 108) = 108 dup3(11, 1, 0) = 1 close(11) = 0 pipe2([8, 9], 0) = 0 clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x3faefb7c70) = 388104 close(9) = 0 read(8, "OK-117\n", 128) = 7 read(8, "", 128) = 0 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=388104, si_uid=0, si_status=0, si_utime=0, si_stime=0} --- rt_sigreturn({mask=[]}) = 0 close(8) = 0 wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 388104 wait4(-1, 0x3ffabbbdac, WNOHANG, NULL) = -1 ECHILD (No child processes) pipe2([8, 9], 0) = 0 clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x3faefb7c70) = 388106 close(9) = 0 read(8, "", 128) = 0 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=388106, si_uid=0, si_status=1, si_utime=0, si_stime=0} --- rt_sigreturn({mask=[]}) = 0 close(8) = 0 wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], 0, NULL) = 388106 wait4(-1, 0x3ffabbbd4c, WNOHANG, NULL) = -1 ECHILD (No child processes) The full log is attachment. It seem that the $non_existent_path does not add (date %N) string. Bo >Best Regards, >Samuel -- Best Regards [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #1: Type: text/plain, Size: 1206 bytes --] hi, On Tue, Jul 19, 2022 at 10:15:55AM +0200, Samuel Lid�n Borell wrote: >Hi, > >On Tue, 19 Jul 2022 16:02:30 +0800, Bo YU <tsu.yubo@gmail.com> wrote: > >> >Are you using qemu-user? >> >> It is interesting. In fact, I build it on real riscv64 >> hardware(Unmatched boards). >> >> ``` >> vimer@unmatched:~/build/07/31_cgit/cgit-master/tests$ uname -a >> Linux unmatched 5.18.0-2-riscv64 #1 SMP Debian 5.18.5-1 (2022-06-16) riscv64 GNU/Linux >> ``` >> > >> >That test uses strace, which in turn uses the ptrace() system call. >> >qemu-user does not support ptrace(). At least it didn't when I tried a couple of years ago. >> >> I just test strace cmd after see your hint, but it looks ok(If I do >> wrong please conrect me) > >The strace output looks good to me. But did you check the strace.out file, that the test creates? >The test will fail if it contains this string: >/path/to/some/place/that/does/not/possibly/exist > >Maybe something is causing that string to be printed. Maybe I did not get your point, but now some people submit a patch: https://lists.debian.org/debian-riscv/2022/09/msg00009.html Bo > >Best Regards, >Samuel -- Regards, -- Bo YU [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --]