๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.debian.ports.hppa
2 messages
2 total messages Started by John David Anglin Sun, 15 Nov 2026 00:50
Bug#1154002: tcl8.6: threaded notifier futex deadlock / missed PTY EOF wakeups in expect on hppa (causes multi-day GCC buildd de...
#2
Author: John David Anglin
Date: Sun, 15 Nov 2026 00:50
72 lines
7306 bytes
Package: tcl8.6
Version: 8.6.18+dfsg-2
Severity: normal
X-Debbugs-Cc: debian-hppa@lists.debian.org
User: debian-hppa@lists.debian.org
Usertags: hppa

Dear Maintainer,

Package: tcl8.6
Version: 8.6.18+dfsg-1
Severity: important
User: debian-hppa@lists.debian.org
Usertags: hppa
X-Debbugs-Cc: debian-hppa@lists.debian.org

Subject: tcl8.6: threaded notifier futex deadlock / missed PTY EOF wakeups in expect on hppa (causes multi-day GCC buildd delays)

Dear Maintainer,

When running the GCC DejaGnu testsuite on PA-RISC (hppa), expect
(tcl-expect 5.45.4-10) intermittently hangs for the full 300-second
DejaGnu timeout even after the spawned child process has already exited and
become <defunct>. Once triggered, every subsequent test in that shard cascades
into a persistent 300-second timeout.

Impact on Debian hppa builds:
Because GCC and gcc-snapshot run tens of thousands of DejaGnu tests during
package builds, a single cascading expect hang turns a normal testsuite phase
into days of idle wall-clock waiting on hppa buildds. For example, the official
gcc-snapshot 1:20260902-1 build on paladin took nearly 9 days to complete
(started Fri, 11 Sep 2026 23:03:04 +0000; finished 2026-09-20 17:55:29):
https://buildd.debian.org/status/fetch.php?pkg=gcc-snapshot&arch=hppa&ver=1%3A20260902-1&stamp=1789926929&raw=0

Root cause and strace diagnostics:
On native PA-RISC hardware (HP rp3440), this hang is reliably triggered by
GCC testsuite suites involving Python or heavy subprocess/PTY activity (such as
plugins.exp, modules.exp, and libstdc++'s xmethods.exp), after which even
simple compilation and execution tests hang.

Attaching strace to a wedged expect process shows the main thread blocked in
Tcl's threaded notifier futex while the spawned child process has already
terminated:

  strace: Process 26912 attached
  restart_syscall(<... resuming interrupted futex ...>

Only when the 300-second expect timeout finally expires does the notifier
trigger pipe wake the futex:

  write(6, "\0", 1)                       = 1
  futex(0xf853ae90, FUTEX_WAKE_PRIVATE, 1) = 1
  clock_gettime64(CLOCK_REALTIME, {tv_sec=1794666174, tv_nsec=877701364}) = 0
  clock_gettime64(CLOCK_REALTIME, {tv_sec=1794666174, tv_nsec=878192432}) = 0
  write(4, "WARNING: program timed out.\n", 28) = 28

Process table inspection during the hang shows the spawned test executable and
helper processes already exited as <defunct> children of expect. The child
did not hangโ€”Tcl's background notifier thread (enabled via --enable-threads
in debian/rules) missed or lost the PTY EOF / POLLHUP wakeup on hppa, leaving
the main thread asleep in pthread_cond_wait / futex until the timeout alarm
fired.

Verified fix:
Rebuilding tcl8.6 (8.6.18+dfsg-1) with --disable-threads in debian/rules
disables the background notifier thread and switches Tcl back to a single-
threaded select() event loop. With ::tcl_platform(threaded) disabled, full
gcc, g++, and libstdc++ testsuite runs (including plugins.exp, modules.exp,
and xmethods.exp) complete normally on native hppa hardware with zero futex
deadlocks and zero cascading timeouts.

System information:
- Architecture: hppa (HP rp3440, native hardware)
- Packages: tcl8.6 8.6.18+dfsg-1, tcl-expect 5.45.4-10, dejagnu

Please consider either investigating the threaded notifier futex wakeup bug
on hppa or passing --disable-threads on hppa in debian/rules (especially as
upstream Tcl 8.6 is now end-of-life).

Regards,
Dave Anglin

-- System Information:
Debian Release: forky/sid
  APT prefers unreleased
  APT policy: (500, 'unreleased'), (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 6.18.58-dirty (SMP w/4 CPU threads)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8), LANGUAGE=en_CA:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages tcl8.6 depends on:
ii  libc6      2.43-7
hi  libtcl8.6  8.6.18+dfsg-2

tcl8.6 recommends no packages.

Versions of packages tcl8.6 suggests:
pn  tcl-tclreadline  <none>

-- no debconf information
Bug#1154002: tcl8.6: threaded notifier futex deadlock / missed PTY EOF wakeups in expect on hppa
#3
Author: Dave Anglin
Date: Sun, 15 Nov 2026 19:50
26 lines
3249 bytes
Hi Sergei,

It turns out that --disable-threads didn't resolve the issue after all.ย  It triggered again this
afternoon.ย  Analysis of the strace of output of expect process and some other commands
was done by Google AI:

Dave Anglin followed up on Debian Bug #1154002 to report that even with --disable-threads
applied to tcl8.6 (8.6.18+dfsg-2), expect still experiences intermittent 300-second DejaGnu
timeouts on native PA-RISC SMP hardware (HP rp3440) [Debian Bug #1154002]. Attaching strace
to the hanging process reveals it stuck in pselect6() polling /dev/ptmx master descriptors
(32 and 33) [Debian Bug #1154002]:

pselect6(34, [32 33], [], [32 33], {tv_sec=42, tv_nsec=682563857}, NULL) = 0 (Timeout)

Inspecting /proc/27620/fd and system-wide /proc/[0-9]*/fd confirms that the child process (xgcc)
has exited and been reaped via wait4(), and zero processes hold the corresponding /dev/pts/*
slave descriptors open [Debian Bug #1154002]. Because the PTY slave is closed yet pselect6() on
the master never receives a POLLHUP or POLLIN notification, the issue appears to be a Linux
kernel PTY lost-wakeup race on SMP PA-RISC (between pty_close() and n_tty_poll()) rather than
a Tcl/Expect bug [Debian Bug #1154002].

Regards,
Dave Anglin

-- 
John David Anglin  dave@parisc-linux.org
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