Crosvm compiled failed on Ubuntu 20.04 with nonexistent syscall 'faccessat2'

108 views
Skip to first unread message

Shirley Zhao

unread,
Oct 8, 2022, 10:03:46 PM10/8/22
to crosvm-dev

Hi, all,

 

I met the issue that the crosvm source code from “main” branch compiled failed on Ubuntu 20.04.

  1. My Ubuntu information:

Linux shirley-NUC11PAHi5 5.8.0-43-generic #49~20.04.1-Ubuntu SMP Fri Feb 5 09:57:56 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux


1. The source code path:

git clone https://chromium.googlesource.com/crosvm/crosvm


 2. Compile failed result:

   Compiling x86_64 v0.1.0 (/home/shirley/ubuntu_crosvm/crosvm/x86_64)

error: couldn't read /home/shirley/ubuntu_crosvm/crosvm/target/debug/build/crosvm-3255ad8d9023d608/out/policy_output/xhci_device.bpf: No such file or directory (os error 2)

 --> /home/shirley/ubuntu_crosvm/crosvm/target/debug/build/crosvm-3255ad8d9023d608/out/bpf_includes.in:2:2687

  |

2 | ...", include_bytes!("/home/shirley/ubuntu_crosvm/crosvm/target/debug/build/crosvm-3255ad8d9023d608/out/policy_output/xhci_device.bpf").to...

  |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  |

  = note: this error originates in the macro `include_bytes` (in Nightly builds, run with -Z macro-backtrace for more info)

 

error: could not compile `crosvm` due to previous error


 3. Check target/debug/build/crosvm-3255ad8d9023d608/stderr

Traceback (most recent call last):

  File "/home/shirley/ubuntu_crosvm/crosvm/third_party/minijail/tools/compile_seccomp_policy.py", line 171, in <module>

    sys.exit(main(sys.argv[1:]))

  File "/home/shirley/ubuntu_crosvm/crosvm/third_party/minijail/tools/compile_seccomp_policy.py", line 145, in main

    compiled_policy = policy_compiler.compile_file(

  File "/home/shirley/ubuntu_crosvm/crosvm/third_party/minijail/tools/compiler.py", line 284, in compile_file

    parsed_policy = policy_parser.parse_file(policy_filename)

  File "/home/shirley/ubuntu_crosvm/crosvm/third_party/minijail/tools/parser.py", line 781, in parse_file

    statements = [x for x in self._parse_policy_file(filename)]

  File "/home/shirley/ubuntu_crosvm/crosvm/third_party/minijail/tools/parser.py", line 760, in _parse_policy_file

    statement = self.parse_filter_statement(tokens)

  File "/home/shirley/ubuntu_crosvm/crosvm/third_party/minijail/tools/parser.py", line 626, in parse_filter_statement

    syscall_descriptors.extend(self._parse_syscall_descriptor(tokens))

  File "/home/shirley/ubuntu_crosvm/crosvm/third_party/minijail/tools/parser.py", line 600, in _parse_syscall_descriptor

    self._parser_state.error(

  File "/home/shirley/ubuntu_crosvm/crosvm/third_party/minijail/tools/parser.py", line 133, in error

    raise ParseException(

parser.ParseException: /home/shirley/ubuntu_crosvm/crosvm/target/debug/build/crosvm-3255ad8d9023d608/out/policy_input/xhci_device.policy(12:1): nonexistent syscall

    faccessat2: 1

^^^^^^^^^^

 

                So how to fix this issue of nonexistent syscall?

 

                By the way, another issue found is the package gcc-mingw-w64-x86-64-win32 can’t be found on Ubuntu, I think it should be gcc-mingw-w64 instead, right?

 

Thanks.

Shirley      

Dennis Kempin

unread,
Oct 10, 2022, 1:26:40 PM10/10/22
to Shirley Zhao, crosvm-dev
Hi Shirley!

The issue seems to be that the syscall we are filtering in the policy does not exist in your kernel version, which causes the minijail compiler to fail. We have been looking for a solution for that problem so we can compile on a wider range of host platforms.

In the meantime, you could try editing seccomp/*/xhci_device.policy and remove the faccessat2 line. Or any other offending lines. Or you could use the dev container for compiling and testing crosvm. 

I hope that works! 

PS: The package name on ubuntu is different than on debian unfortunately, we should probably add a conditional statement there to pick the right package depending on the host distribution.


--
You received this message because you are subscribed to the Google Groups "crosvm-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to crosvm-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/crosvm-dev/c3cd4171-3bee-4f8c-b5c8-9d460559e301n%40chromium.org.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.

Shirley Zhao

unread,
Oct 11, 2022, 4:53:28 AM10/11/22
to crosvm-dev, dennis...@google.com, crosvm-dev, Shirley Zhao
Thanks, Dennis. 

Yes, after remove the  faccessat2 line, the compile can pass with "cargo build" . 

Thanks. 
Shirley 
Reply all
Reply to author
Forward
0 new messages