** Description changed:

+ [ Impact ]
+ 
+ Handling multiple files with xdg-document-portal can cause it to
+ deadlock.
+ 
+ For example, selecting hundreds of files in the Firefox snap may
+ deadlock xdg-document-portal causing uploads to time out and other
+ portal operations to hang.
+ 
+ The upstream fix isolates the helper's main context and narrows document
+ database locking.
+ 
+ [ Test Plan ]
+ 
+ The test suite is updated to verify the fix.
+ autopkgtests will verify the fix as well as other regression testing.
+ 
+ Here follows a manual test plan as well:
+ 
+ 1. Install xdg-desktop-portal from -proposed and log out/in.
+ 2. In the Firefox snap, paste this into the address bar:
+ 
+    data:text/html,%3Cinput%20type%3D%22file%22%20multiple%3E
+ 
+ 2. Click the file picker and select hundreds of test images.
+ 3. Verify that webpage updates with the number of selected files
+    (this may take a while)
+ 4. Repeat the selection several times. Confirm Firefox shows
+    the correct selected file count without portal timeouts,
+    and subsequent selections still work.
+ 5. Check single-file selection and confirm
+    `systemctl --user stop xdg-document-portal` completes promptly.
+ 
+ [ Where problems could occur ]
+ 
+ Changes affect helper process execution and document registration
+ locking. Regressions could cause failed file registration, selected
+ files becoming inaccessible to sandboxed applications, or portal
+ hangs. Check both single-file and bulk selections.
+ 
+ [ Original description ]
+ 
  When attempting a bulk file upload (e.g. 600+ images) via a sandboxed
  application such as Snap Firefox, `xdg-document-portal` encounters a
  **self-deadlock on a non-recursive mutex (`db`) triggered by nested
  event loop reentrancy**.
  
  This frozen state causes:
  1. All file registration requests to block indefinitely until the 25-second 
D-Bus timeout expires (`Failed to register <uri>: Timeout was reached`).
  2. Indefinite leakage of file descriptors in `xdg-document-portal` because 
pending `GDBusMethodInvocation` instances are never completed or unreferenced.
  3. Total failure of `SIGTERM` signal handling (`systemctl --user stop 
xdg-document-portal` hangs) because signal callbacks are dispatched via the 
event loop, while the main thread is suspended in a kernel futex wait.
  4. Cascading unresponsiveness and crashes of Wayland clients (e.g., Google 
Chrome crashing with `SIGSEGV` in Ozone-Wayland) due to D-Bus starvation when 
`xdg-desktop-portal` blocks during initialization while querying 
`org.freedesktop.portal.Documents`.
  
  Please consider backporting the fixes from
  https://github.com/flatpak/xdg-desktop-portal/pull/2134 to actively
  maintained Ubuntu branches.
  
  ProblemType: Bug
  DistroRelease: Ubuntu 26.04
  Package: xdg-desktop-portal 1.21.1+ds-1ubuntu3
  ProcVersionSignature: Ubuntu 7.0.0-30.30-generic 7.0.12
  Uname: Linux 7.0.0-30-generic x86_64
  ApportVersion: 2.34.1-0ubuntu0.1
  Architecture: amd64
  CasperMD5CheckResult: pass
  CurrentDesktop: ubuntu:GNOME
  Date: Mon Sep  7 19:42:52 2026
  InstallationDate: Installed on 2025-12-02 (280 days ago)
  InstallationMedia: Ubuntu 25.10 "Questing Quokka" - Release amd64 (20251007)
  ProcEnviron:
-  LANG=en_US.UTF-8
-  PATH=(custom, no user)
-  SHELL=/usr/bin/fish
-  TERM=tmux-256color
-  XDG_RUNTIME_DIR=<set>
+  LANG=en_US.UTF-8
+  PATH=(custom, no user)
+  SHELL=/usr/bin/fish
+  TERM=tmux-256color
+  XDG_RUNTIME_DIR=<set>
  RebootRequiredPkgs: Error: path contained symlinks.
  SourcePackage: xdg-desktop-portal
  UpgradeStatus: Upgraded to resolute on 2026-05-14 (116 days ago)

