chaldea-center / chaldea

Chaldea - Yet Another Material Planner and Battle Simulator for Fate/Grand Order aka FGO
https://docs.chaldea.center
GNU Affero General Public License v3.0
321 stars 25 forks source link

[Bug]: Segmentation Fault Caused by InitSystemTray (Linux) #89

Closed Raeitus closed 3 months ago

Raeitus commented 1 year ago

What happened?

Had to install libayatana-appindicator for it to launch first per instructions or it wouldn't launch.

After that, when I try to launch the bin file, it pops up the blank GUI then closes itself.

Platform

Linux

Device Info

Arch Linux

Which game server is related to this issue? (Optional)

No response

App Version

2.3.6

Relevant log output

Terminal:

flutter: ├ #0   PathManager.initRootPath (package:chaldea/models/paths.dart:119)
flutter: │ #1   _Database.initiate (package:chaldea/models/db.dart:134)
flutter: ├ [2023-05-13 17:22:21.758][INFO] appPath: /mnt/HynixSSD/Games/Chaldea/userdata
flutter: └---------
flutter: Linux machine id query:
6aeed864e74c47519665fdf0eee51708
flutter: ├ #0   AppInfo._loadUniqueId (package:chaldea/packages/app_info.dart:162)
flutter: │ #1   AppInfo.resolve (package:chaldea/packages/app_info.dart:176)
flutter: ├ [2023-05-13 17:22:21.763][INFO] Unique ID: A41769AC-26C2-51D7-931F-9555C9D58005
flutter: └---------
flutter: ├ #0   AppInfo._loadApplicationInfo (package:chaldea/packages/app_info.dart:88)
flutter: │ #1   AppInfo.resolve (package:chaldea/packages/app_info.dart:178)
flutter: ├ [2023-05-13 17:22:21.765][INFO] Resolved app version: chaldea 2.3.6+931 5daff7 - 5/11/2023
flutter: └---------
method call InitSystemTray
[1]    3422 segmentation fault (core dumped)  ./chaldea
narumi147 commented 1 year ago

have you tried this package? https://archlinux.org/packages/community/x86_64/libappindicator-gtk3/

Raeitus commented 1 year ago

I actually already had libappindicator-gtk3 installed for other programs, but it didn't work. I would get the error:

./chaldea: error while loading shared libraries: libayatana-appindicator3.so.1: cannot open shared object file: No such file or directory

libayatana-appindicator is what provides usr/lib/libayatana-appindicator3.so.1, which fixes the above library error.

narumi147 commented 1 year ago

tbh I have no idea since it's plugin issue and no detail stacktrace given by plugin. I will remove InitSystemTray at startup unless user turn on the setting. Just a temp solution to skip it.


Sorry to ping you @Hoithmach , what's your system distribution exactly? got confused last time. Is the latest version of this app still working on your machine? Thanks.

Raeitus commented 1 year ago

I'll test the new version once you release it to see if it is actually being caused by the system tray and will let you know if that fixes the issue.

I was surprised that it didn't really provide much info to debug the issue in the terminal. Just Segmentation fault doesn't really explain much :/

narumi147 commented 1 year ago

Have a try on beta version. https://github.com/chaldea-center/chaldea/releases/tag/beta

Raeitus commented 1 year ago

The beta version works without any issues besides:

If I go in and toggle the system tray, the program crashes:

method call InitSystemTray
[1]    23712 segmentation fault (core dumped)  ./chaldea

When I go back into the program, it remains untoggled. So this must be a bug with the system tray. Well, at least I can use this for now!

narumi147 commented 1 year ago

yeah, it will remember toggle state, so if you crashed, the next startup will also crash. Since app cannot know it was crashed, you have to delete/turn off the option in settings.json -> showSystemTray to reset.

narumi147 commented 1 year ago

Do you have Ubuntu to test it? (v2.3.6) I wonder shall I disable it for all Linux or just non-Ubuntu.

Raeitus commented 1 year ago

Tested v2.3.6

Ubuntu Worked out of the box.

Zorin OS (Ubuntu-based) Had to install libayatana-appindicator3, libayatana-ido3, and then needed a newer glibc version (?) which I couldn't figure out on Zorin.

OpenSUSE Tumbleweed Had to install libayatana-appindicator3, which automatically installed the other dependencies such as libayatana-ido3. Worked.

Fedora Have to install libayatana-appindicator3, but I was unable to find the package. I don't know my way around Fedora.

narumi147 commented 1 year ago

Thanks for testing!

Can you update the OS version + glibc version too, for further investigation.

glibc is also a problem on Ubuntu 18 which stop me testing it on my end. I don't know how to correctly upgrade glibc either. ╮(╯▽╰)╭

Hoithmach commented 1 year ago

Sorry to ping you @Hoithmach , what's your system distribution exactly? got confused last time. Is the latest version of this app still working on your machine? Thanks.

Very late to respond, sorry. I don't think GitHub notified me at all.

In case you're still looking for an answer: I am also running Arch Linux on my main machine although I have access to several others, sorry to confuse you. I did experience a similar situation as described in this bug report with a previous version of Chaldea, however upgrading to the latest 2.4.4 release just now and installing libayatana-appindicator (on Arch Linux) appears to have resolved the issue.

I tested Ubuntu too - Works as expected after installing libayatana-appindicator3-dev. The only question I have is does it make sense to exchange the instructions for libayatana-appindicator3-dev (151MB of libraries) for libayatana-appindicator3-1 (~400KB)? Both appear to work fine, but perhaps there is a reason I'm unaware of that the former is needed?

I'm happy to try look into the glibc problem as well, if you think it's still relevant?

narumi147 commented 3 months ago

The previous package is dead for long time, moved to a new tray package. please have a try of beta release on each Linux to test the system tray.

narumi147 commented 3 months ago

If there is any issue on Linux system tray or window close, open a new issue instead.