[From nobody Wed Nov 11 18:35:06 2026
Received: (at submit) by bugs.debian.org; 25 Oct 2026 20:01:38 +0000
X-Spam-Checker-Version: SpamAssassin 4.0.1-bugs.debian.org_2005_01_02
 (2024-03-25) on buxtehude.debian.org
X-Spam-Level: 
X-Spam-Status: No, score=-119.4 required=4.0 tests=ALL_TRUSTED,BAYES_00,
 BODY_INCLUDES_PACKAGE,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,
 DKIM_VALID_AU,DKIM_VALID_EF,FOURLA,FROMDEVELOPER,HAS_PACKAGE,
 MD5_SHA1_SUM,SPF_HELO_NONE,SPF_PASS,USER_IN_DKIM_WELCOMELIST
 autolearn=ham autolearn_force=no
 version=4.0.1-bugs.debian.org_2005_01_02
X-Spam-Bayes: score:0.0000 Tokens: new, 28; hammy, 150; neutral, 208; spammy,
 0. spammytokens:
 hammytokens:0.000-+--Hx-spam-relays-external:sk:stravin,
 0.000-+--H*RT:sk:stravin, 0.000-+--Hx-spam-relays-external:311,
 0.000-+--H*RT:311, 0.000-+--H*RT:108
Return-path: &lt;sthibault@debian.org&gt;
Received: from stravinsky.debian.org ([2001:41b8:202:deb::311:108]:44126)
 by buxtehude.debian.org with esmtps
 (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)
 (Exim 4.96) (envelope-from &lt;sthibault@debian.org&gt;)
 id 1xL4PT-004zoG-0y for submit@bugs.debian.org;
 Sun, 25 Oct 2026 20:01:38 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; 
 s=smtpauto.stravinsky;
 h=X-Debian-User:Content-Type:MIME-Version:Message-ID:
 Subject:To:From:Date:Reply-To:Cc:Content-Transfer-Encoding:Content-ID:
 Content-Description:In-Reply-To:References;
 bh=U+t8K2oWATtPZYYj5Q7dO7QEH+qn0X8UeFYIDcZMmPE=; b=HhZr6n9PF9UHEu8BdKLCu8pe/R
 t2DAZPI+8h5A7Oiwt4P74PDj1OVaeiqXylbrkOf+IQdZCZoFgJ1PPHgksArJ8tH6+g9dsmv9lQdpo
 HLTPdd0t5tV6E10NQdCD8ftTwZSxfs0a/IbTrshyNCgIQYvcmdDmgUCmco45vHU1CpWZ/vMOBnDZs
 +XqC2JCJoHQruAzTYMCM20lQ9g23TOCfM8iHmtywSvKosiDj96Ss1eUC9gsvVI7ZCp3vxVHnbYu16
 DeZb7UW0UghLCX01+1R0vPD1qlVz0slv01oC4fSUubHKhxMp3COGAAsiFe0o5fh1/W1/wjfWRR+tg
 r8aorEdg==;
Received: from authenticated-user by stravinsky.debian.org with esmtpsa
 (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)
 (Exim 4.96) (envelope-from &lt;sthibault@debian.org&gt;)
 id 1xL4PR-0009VR-0L for submit@bugs.debian.org;
 Sun, 25 Oct 2026 20:01:37 +0000
Received: from samy by end with local (Exim 4.100.1)
 (envelope-from &lt;sthibault@debian.org&gt;) id 1xL4PP-00000008Fg7-1vSj
 for submit@bugs.debian.org; Sun, 25 Oct 2026 21:01:35 +0100
Date: Sun, 25 Oct 2026 21:01:35 +0100
From: Samuel Thibault &lt;sthibault@debian.org&gt;
To: Debian Bug Tracking System &lt;submit@bugs.debian.org&gt;
Subject: rustc: Fix test_rwlock_max_readers hanging on non-linux 32b archs
Message-ID: &lt;at5gH8Gopu9oHx0K@end&gt;
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=&quot;JmQjSSKDWhJ6FPFg&quot;
Content-Disposition: inline
X-Reportbug-Version: 13.2.0+nmu1
Organization: I am not organized
X-Debian-User: sthibault
Delivered-To: submit@bugs.debian.org

--JmQjSSKDWhJ6FPFg
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Package: rustc
Version: 1.97.1+dfsg1-1
Severity: important
Tags: patch upstream
Forwarded: https://github.com/rust-lang/rust/pull/164764

Hello,

test_rwlock_max_readers currently hangs on non-linux 32b archs, making
the build get stuck on hurd-i386, the attached patch was applied
upstream to fix this, could you apply it?

Thanks,
Samuel

-- System Information:
Debian Release: forky/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable-debug'), (500, 'testing-debug'), (500, 'stable-security'), (500, 'stable-debug'), (500, 'proposed-updates'), (500, 'oldstable-debug'), (500, 'oldoldstable'), (500, 'buildd-unstable'), (500, 'unstable'), (500, 'stable'), (500, 'oldstable'), (1, 'experimental-debug'), (1, 'buildd-experimental'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, arm64

Kernel: Linux 7.2.9+deb14-amd64 (SMP w/22 CPU threads; PREEMPT)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages rustc depends on:
ii  binutils              2.47-6
ii  gcc                   4:16.1.0-3
ii  libc6                 2.43-7
ii  libc6-dev [libc-dev]  2.43-7
ii  libgcc-s1             16.2.0-3
ii  libstd-rust-dev       1.97.1+dfsg1-1

Versions of packages rustc recommends:
ii  cargo      1.97.1+dfsg1-1
ii  rust-llvm  1.97.1+dfsg1-1

rustc suggests no packages.

-- no debconf information

-- 
Samuel
&quot;I don't know why, but first C programs tend to look a lot worse than
first programs in any other language (maybe except for fortran, but then
I suspect all fortran programs look like `firsts')&quot;
(By Olaf Kirch)

--JmQjSSKDWhJ6FPFg
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=patch

commit dfa3e66f7344e39da3bd6c9c58acb14ebd286db1
Author: Samuel Thibault &lt;samuel.thibault@ens-lyon.org&gt;
Date:   Sun Oct 25 04:50:40 2026 +0000

    Test(lib/sync): Fix `test_rwlock_max_readers` for 32bit architectures
    
    * Test(lib/sync): Fix `test_rwlock_max_readers` for 32bit architectures
    
    962e9e2aab0d (&quot;Fix `test_rwlock_max_readers` for x86 Win7&quot;) detected the
    issue but fixed it only for windows.
    
    As mentioned in the comment above the test, with the queue implementation,
    the counter for the number of threads has 4 bits reserved for management. On
    64bit platforms, there are still ample room for u32::MAX readers, but on 32b
    platforms, only 2^28-1 readers can fit. We can still test u32::MAX readers
    on 64b platforms, thus keeping the min with usize::MAX &gt;&gt; 4.
    
    Fixes 83a7a4ad74ad (&quot;Clarified docs in std::sync::RwLock and added a test
    that checks if we can reach max reader&quot;)
    
    Signed-off-by: Samuel Thibault &lt;samuel.thibault@ens-lyon.org&gt;

Index: rustc-1.97.1+dfsg1/library/std/tests/sync/rwlock.rs
===================================================================
--- rustc-1.97.1+dfsg1.orig/library/std/tests/sync/rwlock.rs
+++ rustc-1.97.1+dfsg1/library/std/tests/sync/rwlock.rs
@@ -923,16 +923,16 @@ fn test_rwlock_max_readers() {
         },
         any(
             target_family = &quot;unix&quot;,
-            all(target_os = &quot;windows&quot;, target_vendor = &quot;win7&quot;, target_pointer_width = &quot;64&quot;),
+            all(target_os = &quot;windows&quot;, target_vendor = &quot;win7&quot;),
             all(target_vendor = &quot;fortanix&quot;, target_env = &quot;sgx&quot;),
             target_os = &quot;xous&quot;,
             target_os = &quot;teeos&quot;,
         ) =&gt; {
-            u32::MAX
-        },
-        // Otherwise a form of deadlock is observed.
-        all(target_os = &quot;windows&quot;, target_vendor = &quot;win7&quot;, target_pointer_width = &quot;32&quot;) =&gt; {
-            (1 &lt;&lt; 28) - 1
+            if usize::BITS - 4 &gt; u32::BITS {
+                u32::MAX
+            } else {
+                (usize::MAX &gt;&gt; 4) as u32
+            }
         },
         target_os = &quot;solid_asp3&quot; =&gt; {
             (1 &lt;&lt; 30)

--JmQjSSKDWhJ6FPFg--
]