Stream: git-wasmtime

Topic: wasmtime / issue #7997 libgcc: SIGABORT inside `UnwindReg...


view this post on Zulip Wasmtime GitHub notifications bot (Feb 26 2024 at 13:13):

Mr-Leshiy added the bug label to Issue #7997.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 26 2024 at 13:13):

Mr-Leshiy opened issue #7997:

We have faced a SIGABORT failure during executing simple benchmark which you can find here https://github.com/input-output-hk/hermes/blob/f4d20fc06f0b558be4805a106db32480bcef649d/hermes/bin/src/wasm/module.rs#L118.
According to the stack trace

Steps to Reproduce

You can fully reproduce it in already prepared environment and code but cloning our repo and specifically this branch libgcc-wasmtime-unwinding-bug. (repo: https://github.com/input-output-hk/hermes)

Before start you will need to install earthly tool.
To run it you will need to execute the following in the root of the repo

earthly -I ./hermes+alpine-3-19-fail

This will prepare an alpine:3.19 environment with rust:1.75 version and all our project configuration that we have an all source code and run a benchmarks.
Earthfile code https://github.com/input-output-hk/hermes/blob/libgcc-wasmtime-unwinding-bug/hermes/Earthfile#L18

alpine-3-19-fail:
    FROM rust:1.75-alpine3.19

    # Install necessary packages
    RUN apk add --no-cache \
            musl-dev \
            gdb

    COPY --dir .cargo .config crates bin .
    COPY Cargo.toml .
    COPY clippy.toml deny.toml rustfmt.toml .

    RUN mkdir /wasm
    COPY --dir ../wasm+wasi-src/wasi /wasm/wasi
    # Compiled WASM component for benchmarks
    COPY ../wasm/c+build/component.wasm /wasm/c/bench_component.wasm

    # Run benchmarks
    RUN cargo bench --features bench

After the failure it will run an interacting mode -i flag (similar to docker interactive mode).
So you will be able to collect a dump file inside this container.

ulimit -c unlimited && ./target/release/deps/module-<> --bench

Then inspect it and using gdb

gdb  ./target/release/deps/module-<> core -- --bench

Actual Results

SIGABORT

Versions and Environment

Wasmtime version or commit: 17.0.0

Operating system: alpine:3.19

Extra Info

This is totally works on alpine:3.18 version with the libgcc:12 version.
We have found that most probable it is an issue with libgcc because, there is a huge difference with the libgcc unwinding implementation between these two versions.

libgcc_12 - https://github.com/gcc-mirror/gcc/blob/8cbb2cade4c724760c868c9f493b169d6ec4168a/libgcc/unwind-dw2-fde.c#L201

libgcc_13 - https://github.com/gcc-mirror/gcc/blob/0e7bc3eaa36b81004b799124d2fe00137401a43b/libgcc/unwind-dw2-fde.c#L225

You can try it running already prepared earthly target https://github.com/input-output-hk/hermes/blob/libgcc-wasmtime-unwinding-bug/hermes/Earthfile#L38

earthly ./hermes+alpine-3-18-pass


Last updated: Nov 22 2024 at 16:03 UTC