facebook / facebook/hhvm

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

Open
#9,063 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
18.7k
Forks
3.1k
Avg merge
1h 47m
Merged PRs (30d)
2

Description

I'm trying to learn Hack [following this tutorial](https://docs.hhvm.com/hack/getting-started/starting-a-real-project) 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 (https://github.com/facebook/hhvm/issues/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](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](https://user-images.githubusercontent.com/3443044/162280795-14c17973-9b48-4adc-8d90-cb7080e1374f.png)

**Error 2**

![ERROR: HardwareCounter: perf_event_open failed with: Permission denied](https://user-images.githubusercontent.com/3443044/162281351-0ebb4513-452f-41b9-8ba2-c535e24fe708.png)

## Expected behavior

I was following a [tutorial](https://docs.hhvm.com/hack/getting-started/getting-started) 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:

2. 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
```

3. 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 {
await IO\request_output()->writeAllAsync("Hello World!\n");
}
```

4. 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!
```

5. Run Your Program

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

```
$ cd my_project
$ hhvm hello.hack
Hello World!
```

6. 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](http://localhost:8080/hello.hack) to see "Hello World!" in your browser.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.