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

Hermes crashes on attempt to emit binary to the same destination #45

Closed
noomorph opened this issue Jul 17, 2019 · 1 comment
Closed
Assignees
Labels
bug Something isn't working

Comments

@noomorph
Copy link

noomorph commented Jul 17, 2019

UPD: The bug looks Linux-specific.

Steps to reproduce

  1. Download latest release: https://github.com/facebook/hermes/releases/download/v0.1.0/hermes-cli-linux-v0.1.0.tar.gz
  2. Change directory to the one with the unpacked hermes binary.
  3. Download the attached bundle: https://gist.githubusercontent.com/noomorph/db28b07f10d822e58af10f0276eac5b7/raw/2ec64da516295db823fa0aee327f7fa3221e51bf/index.android.bundle
  4. Run:
hermes -emit-binary -out index.android.bundle index.android.bundle -O -w

Expected result

The original bundle file should be replaced with the emitted binary.

Actual result

Crash:

Stack dump:
0.      Program arguments: /home/x/Projects/hermesvm/10/hermes --emit-binary -out index.android.bundle index.android.bundle -O -w
1.      Program arguments: /home/x/Projects/hermesvm/10/hermes --emit-binary -out index.android.bundle index.android.bundle -O -w
[0x41ba83]
[0x41abc9]
[0x41ac6c]
[0x4265e0]
[0x499f43]
[0x49a163]
[0x43d7ff]
[0x43d967]
[0x44003a]
[0x4399b2]
[0x439b32]
[0x42b8b9]
[0x4308d6]
[0x40487b]
[0x712f34]
[0x7131b1]
[0x408116]
[0x41ba83]
[0x41abc9]
[0x41ac6c]
[0x4265e0]
[0x499f43]
[0x49a163]
[0x43d7ff]
[0x43d967]
[0x44003a]
[0x4399b2]
[0x439b32]
[0x42b8b9]
[0x4308d6]
[0x40487b]
[0x712f34]
[0x7131b1]
[0x408116]
Bus error (core dumped)

Environment

  • Ubuntu 18.04.2 LTS (4.15.0-54-generic)
@dulinriley dulinriley added the bug Something isn't working label Jul 17, 2019
@mhorowitz mhorowitz self-assigned this Jul 19, 2019
facebook-github-bot pushed a commit that referenced this issue Jul 19, 2019
Summary:
This fixes a bug when the input and output of the compiler
are the same filename.  It was possible for the compiler to try to
read source lines from the JS file to print a warning, when the file
had already been truncated and/or overwritten with bytecode.  On
linux, this would blow up.

#45 includes a repro.

This also updates some tests which used -out /dev/null which will no
longer work, as /dev/null.@@@@@@ cannot be created.

Reviewed By: avp

Differential Revision: D16383966

fbshipit-source-id: feed4f830d8f9d1a36fc162f6d15d0e963d8d72f
@willholen
Copy link
Contributor

hermes-engine 0.1.1 is out with mhorowitz's fix

facebook-github-bot pushed a commit that referenced this issue Feb 22, 2021
Summary:
I released the new version a while ago. Better to stay in sync.

Pull Request resolved: facebookincubator/fbjni#45

Test Plan:
./gradlew assemble
scripts/run-host-tests.sh

Reviewed By: mweststrate

Differential Revision: D26544925

Pulled By: passy

fbshipit-source-id: 358cee2bdd49f612ede0c611287ff757d113b096
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants