linuxdeployqt icon indicating copy to clipboard operation
linuxdeployqt copied to clipboard

Segfault when there's more than one icon matching pattern in desktop file

Open TheAssassin opened this issue 9 years ago • 10 comments

I've copied a window icon (.xpm file) to usr/share/hicolor/scalable by accident. This causes linuxdeployqt to segfault:

...
Found icons from desktop file: ("/dev/shm/AppImageUpdate-build-2DIkG2/AppDir/usr/share/icons/hicolor/scalable/AppImage.svg", "/dev/shm/AppImageUpdate-build-2DIkG2/AppDir/usr/share/icons/hicolor/scalable/AppImage.xpm")
iconToBeUsed: "/dev/shm/AppImageUpdate-build-2DIkG2/AppDir/usr/share/icons/hicolor/scalable/AppImage.xpm"
Copied "/dev/shm/AppImageUpdate-build-2DIkG2/AppDir/usr/share/icons/hicolor/scalable/AppImage.xpm" to "/dev/shm/AppImageUpdate-build-2DIkG2/AppDir/AppImage.xpm"
resources/build-appimages.sh: Line 50: 28664 Segmentation Violation  ./linuxdeployqt-continuous-x86_64.AppImage AppDir/usr/share/applications/appimageupdatetool.desktop -verbose=1 -bundle-non-qt-libs -executable=AppDir/usr/bin/AppImageUpdate -executable=AppDir/usr/bin/AppImageSelfUpdate

This should be debugged and fixed immediately. Meanwhile, I'll fix my builds by not copying the file there.

TheAssassin avatar Nov 12 '17 22:11 TheAssassin

Copying to AppImage root isn't helping either:

preExistingToplevelIcon: "/dev/shm/AppImageUpdate-build-Wcqupg/AppDir/AppImage.xpm"

TheAssassin avatar Nov 12 '17 22:11 TheAssassin

Things get even more annoying:

Found icons from desktop file: ("/dev/shm/AppImageUpdate-build-RE8IcB/AppDir/usr/share/appimageupdate/AppImage.xpm", "/dev/shm/AppImageUpdate-build-RE8IcB/AppDir/usr/share/icons/hicolor/scalable/AppImage.svg")

This needs to be fixed in order to be able to implement https://github.com/AppImage/AppImageUpdate/issues/38.

TheAssassin avatar Nov 12 '17 22:11 TheAssassin

I can't fix my issues any other than renaming the file. I tried to move the file into another directory, but that causes the same problem:

Found icons from desktop file: ("/dev/shm/AppImageUpdate-build-ACnwny/AppDir/resources/AppImage.xpm", "/dev/shm/AppImageUpdate-build-ACnwny/AppDir/usr/share/icons/hicolor/scalable/AppImage.svg")

TheAssassin avatar Nov 12 '17 23:11 TheAssassin

For one, scalable is for svg and svgz, whereas xpm is an old legacy format that should best be avoided altogether. (Normally they reside in /usr/share/pixmaps, so not even in the /usrs/share/icons hierarchy, if I remember correctly. I don't t think they are working properly with appimaged either, since I could not find a reliable way to make them recognized from within $HOME across all desktop environments. So I think the state of xpm files is quite broken in Linux Desktop land, but I am not sure whether that's downside, really. Just move on ;-)

probonopd avatar Nov 13 '17 07:11 probonopd

What happens if you try the exact same things but with an svg instead?

probonopd avatar Nov 13 '17 07:11 probonopd

I have the same issue with svg icons. The latest version of linuxdeployqt always terminates with an segmentation fault.

