Bug#1153378: libbrlapi0.8: IPv6 localhost timeout misses ::1; X11 login stalls for 134 seconds
Komorebi Aware
komorebi.aware at gmail.com
Sat Nov 7 20:34:18 GMT 2026
Package: libbrlapi0.8
Version: 6.9.1+repack-2
Severity: normal
Tags: patch ipv6
Control: affects -1 xbrlapi
Dear Maintainer,
The localhost timeout fix used to close Debian bug #1087173 appears
incomplete
for IPv6. With libbrlapi0.8 and xbrlapi 6.9.1+repack-2 installed,
xbrlapi still
blocks an X11 login for approximately 134 seconds while connecting to
[::1]:4101.
Related report: https://bugs.debian.org/1087173
Expected behaviour
------------------
If no BrlAPI server is available, a localhost connection should fail
promptly,
with the existing short timeout covering IPv6 loopback as well as IPv4. An
unavailable optional braille helper should not delay the desktop for
minutes.
Observed behaviour and configuration
------------------------------------
The system runs Debian forky/sid on amd64, using SDDM and Plasma X11.
The brltty
package is not installed and there is no local braille daemon listening.
/etc/X11/Xsession.d/90xbrlapi runs xbrlapi synchronously, before Plasma
starts,
and suppresses its stderr. xbrlapi attempts its BrlAPI connection before
backgrounding. During the delay, the helper was observed blocked in
connect()
to [::1]:4101, with the TCP socket in SYN_SENT.
The persistent IPv6-disable configuration includes:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
net.ipv6.conf.enp2s0.disable_ipv6 = 1
net.ipv6.conf.wlp3s0.disable_ipv6 = 1
The actual runtime state, also checked after the successful workaround
test, is:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
net.ipv6.conf.enp2s0.disable_ipv6 = 0
Thus IPv6 loopback is disabled but Ethernet has IPv6 enabled. I have not
established which component re-enabled IPv6 on Ethernet. In this state,
"ip -6 route get ::1" selects the Ethernet default gateway rather than a
local
loopback route. The unanswered connection waits for TCP retries to expire.
Regardless of this unusual network state, this is the kind of slow localhost
connection that the existing 100 ms timeout was intended to bound.
Measurements made before installing the workaround:
Default xbrlapi connection: 134.465 seconds, then failure
xbrlapi -b 127.0.0.1: 0.008 seconds, connection
refused
Workaround followed by real 90xbrlapi: 0.010 seconds, shell exit
status 0
The original suspicion was external-monitor probing, because the problem was
noticed with an external monitor attached. Xorg successfully read the EDIDs,
however, and live xrandr queries completed in 0.010-0.017 seconds. The
blocking
BrlAPI connection provides a direct explanation of the measured login delay;
I have not established that an external monitor is required to trigger it.
The journal supplies an end-to-end comparison using the same two events:
Before workaround, seconds since boot:
88.040221 SDDM starts /etc/sddm/Xsession /usr/bin/startplasma-x11
224.262690 Started plasma-plasmashell.service
Difference: 136.222469 seconds
After workaround, a fresh login in the same boot:
366939.047430 SDDM starts /etc/sddm/Xsession
/usr/bin/startplasma-x11
366941.425568 Started plasma-plasmashell.service
Difference: 2.378138 seconds
The fresh login was successful and the long delay disappeared. These
intervals
measure session launch to the plasmashell service being started, rather than
the time until every desktop application has finished loading.
Suspected cause and proposed correction
---------------------------------------
The installed changelog says 6.9.1+repack-2 includes git-localhost-timeout,
closing #1087173. I also checked that exact Debian version's packaging
archive:
https://deb.debian.org/debian/pool/main/b/brltty/brltty_6.9.1+repack-2.debian.tar.xz
SHA256: 4d4bfdbcd3fd749371f87e2f4be1f7eb9992aa990cc130ef1a49271762c98d1d
In Programs/brlapi_client.c, the IPv6 branch of the added localhost
guard uses:
!memcmp(cur->ai_addr, &ip6_localhost, sizeof(ip6_localhost))
cur->ai_addr points to a struct sockaddr_in6, starting with the address
family,
port, and flow information. The comparison should instead start at
sin6_addr.
As written, ::1 is not recognized and the short SO_SNDTIMEO is not installed
for that connection. This appears to explain why the supposedly fixed
version
still waits for the full IPv6 TCP connection timeout.
The attached candidate patch (suggestion) changes the first argument to:
&((struct sockaddr_in6 *)cur->ai_addr)->sin6_addr
It preserves the existing IPv4 check and timeout duration.
The attached standalone C reproducer checks the existing and corrected
guards
using numeric addresses and port 4101, without opening network connections.
It was compiled with -std=c11 -D_POSIX_C_SOURCE=200112L -Wall -Wextra
-Werror
and produced:
::1 original=0 corrected=1
2001:db8::1 original=0 corrected=0
127.0.0.1 original=1 corrected=1
127.0.0.2 original=1 corrected=1
192.0.2.1 original=0 corrected=0
This validates the address-comparison correction. I have not rebuilt or
tested
a complete BrlAPI library with the candidate patch; the confirmed desktop
login test used the environment workaround below.
Reproduction on an affected system
----------------------------------
With the network state above, no listening BrlAPI server, and the reported
package versions, run from an X11 session:
time timeout 5s env -u BRLAPI_HOST xbrlapi
time timeout 5s env BRLAPI_HOST=127.0.0.1 xbrlapi
The first command reaches the five-second limit (exit status 124). The IPv4
command returns promptly with a connection error, which is expected with no
server. The earlier 134.465-second measurement allowed the default
connection
to run to completion instead of imposing this five-second limit.
I rechecked these bounded commands after the successful login: the default
connection was stopped after 5.003 seconds with status 124; the IPv4
connection
returned after 0.011 seconds with status 4 and the following stderr:
openConnection: Connection refused
cannot connect to braille devices daemon brltty at 127.0.0.1
Working local workaround
------------------------
I installed /etc/X11/Xsession.d/89blp-brlapi-local, sourced before
90xbrlapi:
if [ -z "${BRLAPI_HOST:-}" ]; then
export BRLAPI_HOST=127.0.0.1
fi
This preserves an explicitly configured nonempty BrlAPI host. The default
IPv4 connection is refused immediately and Xsession continues. IPv6 settings
were left unchanged. An alternative sysctl drop-in to enable IPv6 loopback
remains commented out and was not activated.
Versions
--------
xbrlapi 6.9.1+repack-2
libbrlapi0.8:amd64 6.9.1+repack-2
brltty not installed
libc6:amd64 2.43-6
sddm 0.21.0+git20250502.4fe234b-2
plasma-workspace 4:6.5.2-1
xserver-xorg-core 2:21.1.20-1
Kernel Linux 6.16.12+deb14+1-amd64
Since #1087173 is archived, I am filing this against libbrlapi0.8 with
xbrlapi
marked as affected. Please link or reopen the earlier report if that is more
appropriate. Thank you for looking into it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ipv6-loopback-comparison.patch
Type: text/x-patch
Size: 1054 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-a11y-devel/attachments/20261107/a41a252c/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: loopback-check.c
Type: text/x-csrc
Size: 1886 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-a11y-devel/attachments/20261107/a41a252c/attachment.c>
More information about the Pkg-a11y-devel
mailing list