Skip to content

segfault when running basic example on Alpine (musl) #387

Closed
@jlesage

Description

@jlesage

Initializing gtk seems to crash on Alpine Linux (which uses musl). The segmentation fault can be reproduced by running the basics example (or any other).

To reproduce, use an Alpine Docker container:

docker run --rm -ti alpine:3.14

Run the following commands to build examples:

apk --no-cache add build-base curl git bash gtk+3.0-dev
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y
source $HOME/.cargo/env
cd /tmp/
git clone https://github.com/gtk-rs/gtk3-rs.git
cd gtk3-rs/examples/
cargo build

And run the basics example:

export RUST_BACKTRACE=full
../target/debug/basics

You get the following crash:

Program terminated with signal SIGSEGV, Segmentation fault.

GDB backtrace from generate core:

#0  0x0000000000000000 in ?? ()
gtk-rs/gtk3-rs#1  0x00007f339858d155 in gtk::auto::application::Application::new (application_id=..., flags=...) at gtk/src/application.rs:18
gtk-rs/gtk3-rs#2  0x00007f33985899d7 in basics::main () at examples/basics/main.rs:20

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions