While trying to update
wasm-pack ni nixpkgs, I ran into the issue where
wasm-pack would segfault when trying to list the version:
$ asm-pack -v wasm-pack 0.9.1 Ashley Williams <email@example.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! fish: “wasm-pack -v” terminated by signal SIGSEGV (Address boundary error)
Suspecting that it may be specific to the derivation and not to the upstream package, I tried compiling and installing the tool with
cargo install. There, it doesn’t segfault!
gdb shows that the segfault is OpenSSL related, which seems a bit similar to this issue: Segmentation fault after small patch · Issue #650 · rustwasm/wasm-pack · GitHub
I wonder why segfault only occurs when I build the tool as a derivation only, even though the dependencies used in both build methods should be the same.