-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
cannot run the example js-hello #119
Comments
@grigorijmarkelov hm interesting! So you've seen that |
Alex, when I stop the process from manager there goes a big trace:
|
How odd! Can you try attaching a debugger to lld to see why it's hanging? |
Alex, when I stop the process from manager there goes a big trace:
|
Sorry for dups.Alex I attached gdb to process, look:
Actually I have weak familiarity with gdb,so tell if i need more special commands |
I tried to to step from main and it waits for smth:
which has no line number information. |
Oh dear! I wonder if this is a race of some form in LLD? Can you try compiling with |
Alex, again here goes the error:
|
Sorry, my dumb.Now goes:
When I attach gdb to lld, then it looks like this:
Seems the same? |
Hm ok it may be that
And see if it hits the same issue? |
Here is output with -Z print-link-args
Then i tried to compile with -C link-args but rustc many times errored with multiple input files:
Surely advice would help to me better comprehend with this. |
@grigorijmarkelov oh sorry I didn't mean running |
I read a bit from llvm site, regarding lld and it says LLD is installed as ld.lld. On Unix, linkers are invoked by compiler drivers, so you are not expected to use that command directly. So then I tried RUSTFLAGS='-Z linker-flavor=ld.lld' cargo build --target=wasm32-unknown-unknown
|
@grigorijmarkelov oh sorry the LLD on your system probably won't work, you'll need to use the one that comes with the Rust compiler (buried inside |
Alex thanks for your patience.I tried with lld from nightly toolchains but it says it's only generic driver.
Let bring my thought, I'm starting to realize that problem may be with my system.Started a question on SO : |
On the x86-64 linux-gnu os this example builds nicely.So it only problems with 32bit platform support. |
Hm interesting! It turns out one of the dependencies I added recently, Is there a way I could use a docker image or something like that to reproduce your results? |
Ok I'm gonna close this for now and chalk it up to werid system oddities, but if it comes back please let me know! |
@alexcrichton, hi! I've just got the same problem on my Ubuntu VPS. I would like to help you with investigating this issue. Please, tell me, what you need.
If that would be appropriate I could even give you access to my VPS, as I'm not sure I can give you a docker image or something like that. That's what I get in gdb (not sure how to get the backtrace, because it doesn't crash but just hangs):
|
A small update. |
@mvlabat ah ok excellent, thanks for the info! Sounds like you've confirmed |
Upstream bug reports (rustwasm/wasm-bindgen#119) show that this may be the culprit of odd crashes/hangs. The linker is a tiny fraction of build time anyway right now so let's disable it and figure out how to possibly reenable it later if necessary.
I've proposed that change in rust-lang/rust#50251 |
rustc: Disable threads in LLD for wasm Upstream bug reports (rustwasm/wasm-bindgen#119) show that this may be the culprit of odd crashes/hangs. The linker is a tiny fraction of build time anyway right now so let's disable it and figure out how to possibly reenable it later if necessary.
I have started learning wasm-bindgen recently.And even with first example js-hello-world there was a weird problem. https://github.com/rust-lang-nursery/rust-wasm
I did as was written, set rustc to nightly, then:
This is Cargo.toml:
And lib.rs:
Now when I build:
Compilation actually hangs not consuming even cpu resources:
Fresh unicode-xid v0.1.0
Fresh serde v1.0.37
Fresh fnv v1.0.6
Fresh num-traits v0.2.2
Fresh dtoa v0.4.2
Fresh itoa v0.4.1
Fresh proc-macro2 v0.3.6
Fresh serde_json v1.0.13
Fresh quote v0.5.1
Fresh syn v0.13.1
Fresh serde_derive_internals v0.23.0
Fresh serde_derive v1.0.37
Fresh wasm-bindgen-shared v0.2.1
Fresh wasm-bindgen-backend v0.2.1
Fresh wasm-bindgen-macro v0.2.1
Fresh wasm-bindgen v0.2.1
Compiling js-hello-world v0.1.0 (file:///home/markelovg/container/js-hello-world)
Running
rustc --crate-name js_hello_world src/lib.rs --crate-type cdylib --emit=dep-info,link -C debuginfo=2 -C metadata=a4ec1c36c55eb3a5 --out-dir /home/markelovg/container/js-hello-world/target/wasm32-unknown-unknown/debug/deps --target wasm32-unknown-unknown -C incremental=/home/markelovg/container/js-hello-world/target/wasm32-unknown-unknown/debug/incremental -L dependency=/home/markelovg/container/js-hello-world/target/wasm32-unknown-unknown/debug/deps -L dependency=/home/markelovg/container/js-hello-world/target/debug/deps --extern wasm_bindgen=/home/markelovg/container/js-hello-world/target/wasm32-unknown-unknown/debug/deps/libwasm_bindgen-a2e136f9a24e6618.rlib
This libwasm_bingden-a2e136f9a24e6618.rlib dependency exists in my project but nothing then happens.
In task manager I have lld -flavor wasm -L ~/.rustup/toolchain/nightly-i686-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib ~/myproject/target/wasm32-/debug/deps/longnames.rcgu.o etc and it doesn't consume cpu
The text was updated successfully, but these errors were encountered: