facebook / hhvm

A virtual machine for executing programs written in Hack.
https://hhvm.com
Other
18.19k stars 3k forks source link

[ Repo auth ] Fails to build a byte code repository on hhvm 4.168+ #9236

Closed lexidor closed 2 years ago

lexidor commented 2 years ago

Describe the bug When trying to build a byte code repository in docker, hhvm 4.168 fails with a set_mempolicy: Operation not permitted

Standalone code, or other way to reproduce the problem

<<__EntryPoint>>
function main(): void {}
hhvm.repo.authoritative=true
hhvm.repo.path=./hhvm.hhbc
hhvm.server.allow_run_as_root=true

Steps to reproduce the behavior:

  1. Create an empty Hack project in an hhvm/hhvm docker container
  2. Add an empty hhconfig file.
  3. Put an empty entry point, as shown above in src/main.hack
  4. Put the INI file shown above in repo-auth.ini
  5. Create a repo using hhvm --hphp --input-dir $(pwd) --output-dir .
  6. When running under hhvm/hhvm@4.167-latest, observe a successful creation of hhvm.hhbc in the project directory.
  7. Run the server using hhvm -m server --no-config -c repo-auth.ini
  8. Curl (with option verbose flag) localhost from within the container. Observe an HTTP 200 without content.

Expected behavior

As described in steps to reproduce

Actual behavior

Step 5. fails with the following error:

...
Extern worker error while indexing: Execution of `hphpc-index` failed: exited with status 1
stderr:
set_mempolicy: Operation not permitted
...

Environment

Additional context I did already change the commands to be compatible with the removed cli flags from hhvm 4.167.0.

Atry commented 2 years ago

Is it a docker specific problem? Did you test repo mode without a docker container?

Atry commented 2 years ago

Looks similar to the CI failures in https://github.com/hhvm/hacktest/pull/115/files

Atry commented 2 years ago

This is not a docker specific problem. I can reproduce it without a docker container.

Atry commented 2 years ago

I can also reproduce it with the nix based universal HHVM deb package

Atry commented 2 years ago

I cannot reproduce this issue with a HHVM built from clang.

Atry commented 2 years ago

As a workaround, you can use the HHVM package built from clang to use repo auth.

You can find the instruction to install hhvm_clang packages at https://github.com/hhvm/user-documentation/pull/1295

Atry commented 2 years ago

The nightly version 2022.09.01 is good to use repo mode, while the nightly version 2022.09.02 is not.

The failure seems related with 280e6899b442796a197b5b236d3ddd50d0b62b5f.

Atry commented 2 years ago

Fixed in 1174b9f2e5935ff468b236aba9df0f3d3ff12d5a