** Description changed:

  [ Impact ]
  
  Handling multiple files with xdg-document-portal can cause it to
  deadlock.
  
  For example, selecting hundreds of files in the Firefox snap may
  deadlock xdg-document-portal causing uploads to time out and other
  portal operations to hang.
  
  The upstream fix isolates the helper's main context and narrows document
  database locking.
  
  [ Test Plan ]
  
  The test suite is updated to verify the fix.
  autopkgtests will verify the fix as well as other regression testing.
  
  Here follows a manual test plan as well:
  
  1. Install xdg-desktop-portal from -proposed and log out/in.
  2. In the Firefox snap, paste this into the address bar:
  
-    data:text/html,%3Cinput%20type%3D%22file%22%20multiple%3E
+    data:text/html,%3Cinput%20type%3D%22file%22%20multiple%3E
  
- 2. Click the file picker and select hundreds of test images.
+ 2. Click the file picker and select hundreds of test files.
  3. Verify that webpage updates with the number of selected files
-    (this may take a while)
+    (this may take a while)
  4. Repeat the selection several times. Confirm Firefox shows
-    the correct selected file count without portal timeouts,
-    and subsequent selections still work.
+    the correct selected file count without portal timeouts,
+    and subsequent selections still work.
  5. Check single-file selection and confirm
-    `systemctl --user stop xdg-document-portal` completes promptly.
+    `systemctl --user stop xdg-document-portal` completes promptly.
  
  [ Where problems could occur ]
  
  Changes affect helper process execution and document registration
  locking. Regressions could cause failed file registration, selected
  files becoming inaccessible to sandboxed applications, or portal
  hangs. Check both single-file and bulk selections.
  
  [ Original description ]
  
  When attempting a bulk file upload (e.g. 600+ images) via a sandboxed
  application such as Snap Firefox, `xdg-document-portal` encounters a
  **self-deadlock on a non-recursive mutex (`db`) triggered by nested
  event loop reentrancy**.
  
  This frozen state causes:
  1. All file registration requests to block indefinitely until the 25-second 
D-Bus timeout expires (`Failed to register <uri>: Timeout was reached`).
  2. Indefinite leakage of file descriptors in `xdg-document-portal` because 
pending `GDBusMethodInvocation` instances are never completed or unreferenced.
  3. Total failure of `SIGTERM` signal handling (`systemctl --user stop 
xdg-document-portal` hangs) because signal callbacks are dispatched via the 
event loop, while the main thread is suspended in a kernel futex wait.
  4. Cascading unresponsiveness and crashes of Wayland clients (e.g., Google 
Chrome crashing with `SIGSEGV` in Ozone-Wayland) due to D-Bus starvation when 
`xdg-desktop-portal` blocks during initialization while querying 
`org.freedesktop.portal.Documents`.
  
  Please consider backporting the fixes from
  https://github.com/flatpak/xdg-desktop-portal/pull/2134 to actively
  maintained Ubuntu branches.
  
  ProblemType: Bug
  DistroRelease: Ubuntu 26.04
  Package: xdg-desktop-portal 1.21.1+ds-1ubuntu3
  ProcVersionSignature: Ubuntu 7.0.0-30.30-generic 7.0.12
  Uname: Linux 7.0.0-30-generic x86_64
  ApportVersion: 2.34.1-0ubuntu0.1
  Architecture: amd64
  CasperMD5CheckResult: pass
  CurrentDesktop: ubuntu:GNOME
  Date: Mon Sep  7 19:42:52 2026
  InstallationDate: Installed on 2025-12-02 (280 days ago)
  InstallationMedia: Ubuntu 25.10 "Questing Quokka" - Release amd64 (20251007)
  ProcEnviron:
   LANG=en_US.UTF-8
   PATH=(custom, no user)
   SHELL=/usr/bin/fish
   TERM=tmux-256color
   XDG_RUNTIME_DIR=<set>
  RebootRequiredPkgs: Error: path contained symlinks.
  SourcePackage: xdg-desktop-portal
  UpgradeStatus: Upgraded to resolute on 2026-05-14 (116 days ago)