Log ` [ams-studio-pipeline_develop-TXPR7GXLQLO7PETWWSI476AVDVQJKT4TXSPFYQ4GKJAD4JOWBGGA] Running shell script

  • mkdir -p appdir/usr/bin

  • cp bin/studio appdir/usr/bin/

  • mkdir -p appdir/usr/share/icons/hicolor/scalable/

  • cp icons/file-alt.svg icons/folder-open.svg icons/folder.svg icons/gams-w.svg icons/gams-w24.svg icons/gamslogo.svg icons/gamstext-w.svg icons/gamstext.svg icons/icons.qrc icons/pause.svg icons/play.svg icons/stop.svg appdir/usr/share/icons/hicolor/scalable/

  • chmod +x linuxdeployqt-continuous-x86_64.AppImage

  • ./linuxdeployqt-continuous-x86_64.AppImage gamsstudio.desktop -appimage -bundle-non-qt-libs -no-translations

Desktop file as first argument: "gamsstudio.desktop"

desktopExecEntry: "studio"

desktopIconEntry: "gamslogo"

Found binary from desktop file: "/var/lib/jenkins/workspace/ams-studio-pipeline_develop-TXPR7GXLQLO7PETWWSI476AVDVQJKT4TXSPFYQ4GKJAD4JOWBGGA/appdir/usr/bin/studio"

FHS-like mode with PREFIX, fhsPrefix: "/var/lib/jenkins/workspace/ams-studio-pipeline_develop-TXPR7GXLQLO7PETWWSI476AVDVQJKT4TXSPFYQ4GKJAD4JOWBGGA/appdir/usr"

app-binary: "/var/lib/jenkins/workspace/ams-studio-pipeline_develop-TXPR7GXLQLO7PETWWSI476AVDVQJKT4TXSPFYQ4GKJAD4JOWBGGA/appdir/usr/bin/studio"

appDirPath: "/var/lib/jenkins/workspace/ams-studio-pipeline_develop-TXPR7GXLQLO7PETWWSI476AVDVQJKT4TXSPFYQ4GKJAD4JOWBGGA/appdir"

relativeBinPath: "usr/bin/studio"

Copied "gamsstudio.desktop" to "/var/lib/jenkins/workspace/ams-studio-pipeline_develop-TXPR7GXLQLO7PETWWSI476AVDVQJKT4TXSPFYQ4GKJAD4JOWBGGA/appdir/gamsstudio.desktop"

Found icons from desktop file: ("/var/lib/jenkins/workspace/ams-studio-pipeline_develop-TXPR7GXLQLO7PETWWSI476AVDVQJKT4TXSPFYQ4GKJAD4JOWBGGA/appdir/usr/share/icons/hicolor/scalable/gamslogo.svg")

iconToBeUsed: "/var/lib/jenkins/workspace/ams-studio-pipeline_develop-TXPR7GXLQLO7PETWWSI476AVDVQJKT4TXSPFYQ4GKJAD4JOWBGGA/appdir/usr/share/icons/hicolor/scalable/gamslogo.svg"

Copied "/var/lib/jenkins/workspace/ams-studio-pipeline_develop-TXPR7GXLQLO7PETWWSI476AVDVQJKT4TXSPFYQ4GKJAD4JOWBGGA/appdir/usr/share/icons/hicolor/scalable/gamslogo.svg" to "/var/lib/jenkins/workspace/ams-studio-pipeline_develop-TXPR7GXLQLO7PETWWSI476AVDVQJKT4TXSPFYQ4GKJAD4JOWBGGA/appdir/gamslogo.svg"

Segmentation fault (core dumped)

script returned exit code 139 `

With the previous versions of linuxdeployqt everything was running smoothly. But with the new one I was not able to get the linuxdeployqt call running. Do you have any suggestions?

In case you need the full debug log I'm happy to provide it.

MrMontag avatar Nov 13 '17 15:11 MrMontag

MrMontag, can you please give us the precise version numbers of the "old" and "new" version. Thanks.

probonopd avatar Nov 13 '17 17:11 probonopd

I use the continues build package of linuxdeployqt. The last successful linuxdeployqt call was on Thursday the 9. November (6:22 PM CET). On Monday I started a build again with the latest linuxdeployqt package. Since then the linuxdeployqt call always ends with a segmentation fault.

MrMontag avatar Nov 14 '17 11:11 MrMontag

The only change of icon handling code made during that time that jumped to my eye is

https://github.com/probonopd/linuxdeployqt/commit/35c2fedfa66b63a74ce877d6ac1cff5b2c82f0c4

Do you think it could be related to that change (which seems to me to be a valid bugfix)? Do you get different results based on whether you do or do not have a pre-existing .DirIcon in the root of the AppDir?

cc @sithlord48

probonopd avatar Nov 14 '17 18:11 probonopd

The only other commit with code in that date range is 5dc2aaea .

sithlord48 avatar Nov 21 '17 22:11 sithlord48