AppImageCrafters / AppRun

AppDir runtime components
MIT License
26 stars 10 forks source link

crash in redirect_path_full in libapprun_hooks.so when redirection is used #15

Closed stsichler closed 4 years ago

stsichler commented 4 years ago

when trying to execute the AppImage created from this AppDir.tar.gz, the following crash arises:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7dc41e6 in redirect_path_full () from /tmp/.mount_LogVieFjBHY2/usr/lib/x86_64-linux-gnu/libapprun_hooks.so
(gdb) bt
#0  0x00007ffff7dc41e6 in redirect_path_full () from /tmp/.mount_LogVieFjBHY2/usr/lib/x86_64-linux-gnu/libapprun_hooks.so
#1  0x00007ffff7dc3118 in access () from /tmp/.mount_LogVieFjBHY2/usr/lib/x86_64-linux-gnu/libapprun_hooks.so
#2  0x00007ffff6e176e8 in ?? () from /tmp/.mount_LogVieFjBHY2/usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#3  0x00007ffff6db0f4c in QFileInfo::exists() const () from /tmp/.mount_LogVieFjBHY2/usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007ffff6e7945f in QCoreApplication::applicationFilePath() () from /tmp/.mount_LogVieFjBHY2/usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007ffff6e79be0 in QCoreApplication::applicationDirPath() () from /tmp/.mount_LogVieFjBHY2/usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007ffff6ca2e90 in ?? () from /tmp/.mount_LogVieFjBHY2/usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007ffff6ca33e4 in ?? () from /tmp/.mount_LogVieFjBHY2/usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007ffff6ca3d03 in QLibraryInfo::location(QLibraryInfo::LibraryLocation) () from /tmp/.mount_LogVieFjBHY2/usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#9  0x00007ffff6e7a45c in QCoreApplication::libraryPaths() () from /tmp/.mount_LogVieFjBHY2/usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#10 0x00007ffff6e61f3a in QFactoryLoader::update() () from /tmp/.mount_LogVieFjBHY2/usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#11 0x00007ffff6e63853 in QFactoryLoader::QFactoryLoader(char const*, QString const&, Qt::CaseSensitivity) ()
   from /tmp/.mount_LogVieFjBHY2/usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#12 0x00007ffff724948a in QPlatformIntegrationFactory::keys(QString const&) () from /tmp/.mount_LogVieFjBHY2/usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#13 0x00007ffff7256d59 in QGuiApplicationPrivate::createPlatformIntegration() () from /tmp/.mount_LogVieFjBHY2/usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#14 0x00007ffff7258708 in QGuiApplicationPrivate::createEventDispatcher() () from /tmp/.mount_LogVieFjBHY2/usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#15 0x00007ffff6e7c085 in QCoreApplicationPrivate::init() () from /tmp/.mount_LogVieFjBHY2/usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#16 0x00007ffff725a543 in QGuiApplicationPrivate::init() () from /tmp/.mount_LogVieFjBHY2/usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#17 0x00007ffff78953bd in QApplicationPrivate::init() () from /tmp/.mount_LogVieFjBHY2/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#18 0x00005555557b15c2 in main ()

Also see AppImageBuilder.yml.zip

azubieta commented 4 years ago

The path mapping is missing the target part, it should be something like: /usr/lib/x86_64-linux-gnu/qt5:$APPDIR/usr/lib/x86_64-linux-gnu/qt5

It's required to add some validations to the runtime, for better error messages.

stsichler commented 4 years ago

Hm. I just copy-pasted your corrected mapping line into my AppImageBuilder.yml, but it still crashes. Can you please post the corrected file here?

azubieta commented 4 years ago

notice that the path mappings entry is a list and the source and target are joint by a :

version: 1
AppDir:
  path: ./AppDir
  app_info:
    id: com.vrmagic.logviewer
    name: LogViewer
    icon: utilities-terminal
    version: latest
    exec: usr/bin/logviewer
    exec_args: $@
  runtime:
    env:
      APPDIR_LIBRARY_PATH: $APPDIR/usr/lib/x86_64-linux-gnu:$APPDIR/lib/x86_64-linux-gnu
    path_mappings:
      - /usr/lib/x86_64-linux-gnu/qt5:$APPDIR/usr/lib/x86_64-linux-gnu/qt5
  apt:
    arch: amd64
    sources:
    - sourceline: deb http://archive.ubuntu.com/ubuntu/ focal main restricted
      key_url: 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3b4fe6acc0b21f32'
    - sourceline: deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted
    - sourceline: deb http://archive.ubuntu.com/ubuntu/ focal universe
    - sourceline: deb http://archive.ubuntu.com/ubuntu/ focal-updates universe
    - sourceline: deb http://archive.ubuntu.com/ubuntu/ focal multiverse
    - sourceline: deb http://archive.ubuntu.com/ubuntu/ focal-updates multiverse
    - sourceline: deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted
        universe multiverse
    - sourceline: deb http://security.ubuntu.com/ubuntu/ focal-security main restricted
    - sourceline: deb http://security.ubuntu.com/ubuntu/ focal-security universe
    - sourceline: deb http://security.ubuntu.com/ubuntu/ focal-security multiverse
    include:
    - libdbus-1-3
    - libexpat1
    - libgpg-error0
    - liblzma5
    - libpcre3
    - libqt5svg5
    - libsystemd0
    - libtinfo6
    - libuuid1
    exclude: []
  files:
    exclude:
    - usr/share/man
    - usr/share/doc/*/README.*
    - usr/share/doc/*/changelog.*
    - usr/share/doc/*/NEWS.*
    - usr/share/doc/*/TODO.*
#  test:
#    fedora:
#      image: appimagecrafters/tests-env:fedora-30
#      command: ./AppRun
#      use_host_x: true
#    debian:
#      image: appimagecrafters/tests-env:debian-stable
#      command: ./AppRun
#      use_host_x: true
#    arch:
#      image: appimagecrafters/tests-env:archlinux-latest
#      command: ./AppRun
#      use_host_x: true
#    centos:
#      image: appimagecrafters/tests-env:centos-7
#      command: ./AppRun
#      use_host_x: true
#    ubuntu:
#      image: appimagecrafters/tests-env:ubuntu-xenial
#      command: ./AppRun
#      use_host_x: true
AppImage:
  arch: x86_64
  update-information: None
  sign-key: None
stsichler commented 4 years ago

Argh! It was the minus sign '-' that I was missing. Thank you!!!

You can close this issue if you want to.

azubieta commented 4 years ago

Great, I'll work on the yml validation step.