Skip to content

llc crashes linking gfx-rs under emscripten #47023

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

Closed
kvark opened this issue Dec 26, 2017 · 3 comments
Closed

llc crashes linking gfx-rs under emscripten #47023

kvark opened this issue Dec 26, 2017 · 3 comments
Labels
A-linkage Area: linking into static, shared libraries and binaries C-bug Category: This is a bug. I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. O-wasm Target: WASM (WebAssembly), http://webassembly.org/ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@kvark
Copy link
Contributor

kvark commented Dec 26, 2017

Looks very similar to #37952 (cc @alexcrichton @s3bk):

Compiling gfx_app v0.8.0 (file:///home/kvark/Code/gfx)
*** Error in /home/kvark/Code/ems/fastcomp/build/bin/llc': munmap_chunk(): invalid pointer: 0x0000000009984ab8 *** error: linking with emcc` failed: exit code: 1

Rust versions tested:

  • "rustc 1.22.1 (05e2e1c 2017-11-22)"
  • "rustc 1.24.0-nightly (edbd7d2 2017-12-20)"

Repro steps:

git clone https://github.com/kvark/gfx -b emscripten
cd gfx
cargo build --example cube --target wasm32-unknown-emscripten

Full log: https://gist.github.com/kvark/6a0189727e67dbc950c4a140eae9646d

@nstoddard
Copy link

Does this also happen if you enable -O2 or above? I've seen something similar which went away when I enabled optimization. This might let you work around this issue until it's fixed.

@kvark
Copy link
Contributor Author

kvark commented Dec 29, 2017

@nstoddard you saved my day! Building with --release seems to work so far 👍 (as a workaround)

bors bot added a commit to gfx-rs/gfx that referenced this issue Dec 29, 2017
1706: More Emscripten support r=msiglreith a=kvark

## Intro
This is a big follow-up to #1681 and #1685

After being blocked by rust-lang/rust#47023, I got stuff building in release, so continued porting the examples over. Note: there is a lot of shader code duplication, we need some (simple) templating/preprocessor there.

## Environment

OS: Linux + Firefox Nightly,

Emscripten: built from source with the following changes:
  - integrated emscripten-core/emscripten#5951
  - `USE_WEBGL2=1` is forcefully set in "settings.js"

## Status

🎉 Work 🎉 : triangle, cube, flowmap, blend, gamma, terrain, ubo_tilemap

Almost works: mipmap - see #1704

Not tested: deferred (too many shaders!), performance

Blocked by the lack of buffer mapping: instancing

Blocked by the lack of geometry/tessellation shader support: particle, render_target, terrain_tessellated

Fail to run: shadow, skybox - see #1705

## Proof
![gfx-emscripten-ubo_tilemap](https://user-images.githubusercontent.com/107301/34429974-5e6678d8-ec2d-11e7-91c7-2e4f3746e416.png)
@pietroalbini pietroalbini added I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. O-wasm Target: WASM (WebAssembly), http://webassembly.org/ C-bug Category: This is a bug. labels Jan 30, 2018
@jonas-schievink jonas-schievink added A-linkage Area: linking into static, shared libraries and binaries T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 22, 2019
@alexcrichton
Copy link
Member

A pretty huge amount has changed since this was first opened, so I'm going to close this as "pretty likely stale". If it reproduces still though feel free to reopen!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkage Area: linking into static, shared libraries and binaries C-bug Category: This is a bug. I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. O-wasm Target: WASM (WebAssembly), http://webassembly.org/ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants