Hi,

This is a follow-up with a debdiff and some test results.

Attached is a debdiff against 25.0.7-2+deb13u1. It only adds the
upstream commit d1a6be75db94, the line in debian/patches/series
and a changelog entry. The patch applies without fuzz after the
CVE-2026-40393 patches. Version 25.0.7-2+deb13u2 is only a suggestion.

I built it on trixie amd64 (dpkg-buildpackage -b, nocheck) and have
been running it since 29 September on the same ThinkPad T14
(Radeon 840M/860M, Plasma 6.3.6 Wayland). Since then I have plugged
and unplugged the USB-C monitor almost every working day (about 35
times), with no plasmashell hang and no regression. Since the race
depends on timing, this doesn't prove the fix by itself. The core
dump analysis in the first message does.

For reference, the same hang (same stack, util_queue_finish() waiting
at u_queue.c:722) has been reported several times upstream on Mesa
older than 25.3, without being linked to this fix:
  https://gitlab.freedesktop.org/mesa/mesa/-/work_items/14257
  https://bugs.kde.org/show_bug.cgi?id=507936
  https://bugs.kde.org/show_bug.cgi?id=513552

trixie-backports (26.1.6-1~bpo13+1) and unstable have the fix, so
only trixie itself is affected. It would be nice to have it in a
point release.

I used an AI assistant (Claude) to help analyse the backtraces, prepare the
debdiff and draft this message. I reviewed everything, and the backtraces
and test results come from my own machine.

Thanks,
Romain Reignier



September 29, 2026 at 1:51 PM, "Debian Bug Tracking System" 
<[email protected] 
mailto:[email protected]?to=%22Debian%20Bug%20Tracking%20System%22%20%3Cowner%40bugs.debian.org%3E
 > wrote:


> 
> Thank you for filing a new Bug report with Debian.
> 
> You can follow progress on this Bug here: 1149313: 
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1149313.
> 
> This is an automatically generated reply to let you know your message
> has been received.
> 
> Your message is being forwarded to the package maintainers and other
> interested parties for their attention; they will reply in due course.
> 
> Your message has been sent to the package maintainer(s):
>  [email protected] mailto:[email protected] 
> 
> If you wish to submit further information on this problem, please
> send it to [email protected].
> 
> Please do not send mail to [email protected] unless you wish
> to report a problem with the Bug-tracking system.
> 
> -- 
> 1149313: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1149313
> Debian Bug Tracking System
> Contact [email protected] with problems
>
diff -Nru mesa-25.0.7/debian/changelog mesa-25.0.7/debian/changelog
--- mesa-25.0.7/debian/changelog        2026-06-19 21:20:06.000000000 +0200
+++ mesa-25.0.7/debian/changelog        2026-09-29 14:12:19.000000000 +0200
@@ -1,3 +1,12 @@
+mesa (25.0.7-2+deb13u2) trixie; urgency=medium
+
+  * Backport upstream commit d1a6be75db94 to fix a data race on
+    num_threads in util_queue_finish(), causing a radeonsi deadlock with
+    100% CPU on context destroy (upstream #13738).
+    (Closes: #1149313)
+
+ -- Romain Reignier <[email protected]>  Tue, 29 Sep 2026 14:12:19 +0200
+
 mesa (25.0.7-2+deb13u1) trixie; urgency=high
 
   * Non-maintainer upload by the LTS Team.
diff -Nru mesa-25.0.7/debian/patches/series mesa-25.0.7/debian/patches/series
--- mesa-25.0.7/debian/patches/series   2026-06-19 21:20:06.000000000 +0200
+++ mesa-25.0.7/debian/patches/series   2026-09-29 14:12:19.000000000 +0200
@@ -7,3 +7,4 @@
 backport_STACK_ARRAY.patch
 CVE-2026-40393-part1.patch
 CVE-2026-40393-part2.patch
+util-u_queue-fix-data-race-on-num_threads-during-finish.patch
diff -Nru 
mesa-25.0.7/debian/patches/util-u_queue-fix-data-race-on-num_threads-during-finish.patch
 
mesa-25.0.7/debian/patches/util-u_queue-fix-data-race-on-num_threads-during-finish.patch
--- 
mesa-25.0.7/debian/patches/util-u_queue-fix-data-race-on-num_threads-during-finish.patch
    1970-01-01 01:00:00.000000000 +0100
+++ 
mesa-25.0.7/debian/patches/util-u_queue-fix-data-race-on-num_threads-during-finish.patch
    2026-09-29 14:12:19.000000000 +0200
@@ -0,0 +1,37 @@
+From: Emma Anholt <[email protected]>
+Date: Thu, 21 Aug 2025 11:20:48 -0700
+Subject: util/u_queue: Fix data race on num_threads during finish.
+
+This should fix a deadlock I saw on
+dEQP-EGL.functional.sharing.gles2.multithread.random.programs.link.7 on
+radeonsi, where we were waiting on an invalid fence[1] value.  This was
+probably because between when we started setting up the fences for
+u_queue_finish and when we waited on those fences, a second thread was
+created.
+
+Origin: upstream, 
https://gitlab.freedesktop.org/mesa/mesa/-/commit/d1a6be75db949477b45748c2e93a7199cadec212
+Applied-Upstream: 25.3.0
+Bug: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13738
+Bug-Debian: https://bugs.debian.org/1149313
+---
+diff --git a/src/util/u_queue.c b/src/util/u_queue.c
+index 026e1582a22..1ccf4af1ad8 100644
+--- a/src/util/u_queue.c
++++ b/src/util/u_queue.c
+@@ -708,6 +708,7 @@ util_queue_finish(struct util_queue *queue)
+    queue->create_threads_on_demand = false;
+ 
+    fences = malloc(queue->num_threads * sizeof(*fences));
++   unsigned num_fences = queue->num_threads;
+    util_barrier_init(&barrier, queue->num_threads);
+ 
+    for (unsigned i = 0; i < queue->num_threads; ++i) {
+@@ -718,7 +719,7 @@ util_queue_finish(struct util_queue *queue)
+    queue->create_threads_on_demand = true;
+    mtx_unlock(&queue->lock);
+ 
+-   for (unsigned i = 0; i < queue->num_threads; ++i) {
++   for (unsigned i = 0; i < num_fences; ++i) {
+       util_queue_fence_wait(&fences[i]);
+       util_queue_fence_destroy(&fences[i]);
+    }

Reply via email to