Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to Hugify the .text Section - HardwareCounter perf_event_open failed with Permission Denied #9063

Open
codewizard13 opened this issue Apr 7, 2022 · 3 comments

Comments

@codewizard13
Copy link

codewizard13 commented Apr 7, 2022

I'm trying to learn Hack following this tutorial so I set up an Ubuntu 20.04 VirtualBox machine (guest) on my Windows 10 (host) laptop as a dev server. I successfully installed Hack and VS Code along with the Hack extension for IntelliSense, hinting, and code highlighting.

However, when I run hhvm -m server -p 8080 the server seems to launch and I can see the code results in a browser, but I get this error:

Failed to hugify the .text section

I tried changing a text string and saving it and now I get this error:

HardwareCounter: perf_event_open failed with: Permission denied

Have been unable to find anything except this post (#8168) which unfortunately did not offer a solution that I could understand as a newbie to HHVM and an Ubuntu novice.

Steps to reproduce the behavior:

  1. Install Ubuntu server 20.04 (minimal version). (Mine was installed as VirtualBox guest, but this may not matter)
  2. Install VS Code
  3. Install HHVM in terminal (bash)
  4. Install Hack extension in VS Code
  5. Create a project as per https://docs.hhvm.com/hack/getting-started/getting-started
  6. Launch localhost:8080/hello.hack in browser (Firefox)
  7. See error 1
  8. Change "Hello World" to "Hello ERIC" in hello.hack in VS Code and save
  9. Refresh the browser
  10. See error 2

Error 1

ERROR: Failed to hugify the .text section

Error 2

ERROR: HardwareCounter: perf_event_open failed with: Permission denied

Expected behavior

I was following a tutorial and wasn't sure what to expect. Unsure if the errors I'm reporting will cause a problem, but so far it looks like everything is ok. But, reporting in case this trips somebody else up so it can at least be addressed and known.

Environment

  • Operating system

Ubuntu 20.04.4 LTS (Focal Fossa)

  • Installation method
apt-get update
apt-get install software-properties-common apt-transport-https
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xB4112585D386EB94
add-apt-repository https://dl.hhvm.com/ubuntu
apt-get update
apt-get install hhvm
  • HHVM Version

hhvm --version

HipHop VM 4.155.0 (rel) (non-lowptr)
Compiler: 1648749156_506524366
Repo schema: 04d94ff27ad41e22663e624a2fee9a624072160a

hh_client --version

hackc-a9ca8db2dc64da66270a4e83a3f019dc92246c09-4.155.0

Additional context

For posterity (in case the source website disappears ever) here are the tutorial steps I followed exactly:

  1. Initialize A Project

Create a directory with a .hhconfig file in it. This will be the root of your project.

$ mkdir my_project
$ cd my_project
$ touch .hhconfig
  1. Write Your First Hack Program

Create a file called my_project/hello.hack with the following code:

use namespace HH\Lib\IO;

<<__EntryPoint>>
async function main(): Awaitable<void> {
  await IO\request_output()->writeAllAsync("Hello World!\n");
}
  1. Run The Typechecker

Normally you'll get type errors and hover information from within your IDE. You can also run the typechecker directly to confirm that you have no type errors in any files in your project.

$ cd my_project
$ hh_client
No errors!
  1. Run Your Program

HHVM provides the Hack runtime. You can run your program as follows:

$ cd my_project
$ hhvm hello.hack
Hello World!
  1. Run A Website

Normally you'll start HHVM as a webserver, and it will automatically pick up any changes to files you make.

$ cd my_project
$ hhvm -m server -p 8080

You can now visit http://localhost:8080/hello.hack to see "Hello World!" in your browser.

@lexidor
Copy link
Collaborator

lexidor commented Apr 7, 2022

Hi 👋, these notices are not specific to your setup and you have followed the guide correctly. These notices have been around for a really long time. They occur in Docker and on Linux. They can be ignored without ill effect (for as far as I understand). I have been ignoring them for ages.

I am not a member of the hhvm team, nor do I work for Facebook.

@codewizard13
Copy link
Author

Hi 👋, these notices are not specific to your setup and you have followed the guide correctly. These notices have been around for a really long time. They occur in Docker and on Linux. They can be ignored without ill effect (for as far as I understand). I have been ignoring them for ages.

Thanks! This is encouraging

@alexeyt
Copy link
Contributor

alexeyt commented Apr 8, 2022

I can confirm this warning is harmless: it is just saying that a performance optimization was unavailable. We can disable this perf optimization by default in open source builds, which will suppress the warning (in order to make use of the optimization you need to configure the kernel to make huge pages available at boot time, and most users won't want this). We can leave this issue open to track suppressing the warning.

@lexidor lexidor mentioned this issue Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants