facebook / facebook/hhvm

[ Runtime ] Can't invoke Hack script with exotic characters in the file path

Open
#8,729 0 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

**Describe the bug**

HHVM can't execute Hack code (tested with hello world) if the file path contains exotic characters (tested with `(╯°□°)╯︵┻━┻`).

**Standalone code, or other way to reproduce the problem**

```SH
mkdir (╯°□°)╯︵┻━┻
cd (╯°□°)╯︵┻━┻
touch .hhconfig
mkdir src
echo '<<__EntryPoint>> function main(): void {echo "Hello, World!";}' > src/TableFlip.hack
hhvm src/TableFlip.hack
```

Steps to reproduce the behavior:
1. Execute src/TableFlip.hack

**Expected behavior**
This script should execute and print `Hello, World!` to the console.

**Actual behavior**

```
Fatal error: Uncaught Error: (Invalid_argument Char.chr) in /path/to/(╯°□°)╯︵┻━┻/src/TableFlip.hack:-1
Stack trace:
#0 {main}
```

Please note that the exception is thrown from line -1.

**Environment**
- Operating system
> Ubuntu 20.04
- Installation method
> apt-get with dl.hhvm.com repository
- HHVM Version
> HipHop VM 4.56.1 (rel)
> Compiler: 1593547575_929404933
> Repo schema: d1ae8e21bf3419a65f12a010527485564e719d07
> hackc-0b10dd000fc9b454637d8dffc67fb542d231572c-4.56.1

**Additional context**
Wanted to reproduce #7146 in modern hhvm builds, so I made a joke directory name.
This prevented me from executing any code from that directory.
https://github.com/facebook/hhvm/issues/7146#issuecomment-225146123

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.