proot icon indicating copy to clipboard operation
proot copied to clipboard

Several tests failed

Open dead-end opened this issue 4 years ago • 1 comments

I have run the proot tests and several tests failed. The following test all exited with return code 182 and all have in common that proot traces a program, that itself traces an other program:

  test-d92b57ca.sh (proot proot)

  test-cdd39012.sh (proot ptrace)

  test-2db65cd2.sh (proot gdb)

  test-0228fbe7.sh (proot ptrace)

  test-df4de4db.sh (proot strace)

The following lines are the output of the test-d92b57ca.sh test with verbose flag:

  # env PROOT_NO_SUBRECONF=1 ${PWD}/../src/proot -v 1 ${PWD}/../src/proot -v 1 true
  proot info: binding = / 
  proot info: exe = /home/dead-end/tmp/proot/workspace_proot/proot-master/src/proot
  proot info: argv = /home/dead-end/tmp/proot/workspace_proot/proot-master/tests/../src/proot -v 1 true
  proot info: initial cwd = /home/dead-end/tmp/proot/workspace_proot/proot-master/tests
  proot info: verbose level = 1 
  proot info: pid 31873: access to "/dev/pts/1" (fd 0) won't be translated until closed
  proot info: pid 31873: access to "/dev/pts/1" (fd 1) won't be translated until closed
  proot info: pid 31873: access to "/dev/pts/1" (fd 2) won't be translated until closed
  proot info: pid 31873: access to "/proc/31873/fd" (fd 3) won't be translated until closed
  proot info: ptrace acceleration (seccomp mode 2) enabled
  proot info: binding = / 
  proot info: exe = /bin/true
  proot info: argv = true
  proot info: initial cwd = /home/dead-end/tmp/proot/workspace_proot/proot-master/tests
  proot info: verbose level = 1 
  proot info: pid 31874: access to "/dev/pts/1" (fd 0) won't be translated until closed
  proot info: pid 31874: access to "/dev/pts/1" (fd 1) won't be translated until closed
  proot info: pid 31874: access to "/dev/pts/1" (fd 2) won't be translated until closed
  proot info: pid 31874: access to "/proc/31874/fd" (fd 3) won't be translated until closed
  proot info: vpid 2: pid 31875
  proot info: ptrace acceleration (seccomp mode 2) enabled
  proot info: vpid 2: exited with status 182 
  proot info: vpid 1: exited with status 182 
  proot info: vpid 1: exited with status 182 

The return code 182 comes from the FATAL() macro in the loader.c file. It is the EXECVE system call that fails and due to this returns.

        if (unlikely(traced)) {
                SYSCALL(EXECVE, 6, 1,
                        stmt->start.stack_pointer,
                        stmt->start.entry_point, 2, 3, 4); 
        }
        else
                BRANCH(stmt->start.stack_pointer, stmt->start.entry_point);
        FATAL();

I do not understand the magic behind the loader.c file. Adding an include for errno.h to see what the issue of the EXECVE call is does not work.

I am using: Ubuntu 18.04.2 LTS.

I think, the tests also fail on: https://gitlab.com/proot/proot/-/jobs/235357874

dead-end avatar Jul 28 '19 14:07 dead-end

@dead-end please test again on the master branch.

oxr463 avatar Nov 05 '21 23:11 oxr463