TheAssassin / libdesktopenvironments

A library that simplifies native UI engineering on the Linux desktop
MIT License
1 stars 0 forks source link

Segfault in AppImageUpdate #3

Closed TheAssassin closed 6 years ago

TheAssassin commented 6 years ago

CC @antony-jr

Follow-up for https://github.com/AppImage/AppImageUpdate/issues/63.

It appears to me like libDE fails to call the KDE configuration program to determine font and font size. The weird aspect is that according to @antony-jr, this is only a problem when a file chooser is shown by the app.

@antony-jr in order to make sure this is a libDE bug and not an FTLK one, could you please clone this repo, build it and call the demo? If said demo segfaults, please post a stacktrace. If it works fine, we can be sure it's not a libDE bug.

antony-jr commented 6 years ago

@TheAssassin it seems to work great when I build AppImageUpdate from source , Only occurs when I use the travis built AppImage. I have no Idea whats wrong. 😕

libDE demo output

libdesktopenvironments demo
===========================

Desktop environment: KDE
sh: --localprefix: command not found
Failed to call KDE configuration program !
Interface font:      Noto Sans Regular 10

The demo exits with no error , so I think its fltk ?

antony-jr commented 6 years ago

This is what happens... Take a look here

TheAssassin commented 6 years ago

According to your gif, the crash occurs after the libDE warning. But I still think the problems are related, as it crashes when the main window is to be drawn.

Please try extracting the AppImage and run the app with gdb. Also, please provide more information on your system. It looks like something exotic.

antony-jr commented 6 years ago

According to your gif, the crash occurs after the libDE warning.

The warning is not the cause , this crash only occurs when I choose the AppImage from the file chooser.

OS : Arch Linux Version : 4.14.10-1-ARCH Desktop Environment : KDE Plasma

I will update you soon with some gdb debugs , not a pro with gdb.

antony-jr commented 6 years ago

This is what I got from gdb from executing each line from gui_main.cpp , it seems that the line 481 from gui_main.cpp is causing the error which starts the updater. 😕

sh: $'\200\270t': command not found
Failed to call KDE configuration program ��t!
0x00000000004368fd      471             && desktopEnvironment->gtkInterfaceFont(font)) {
(gdb) nexti
0x00000000004368ff      471             && desktopEnvironment->gtkInterfaceFont(font)) {
(gdb) nexti
472             setFltkFont(font);
(gdb) nexti
0x000000000043699d      472             setFltkFont(font);
(gdb) nexti
0x00000000004369a2      472             setFltkFont(font);
(gdb) nexti
476         thread workerThread(runUpdate, pathToAppImage);
(gdb) nexti
0x000000000043690d      476         thread workerThread(runUpdate, pathToAppImage);
(gdb) nexti
0x0000000000436910      476         thread workerThread(runUpdate, pathToAppImage);
(gdb) nexti
0x0000000000436915      476         thread workerThread(runUpdate, pathToAppImage);
(gdb) nexti
[New Thread 0x7ffff276f700 (LWP 6753)]
478         auto result = Fl::run();
(gdb) nexti
481         workerThread.join();
(gdb) nexti
478         auto result = Fl::run();
(gdb) nexti
481         workerThread.join();
(gdb) nexti
Checking for updates...
[New Thread 0x7ffff1393700 (LWP 6755)]

Thread 3 "AppImageUpdate" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff1393700 (LWP 6755)]
0x00000000000035b0 in ?? ()
TheAssassin commented 6 years ago

The warning is not the cause , this crash only occurs when I choose the AppImage from the file chooser.

And you say the UI is displayed fine when passing an AppImage as a parameter? Could you please make a screenshot of that case as well? (That's just me being curious given that libDE fails to call kde*-config...)

TheAssassin commented 6 years ago

I could imagine the path the file chooser yields is broken, somehow breaking the Updater instance. I'm not sure how we could continue to debug this, though. I think I have to add some debug logging for you.

antony-jr commented 6 years ago

And you say the UI is displayed fine when passing an AppImage as a parameter? Could you please make a screenshot of that case as well? (That's just me being curious given that libDE fails to call kde*-config...)

Terminal Output:

./AppImageUpdate-189-6e634ca-x86_64.AppImage AppImageUpdate-189-6e634ca-x86_64.AppImage 
AppImageUpdate version 1-alpha (commit 6e634ca), build 189 built on 2018-01-25 07:00:57 UTC
sh: --localprefix: command not found
Failed to call KDE configuration program !
Checking for updates...
Fetching release information for tag "continuous" from GitHub API.
... done

GUI Output ( PNG ):

Imgur

TheAssassin commented 6 years ago

I cannot reproduce the issue, not even on Arch Linux. I'm sorry, but without further information, I can't help you. Arch Linux is just one of the worst distributions to report errors from...

If you happen to find a fix yourself, please feel free to send a PR to either this repository or the AppImageUpdate repo.

antony-jr commented 6 years ago

No Problem , I thought this is caused in all linux distro's. If its just me then I think I broke something. You can close this issue anytime. 👍

Thank You for your time! ❤️

TheAssassin commented 6 years ago

We might be replacing FLTK soon anyway, so yeah, I hope the issue will just go away. Thanks for reporting anyway.