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

GUI segmentation fault #416

Closed
jlesage opened this issue Aug 13, 2021 · 10 comments
Closed

GUI segmentation fault #416

jlesage opened this issue Aug 13, 2021 · 10 comments

Comments

@jlesage
Copy link
Contributor

jlesage commented Aug 13, 2021

With the latest 3.2.0 version, the GUI is crashing with segmentation fault:

  • The crash happen very early in the startup process.
  • No issue with previous versions.
  • Czkawka is compiled under Alpine Linux.
  • It is run a Docker container (see https://github.com/jlesage/docker-czkawka).
  • The CLI is working fine.

I'm wondering if you have any hint/idea on how to debug this crash.

Thanks!

@qarmin
Copy link
Owner

qarmin commented Aug 15, 2021

Without logs I don't see what thing could crash.
I suspect that this may be caused by OS or apps/libraries not Czkawka.

I didn't build app from docker file, but I compiled it manually on alpine image and looks that it run fine with xvfb(both release and debug build)

https://github.com/jlesage/docker-czkawka/blob/09c0246ea35a43db4ad6774a7b98b1df276ba90b/Dockerfile#L8 - I tested it on 3.14.1

Here glade files are moved to different folders
https://github.com/jlesage/docker-czkawka/blob/09c0246ea35a43db4ad6774a7b98b1df276ba90b/Dockerfile#L50-L51
https://github.com/qarmin/czkawka/tree/master/czkawka_gui/ui

@jlesage
Copy link
Contributor Author

jlesage commented Sep 3, 2021

Without logs I don't see what thing could crash.

How can we get logs ?

I didn't build app from docker file, but I compiled it manually on alpine image and looks that it run fine with xvfb(both release and debug build)

https://github.com/jlesage/docker-czkawka/blob/09c0246ea35a43db4ad6774a7b98b1df276ba90b/Dockerfile#L8 - I tested it on 3.14.1

Which version of Alpine did you use to compile manually ? Also, are you saying that you tested the manually compiled binary with the Docker image ?

@qarmin
Copy link
Owner

qarmin commented Sep 11, 2021

I used 3.14.1(now it is available 3.14.2)

docker run -it alpine:3.14 /bin/sh

and later I just installed all dependencies just like here(commands were a little different) - https://github.com/jlesage/docker-czkawka/blob/09c0246ea35a43db4ad6774a7b98b1df276ba90b/Dockerfile#L32-L39

and after compiling I just run czkawka with command xfvb-run target/debug/czkawka_gui

@jlesage
Copy link
Contributor Author

jlesage commented Nov 23, 2021

I'm still getting a segfault with Alpine 3.14. Here is what I did.

Use an Alpine 3.14 Docker container:

docker run --rm -ti alpine:3.14 sh

Run the following commands to build czkawka:

apk --no-cache add build-base bash curl xvfb-run gtk+3.0-dev
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y
source /root/.cargo/env
mkdir /tmp/czkawka
curl -# -L https://github.com/qarmin/czkawka/archive/3.3.1.tar.gz | tar xz --strip 1 -C /tmp/czkawka
cd /tmp/czkawka
cargo build

Finally, run the UI:

xvfb-run target/debug/czkawka_gui

And I see the crash:

Segmentation fault (core dumped)

Since you don't see the crash on your side, what are you doing differently ?

@jlesage
Copy link
Contributor Author

jlesage commented Nov 23, 2021

The crash seems to happen when initializing GTK. I tried to run examples from https://github.com/gtk-rs/gtk-rs-core and I also got crashes. So I opened (as you have seen) the following issue: gtk-rs/gtk-rs-core#387.

@jlesage
Copy link
Contributor Author

jlesage commented Nov 23, 2021

After more testing, I see no crash when using Rust from the Alpine repository. So it seems they fixed Rust issues on their side.

Note that Czkawka requires the latest Rust stable version (1.56.1) to compile, which is available only in the edge Alpine repo.

@qarmin
Copy link
Owner

qarmin commented Nov 23, 2021

Minimal supported Rust version at this moment is 1.53.0 - it is even tested in CI https://github.com/qarmin/czkawka/runs/4298019886?check_suite_focus=true
Probably even 1.51.0 should work

@jlesage
Copy link
Contributor Author

jlesage commented Nov 23, 2021

Ok thanks for the precision.

I tried to compile with Rust 1.52.1 from Alpine 3.14 and it didn't work.

@jlesage
Copy link
Contributor Author

jlesage commented Nov 23, 2021

I'm closing this issue, since we now better understand from where the crash is coming from.

@jlesage
Copy link
Contributor Author

jlesage commented Nov 23, 2021

To add another detail: using the official Rust version and compiling with RUSTFLAGS="-C target-feature=-crt-static" also works. Rust from Alpine has been patched to use this by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants