Skip to content

AppImage fails to launch on Linux with kernel 6.x: squashfuse memory allocation error + wrong sync-exclude.lst path #1585

@swaden10

Description

@swaden10

AppImage fails to launch on Linux with kernel 6.x: squashfuse memory allocation error + wrong sync-exclude.lst path

kDrive version: 3.7.9.1 and 3.7.10.1 (both affected)
OS: Manjaro Linux (also likely affects Arch and other rolling-release distros)
Kernel: 6.18.8-1-MANJARO
Architecture: x86_64
AppImage type: Type 2 (ELF + squashfs at offset 0xe69f8)


Summary

The kDrive AppImage fails to launch on recent Linux kernels with two distinct but related bugs:

  1. The bundled squashfuse (0.5.2) fails with a memory allocation error on kernel 6.x, making the AppImage unmountable via the normal launch path.
  2. Even when the AppImage is mounted manually using the system squashfuse (0.6.1), the server fails to initialize because it looks for sync-exclude.lst at the wrong path.

Bug 1: Bundled squashfuse fails on kernel 6.x

Steps to reproduce

QT_QPA_PLATFORM=xcb ./kDrive-3.7.9.1-amd64.AppImage

Error output

fuse: memory allocation failed
squashfuse 0.5.2 (c) 2012 Dave Vasilevsky
...
Cannot mount AppImage, please check your FUSE setup.

Cause

The AppImage bundles squashfuse 0.5.2, which fails to allocate memory when mounting the squashfs payload on kernel 6.x. The system squashfuse 0.6.1 does not have this issue.

The workaround environment variable APPIMAGE_EXTRACT_AND_RUN=1 does not help — it also fails because it relies on the same bundled squashfuse.

Workaround

Mount the squashfs manually using the system squashfuse, then run the correct binary (see Bug 2 below):

# Find the squashfs offset
python3 -c "
data = open('./kDrive-3.7.9.1-amd64.AppImage', 'rb').read()
magic = b'hsqs'
pos = 0
while True:
    pos = data.find(magic, pos)
    if pos == -1: break
    print(f'offset: {pos} (0x{pos:x})')
    pos += 1
"
# Use the second offset (the first is a false positive with wrong squashfs version)
# Example output: offset 944632 (0xe69f8)

mkdir -p /tmp/kdrive-mount
squashfuse -o offset=944632 ./kDrive-3.7.9.1-amd64.AppImage /tmp/kdrive-mount

Fix

Update the bundled squashfuse to 0.6.x, or use the --appimage-extract-and-run runtime that calls the system squashfuse when available.


Bug 2: Server fails with "Unable to initialize ParmsDb" due to wrong sync-exclude.lst path

Steps to reproduce

After mounting manually as above:

QT_QPA_PLATFORM=xcb /tmp/kdrive-mount/AppRun

Error output

kDrive server starting
sentry_init returned 1
kDrive server initialization error: Unable to initialize ParmsDb.

Cause

Inspection of the log at /tmp/kDrive-logdir/ reveals:

Cannot open exclusion templates file name='/tmp/kdrive-mount/sync-exclude.lst'
Error in updateExclusionTemplates
Error in initParameters
Error in Db::prepare

The server binary looks for sync-exclude.lst at the root of the AppImage mount, but the file actually exists at two locations inside the AppImage:

  • /tmp/kdrive-mount/kDrive/sync-exclude.lst
  • /tmp/kdrive-mount/usr/bin/sync-exclude.lst

When the AppImage is launched normally via its own squashfuse runtime, AppRun.wrapped presumably sets up the environment so the path resolves correctly. When this mechanism breaks (due to Bug 1), the fallback path is wrong.

Workaround

Run the server binary directly instead of via AppRun, with APPDIR set explicitly:

APPDIR=/tmp/kdrive-mount QT_QPA_PLATFORM=xcb /tmp/kdrive-mount/usr/bin/kDrive

Fix

The server binary should resolve sync-exclude.lst relative to its own location (usr/bin/), not relative to the AppImage root. Alternatively, AppRun.wrapped should set APPDIR or an equivalent environment variable so the path is always correct regardless of how the binary is invoked.


Additional notes

  • sentry_init returned 1 appears on every launch but seems harmless.
  • QT_QPA_PLATFORM=xcb must be set explicitly, otherwise Qt may fail to find a platform plugin depending on the desktop environment.
  • Both 3.7.9.1 and 3.7.10.1 are affected identically.

Complete working wrapper script

#!/bin/bash
APPIMAGE="/path/to/kDrive-3.7.9.1-amd64.AppImage"
MOUNTPOINT="/tmp/kdrive-mount"

if ! mountpoint -q "$MOUNTPOINT"; then
    mkdir -p "$MOUNTPOINT"
    squashfuse -o offset=944632 "$APPIMAGE" "$MOUNTPOINT"
fi

APPDIR="$MOUNTPOINT" QT_QPA_PLATFORM=xcb "$MOUNTPOINT/usr/bin/kDrive" "$@"

We need you to enable "Extended Full Log" in "Debugging information"
Please note that the name of your files will appear in this log.
Unnecessary, error output and fix are provided.

Additional context
Written by AI but modified, tested and proofread by me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions