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

Tool immediately segfaults on Alpine Linux w/ Rustup #917

Closed
anicholson opened this issue Sep 24, 2020 · 6 comments
Closed

Tool immediately segfaults on Alpine Linux w/ Rustup #917

anicholson opened this issue Sep 24, 2020 · 6 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@anicholson
Copy link

🐛 Bug description

When I run wasm-pack inside an Alpine Linux docker container, it immediately segfaults.
Adding flags (like -V) or commands (like build) do not change this behavior.

🤔 Expected Behavior

I should see the usage information.

👟 Steps to reproduce

This is the docker container I was using.

FROM alpine as base

RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
RUN apk update && \
    apk add nodejs rustup openssl openssl-dev build-base

RUN rustup-init -y
RUN /root/.cargo/bin/cargo install wasm-pack

🌍 Your environment

Include the relevant details of your environment.
wasm-pack version: 0.9.1
rustc version: rustc 1.46.0 (04488afe3 2020-08-24)

I've also built and run trivial Rust programs inside this container with no issues, so I don't think rustc is the problem.

@ericseppanen
Copy link

I am experiencing the same problem on Ubuntu 20.04. I have wasm-pack 0.9.1, just installed for the first time by the rustwasm.github.io installer script, and running it with no arguments produces:

$ wasm-pack
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!
Segmentation fault (core dumped)

It segfaults in gdb as well, but doesn't produce a very useful stacktrace:

Thread 1 "wasm-pack" received signal SIGSEGV, Segmentation fault.
0x00000000009bb51c in alloc_rev ()
(gdb) bt
#0  0x00000000009bb51c in alloc_rev ()
#1  0x0000000200000000 in ?? ()
#2  0x0000000000ee7510 in ?? ()
#3  0x0000002900ee33c8 in ?? ()
#4  0x0000000000ee9620 in ?? ()
#5  0x0000000000000001 in ?? ()
#6  0x0000000000ee7510 in ?? ()
#7  0x0000000000ee7550 in ?? ()
#8  0x00007fffffffcf30 in ?? ()
#9  0x0000000000ee462c in mal ()
#10 0x00000000009bb808 in __bin_chunk ()
#11 0x0000000000ee462c in mal ()
#12 0x0000000000000040 in ?? ()
#13 0x0000000000000001 in ?? ()
#14 0x0000000000000040 in ?? ()
#15 0x0000000000000018 in ?? ()
#16 0x0000000100000000 in ?? ()
#17 0x0000000000000002 in ?? ()
#18 0x0000000000ee9620 in ?? ()
#19 0x0000000000000024 in ?? ()
#20 0x0000000000ee6920 in ?? ()
#21 0x000000000098a750 in ?? () at /rustc/5e1a799842ba6ed4a57e91f7ab9435947482f7d8/src/libcore/slice/mod.rs:2857
#22 0x00007fffffffcf30 in ?? ()
#23 0x00007fffffffd228 in ?? ()
#24 0x00000000007528e5 in OPENSSL_LH_free ()
#25 0x000000000073ab0d in err_cleanup ()
#26 0x0000000000750aa1 in OPENSSL_cleanup ()
#27 0x00000000009ba858 in __funcs_on_exit ()
#28 0x0000000000000001 in ?? ()
#29 0x0000000000000000 in ?? ()
(gdb) quit

@ericseppanen
Copy link

After reading a bit about the openssl/curl issues in #823, I decided to rebuild wasm-pack after cargo update to pick up newer upstream packages. Even though there's still one openssl fix that hasn't made it to a release yet, my rebuilt binary works without crashing.

I'd suggest that wasm-pack should update at least the openssl and curl dependencies and cut a new release. It's probably worth doing right away (since openssl-related segfaults have been reported multiple times), and probably again whenever the next openssl release happens.

anicholson added a commit to anicholson/wasm-pack that referenced this issue Sep 28, 2020
@ashleygwilliams ashleygwilliams added bug Something isn't working PR attached there's a PR open for this issue labels Dec 21, 2020
@ashleygwilliams
Copy link
Member

i think that the work i'm doing in #947 will address this. sorry you ran into it!

@ericseppanen
Copy link

@ashleygwilliams I'm confused? #947 doesn't seem to address this.

This is a dupe of #823. All that's needed is to update Cargo.lock with new dependencies (mostly openssl I think?).

@ashleygwilliams
Copy link
Member

ah, ok- sorry, #947 updates the way openssl gets built in the binary, but if we just need to update deps, i'll be doing that for the next release as well. sorry about that! and thanks for following up

@ashleygwilliams ashleygwilliams added duplicate This issue or pull request already exists and removed PR attached there's a PR open for this issue labels Dec 21, 2020
@ashleygwilliams
Copy link
Member

closing as dupe of #823

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants