🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.debian.bugs.dist
2 messages
2 total messages Started by tamila Sun, 29 Nov 2026 18:10
Bug#1155833: flatpak: intermittent "invalid merge-dirs" error
#6775
Author: tamila
Date: Sun, 29 Nov 2026 18:10
106 lines
5464 bytes
Package: flatpak
Version: 1.16.6-1~deb13u3
Severity: important
Tags: patch trixie

Dear Maintainer,

since the security backport for GHSA-w69g-9x8j-7p8f (1.16.6-1~deb13u2,
d/p/GHSA-w69g-9x8j-7p8f/run-Use-RESOLVE_BENEATH-for-host-side-extension-file-acce.patch)
`flatpak run` sometimes fails right at the start of a desktop session 
with:

     error: Extension org.freedesktop.Platform.GL.default has invalid 
merge-dirs

The app is not started. Running the very same command again a bit later
works fine. Nothing in the installation changes between a failing and a
working run.

* System

   - Debian 13 (trixie), aarch64 (Raspberry Pi 4), kernel 
6.18.60+rpt-rpi-v8
   - flatpak 1.16.6-1~deb13u3 (system installation)
   - App: io.github.qtox.qTox 1.18.6, runtime org.kde.Platform 6.10
   - Extension: org.freedesktop.Platform.GL.default, branches 25.08 and
     25.08-extra
   - XFCE session with LightDM autologin; the app is started from
     ~/.config/autostart/*.desktop with `Exec=flatpak run 
io.github.qtox.qTox`
   - The machine reboots daily at 04:00, so the app is autostarted once a 
day

* Observed frequency

   The autostart failed on 2 of the last 7 boots (2026-11-27 and
   2026-11-29); on the other 5 boots the app started normally. On
   2026-11-29 the error above is in ~/.xsession-errors; a manual start of
   the same command later that day succeeded.

* Analysis

   The message comes from the backported hunk in
   flatpak_run_add_extension_args() (common/flatpak-run.c):

       source_dfd = glnx_chaseat (files_dfd, ext->merge_dirs[i],
                                  GLNX_CHASE_RESOLVE_BENEATH |
                                  GLNX_CHASE_MUST_BE_DIRECTORY, NULL);
       if (source_dfd < 0)
         {
           if (errno == ENOENT || errno == ENOTDIR)
             continue;
           return flatpak_fail_error (error, FLATPAK_ERROR,
                                      "Extension %s has invalid 
merge-dirs", ...);
         }

   glnx_chaseat() in the bundled subprojects/libglnx/glnx-chase.c calls
   openat2() with RESOLVE_BENEATH and treats every error except
   ENOSYS/EPERM as fatal. openat2(2) documents that with RESOLVE_BENEATH
   it may return EAGAIN if a rename or mount happened concurrently while 
a
   ".." component was being resolved, and that the caller may retry.

   The GL extension does contain such ".." symlinks inside merge-dirs,
   e.g. in both branches:

       vulkan/icd.d            -> ../lib/vulkan/icd.d
       vulkan/explicit_layer.d -> ../share/vulkan/explicit_layer.d
       vulkan/implicit_layer.d -> ../share/vulkan/implicit_layer.d

   At session start several mounts happen at the same time (for example
   the document portal FUSE mount /run/user/1000/doc is set up by
   xdg-document-portal, which is activated by this very `flatpak run`),
   so a spurious EAGAIN is plausible. I could not capture the actual 
errno
   (flatpak does not log it), but EAGAIN is the only error in this code
   path that is transient; all other ones would make every start fail.

* Upstream fix

   libglnx already fixed this:

       commit eef7f14c344723cb20bebd04dcc79be77363c3be
       "chase: Handle EAGAIN from openat2" (2026-08-18)
       
https://gitlab.gnome.org/GNOME/libglnx/-/commit/eef7f14c344723cb20bebd04dcc79be77363c3be

   It simply retries openat2() while it returns EAGAIN. This commit is
   not in 1.16.6-1~deb13u3, and judging by debian/patches/series it is
   not in 1.16.6-1~deb13u4 either.

* Request

   Please consider adding this libglnx commit to the next trixie update
   of flatpak, next to the already backported
   d/p/libglnx/chase-*.patch.

* Workaround

   Delaying the autostart and retrying once, e.g.

       Exec=sh -c "sleep 15; flatpak run io.github.qtox.qTox || { sleep 
30; flatpak run io.github.qtox.qTox; }"

Thank you!
Bug#1155833: flatpak: intermittent "invalid merge-dirs" error
#6868
Author: Simon McVittie
Date: Mon, 30 Nov 2026 13:40
22 lines
2698 bytes
On Sun, 29 Nov 2026 at 18:00:50 +0000, tamila@extmail.info wrote:
>since the security backport for GHSA-w69g-9x8j-7p8f (1.16.6-1~deb13u2,
>d/p/GHSA-w69g-9x8j-7p8f/run-Use-RESOLVE_BENEATH-for-host-side-extension-file-acce.patch)
>`flatpak run` sometimes fails right at the start of a desktop session

Please try the test-build in 
<https://people.debian.org/~smcv/13.9/flatpak-bug1155833/> which 
includes the patch to retry on EAGAIN.

For an arm64 system, you will need to rebuild 
flatpak_1.16.6-1~deb13u5~1~deb13u4+4+gaa552ae01.dsc from source. 
Unfortunately it isn't straightforward to cross-compile this particular 
package without making changes that are too intrusive for the stable 
release managers to accept, so I was not able to provide arm64 binaries.

>  Please consider adding this libglnx commit to the next trixie update
>  of flatpak

This will require permission from the stable release managers, so it's 
likely to take some time.

     smcv
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads