wasm-pack: 65214 segmentation fault (core dumped) wasm-pack help
π Bug description
I run wasm-pack help and it crashes (sometimes).
wasm-pack 0.9.1
Ashley Williams <ashley666ashley@gmail.com>
π¦ β¨ pack and publish your wasm!
USAGE:
wasm-pack [FLAGS] [OPTIONS] <SUBCOMMAND>
FLAGS:
-h, --help Prints help information
-q, --quiet No output printed to stdout
-V, --version Prints version information
-v, --verbose Log verbosity is based off the number of v used
OPTIONS:
--log-level <log_level> The maximum level of messages that should be logged by wasm-pack. [possible values:
info, warn, error] [default: info]
SUBCOMMANDS:
build ποΈ build your npm package!
help Prints this message or the help of the given subcommand(s)
login π€ Add an npm registry user account! (aliases: adduser, add-user)
new π create a new project with a template
pack π± create a tar of your npm package but don't publish!
publish π pack up your npm package and publish!
test π©βπ¬ test your wasm!
malloc_consolidate(): invalid chunk size
[1] 65214 segmentation fault (core dumped) wasm-pack help
π€ Expected Behavior
Run without crash
π Steps to reproduce
cargo +stable install wasm-pack
wasm-pack help
π Your environment
wasm-pack version: 0.9.1 rustc version: 1.42.0
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 10
- Comments: 27 (2 by maintainers)
I had a different problem with similar outcome: wasm-pack always segfaulted on
wasm-pack build. For me the solution was to downgrade from wasm-pack 0.10.x to 0.9.1 like this:cargo install wasm-pack --version 0.9.1Apparently 0.10.x introduced a bugAs I couldnβt find a workaround, I fiddled a bit with it myself. In the end, I ended up changing the
curldependency to usestatic-curl, which seems to be solving this issue (sadly, this cannot be done viapatch, as that doesnβt support changingfeatures):In
Config.toml. It seems thecurlrust package doesnβt pinlibcurl, and so it picks the latest. I can imagine that thislibcurlis not compatible with my systemlibcurl. And making curl static solves that issue, as now it no longer depends on my systemlibcurl. But I am really guessing here, and stopped looking into this after my fixes unbroke my system πThis issue is fixed after https://github.com/rustwasm/wasm-pack/pull/1176 merges. In particular this binaryen upgrade fixed the sigsegv.
Until that PR merges, you an use this command to get the fix:
I am having the same issue, but only when building in a docker file. Running directly on my Computer it works fine.
The Dockerfile:
I first thought this might be caused by a newer rustc inside the docker, but both rustc and wasm-pack seem to be the same version:
Any ideas on how to fix this? adding
RUST_BACKTRACE=1has no effect.EDIT: I tried using different versions of
rustc(i.e. different version of the rust docker image), but none worked (1.54, 1.56, bullseye/buster, β¦). I also tried installing wasm-pack directly from git usingcargo install --git https://github.com/rustwasm/wasm-pack, but no luck either. I am out of ideas at this point, especially as it used to work a few days agoIn my case I was missing
crate-typemetadata atCargo.tomlConsider docs as reference
Edit: it seems not to be related to
crate-typemetadata. Installing version0.9.1solves the issue. Installing version0.9.1and installing version0.10.1also solves the issue.You can recreate the issue with this docker image:
An vscode dev container is included if someone else is interested:
Seeing same issue on
wasm-pack 0.9.1,ubuntu 20.04Same issue here on a clean install:
Works when downgrading to 0.9.1
For me, it works fine if I install without default features (
--no-defaults-features).