** Description changed:

  [ Impact ]
  
- Handling multiple files with xdg-document-portal can cause it to
+ Handling multiple files in parallel with xdg-document-portal can cause it to
  deadlock.
  
  For example, selecting hundreds of files in the Firefox snap may
  deadlock xdg-document-portal causing uploads to time out and other
  portal operations to hang.
  
  The upstream fix isolates the helper's main context and narrows document
  database locking.
  
  [ Test Plan ]
  
  The test suite is updated to verify the fix.
  autopkgtests will verify the fix as well as other regression testing.
  
  Here follows a manual test plan as well:
  
  1. Install xdg-desktop-portal from -proposed and log out/in.
  2. In the Firefox snap, paste this into the address bar:
  
     data:text/html,%3Cinput%20type%3D%22file%22%20multiple%3E
  
  2. Click the file picker and select hundreds of test files.
  3. Verify that webpage updates with the number of selected files
     (this may take a while)
  4. Repeat the selection several times. Confirm Firefox shows
     the correct selected file count without portal timeouts,
     and subsequent selections still work.
  5. Check single-file selection and confirm
     `systemctl --user stop xdg-document-portal` completes promptly.
  
  [ Where problems could occur ]
  
  Changes affect helper process execution and document registration
  locking. Regressions could cause failed file registration, selected
  files becoming inaccessible to sandboxed applications, or portal
  hangs. Check both single-file and bulk selections.
  
  [ Original description ]
  
  When attempting a bulk file upload (e.g. 600+ images) via a sandboxed
  application such as Snap Firefox, `xdg-document-portal` encounters a
  **self-deadlock on a non-recursive mutex (`db`) triggered by nested
  event loop reentrancy**.
  
  This frozen state causes:
  1. All file registration requests to block indefinitely until the 25-second 
D-Bus timeout expires (`Failed to register <uri>: Timeout was reached`).
  2. Indefinite leakage of file descriptors in `xdg-document-portal` because 
pending `GDBusMethodInvocation` instances are never completed or unreferenced.
  3. Total failure of `SIGTERM` signal handling (`systemctl --user stop 
xdg-document-portal` hangs) because signal callbacks are dispatched via the 
event loop, while the main thread is suspended in a kernel futex wait.
  4. Cascading unresponsiveness and crashes of Wayland clients (e.g., Google 
Chrome crashing with `SIGSEGV` in Ozone-Wayland) due to D-Bus starvation when 
`xdg-desktop-portal` blocks during initialization while querying 
`org.freedesktop.portal.Documents`.
  
  Please consider backporting the fixes from
  https://github.com/flatpak/xdg-desktop-portal/pull/2134 to actively
  maintained Ubuntu branches.
  
  ProblemType: Bug
  DistroRelease: Ubuntu 26.04
  Package: xdg-desktop-portal 1.21.1+ds-1ubuntu3
  ProcVersionSignature: Ubuntu 7.0.0-30.30-generic 7.0.12
  Uname: Linux 7.0.0-30-generic x86_64
  ApportVersion: 2.34.1-0ubuntu0.1
  Architecture: amd64
  CasperMD5CheckResult: pass
  CurrentDesktop: ubuntu:GNOME
  Date: Mon Sep  7 19:42:52 2026
  InstallationDate: Installed on 2025-12-02 (280 days ago)
  InstallationMedia: Ubuntu 25.10 "Questing Quokka" - Release amd64 (20251007)
  ProcEnviron:
   LANG=en_US.UTF-8
   PATH=(custom, no user)
   SHELL=/usr/bin/fish
   TERM=tmux-256color
   XDG_RUNTIME_DIR=<set>
  RebootRequiredPkgs: Error: path contained symlinks.
  SourcePackage: xdg-desktop-portal
  UpgradeStatus: Upgraded to resolute on 2026-05-14 (116 days ago)

