Skip to content

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

@lexidor

Description

@lexidor

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

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.
#7146 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions