probonopd / go-appimage

Go implementation of AppImage tools
MIT License
760 stars 73 forks source link

AppImaged wrap return invalid memory error on Fedora 36 KDE #210

Closed dandreossi closed 2 years ago

dandreossi commented 2 years ago

When I run some AppImage file with the command

appimaged-709-x86_64.AppImage wrap "someApp.AppImage"

I get this error and the AppImage does not start:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x1 pc=0x70d2d0]

goroutine 44 [running]:
gopkg.in/ini%2ev1.(*File).SectionsByName(0x0, {0x2efa40?, 0x0?})
        gopkg.in/ini.v1@v1.63.0/file.go:150 +0x70
gopkg.in/ini%2ev1.(*File).GetSection(...)
        gopkg.in/ini.v1@v1.63.0/file.go:137
gopkg.in/ini%2ev1.(*File).Section(0x10000000000?, {0x2efa40, 0xd})
        gopkg.in/ini.v1@v1.63.0/file.go:169 +0x28
main.findDesktopFilesPointingToExecutable({0x7ffe87f7791a, 0x35})
        github.com/probonopd/go-appimage/src/appimaged/appwrapper.go:160 +0x25a
main.checkDesktopFiles({0x7ffe87f7791a, 0x35})
        github.com/probonopd/go-appimage/src/appimaged/appwrapper.go:174 +0x27
created by main.appwrap
        github.com/probonopd/go-appimage/src/appimaged/appwrapper.go:36 +0x18c

I cannot understand what's causing this issue.

CalebQ42 commented 2 years ago

Can you provide a link to an AppImage you're having issues with. And does it seem like this is happening with all AppImages you've tried, or just one?

dandreossi commented 2 years ago

I'm using this. https://www.navicat.com/download/direct-download?product=navicat16-premium-en.AppImage&location=1

I've tried also with the old version (Navicat Premium 15) and getting same error

https://www.navicat.com/en/download/direct-download?product=navicat15-premium-en.AppImage&location=1

So, for what I can say, it's happening for all AppImages.

CalebQ42 commented 2 years ago

Unfortunately I don't seem to be having the same issue on my system, and the error location it's giving shouldn't be giving any issues. That being said, we are using a bit older of a version of the library that's throwing the error. Attached, I compiled a version of appimaged using the newest version of the library to see if that fixes your issue. If it does, then I'll submit a PR.

If you don't feel comfortable using the version I built, then you just need to change one line in go.mod:

gopkg.in/ini.v1 v1.63.0

to

gopkg.in/ini.v1 v1.66.6

and then run scripts/build.sh and the built appimaged will be in the build folder.

appimaged-2022-06-13_050333-x86_64.zip

dandreossi commented 2 years ago

Even with your build the issue is still here.

Don't know if it can help, but I must say that by launching the AppImage directly, I've no issue and the program run regularly.

If you have any suggestions for some test that I can perform, I will be happy to try them.

dandreossi commented 2 years ago

Can this problem have some qt dependencies related origins?

dandreossi commented 2 years ago

Found the problem! If in xdg.DataHome + "/applications/" is present an invalid symlink, the appimaged wrapper crash, often without starting the application.

I've created a PR with a possible solution