** Description changed:

  [ Impact ]
  
  Handling multiple files in parallel with xdg-document-portal can cause it to
  deadlock.
  
  For example, selecting hundreds of files in the Firefox snap may
  deadlock xdg-document-portal causing uploads to time out and other
  portal operations to hang.
  
  The upstream fix isolates the helper's main context and narrows document
  database locking.
  
  [ Test Plan ]
  
  The test suite is updated to verify the fix.
  autopkgtests will verify the fix as well as other regression testing.
  
  Here follows a manual test plan as well:
  
  1. Install xdg-desktop-portal from -proposed and log out/in.
  2. In the Firefox snap, paste this into the address bar:
  
     data:text/html,%3Cinput%20type%3D%22file%22%20multiple%3E
  
  2. Click the file picker and select hundreds of test files.
  3. Verify that webpage updates with the number of selected files
     (this may take a while)
  4. Repeat the selection several times. Confirm Firefox shows
     the correct selected file count without portal timeouts,
     and subsequent selections still work.
- 5. Check single-file selection and confirm
+ 5. Check single-file selection
+ 6. Confirm that
     `systemctl --user stop xdg-document-portal` completes promptly.
  
  [ Where problems could occur ]
  
  Changes affect helper process execution and document registration
  locking. Regressions could cause failed file registration, selected
  files becoming inaccessible to sandboxed applications, or portal
  hangs. Check both single-file and bulk selections.
  
  [ Original description ]
  
  When attempting a bulk file upload (e.g. 600+ images) via a sandboxed
  application such as Snap Firefox, `xdg-document-portal` encounters a
  **self-deadlock on a non-recursive mutex (`db`) triggered by nested
  event loop reentrancy**.
  
  This frozen state causes:
  1. All file registration requests to block indefinitely until the 25-second 
D-Bus timeout expires (`Failed to register <uri>: Timeout was reached`).
  2. Indefinite leakage of file descriptors in `xdg-document-portal` because 
pending `GDBusMethodInvocation` instances are never completed or unreferenced.
  3. Total failure of `SIGTERM` signal handling (`systemctl --user stop 
xdg-document-portal` hangs) because signal callbacks are dispatched via the 
event loop, while the main thread is suspended in a kernel futex wait.
  4. Cascading unresponsiveness and crashes of Wayland clients (e.g., Google 
Chrome crashing with `SIGSEGV` in Ozone-Wayland) due to D-Bus starvation when 
`xdg-desktop-portal` blocks during initialization while querying 
`org.freedesktop.portal.Documents`.
  
  Please consider backporting the fixes from
  https://github.com/flatpak/xdg-desktop-portal/pull/2134 to actively
  maintained Ubuntu branches.
  
  ProblemType: Bug
  DistroRelease: Ubuntu 26.04
  Package: xdg-desktop-portal 1.21.1+ds-1ubuntu3
  ProcVersionSignature: Ubuntu 7.0.0-30.30-generic 7.0.12
  Uname: Linux 7.0.0-30-generic x86_64
  ApportVersion: 2.34.1-0ubuntu0.1
  Architecture: amd64
  CasperMD5CheckResult: pass
  CurrentDesktop: ubuntu:GNOME
  Date: Mon Sep  7 19:42:52 2026
  InstallationDate: Installed on 2025-12-02 (280 days ago)
  InstallationMedia: Ubuntu 25.10 "Questing Quokka" - Release amd64 (20251007)
  ProcEnviron:
   LANG=en_US.UTF-8
   PATH=(custom, no user)
   SHELL=/usr/bin/fish
   TERM=tmux-256color
   XDG_RUNTIME_DIR=<set>
  RebootRequiredPkgs: Error: path contained symlinks.
  SourcePackage: xdg-desktop-portal
  UpgradeStatus: Upgraded to resolute on 2026-05-14 (116 days ago)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2166726

Title:
  xdg-desktop-portal deadlocks when selecting many files in snap Firefox

To manage notifications about this bug go to:
https://bugs.launchpad.net/xdg-desktop-portal/+bug/2166726/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to