🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.debian.bugs.dist
1 messages
1 total messages Started by Axel Werner Wed, 25 Nov 2026 12:10
Bug#1078107: bash: Additional reproducer: time output missing after trap and explicit exit in subshell
#6074
Author: Axel Werner
Date: Wed, 25 Nov 2026 12:10
81 lines
4517 bytes
Package: bash
Version: 5.2.15-2+b13
Followup-For: Bug #1078107

Dear Maintainer,

I confirm that Bug #1078107 still affects Debian 12.15 with
bash 5.2.15-2+b13.

What led up to the situation:
I use Bash's `time` reserved word with a parenthesized subshell that
installs INT and TERM traps for signal handling.

What I did:
I ran this minimal reproducer in a clean, non-interactive Bash:

    bash --noprofile --norc -c '
        TIMEFORMAT="elapsed %R seconds"
        time (
            trap ":" INT TERM
            sleep 1
            exit 0
        )
    '

What happened:
The subshell runs for approximately one second and returns exit status 0,
but Bash prints no timing output.

Expected result:
Bash should print one line such as:

    elapsed 1.002 seconds

Removing either `trap ":" INT TERM` or `exit 0` makes the timing output
appear again.

This appears related to the existing reproducer `time (exec echo)` in
this bug: in both cases, an explicitly terminated parenthesized subshell
completes successfully but the Bash `time` reserved word produces no
output.

I reproduced this using a file-based test invoked as:

    bash --noprofile --norc /tmp/bash-time-test.sh

The test has four cases. Only the combination of an INT/TERM trap and
explicit `exit 0` suppresses the TIMEFORMAT output. The same unchanged
test prints timing output for all four cases on SLES 15 SP7 with
Bash 4.4.23.

Regards,
Axel Werner


-- System Information:
Debian Release: 12.15
  APT prefers oldstable-updates
  APT policy: (500, 'oldstable-updates'), (500, 'oldstable-security'), (500, 'oldstable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.1.0-56-amd64 (SMP w/4 CPU threads; PREEMPT)
Kernel taint flags: TAINT_AUX
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages bash depends on:
ii  base-files   12.4+deb12u15
ii  debianutils  5.7-0.5~deb12u1
ii  libc6        2.36-9+deb12u14
ii  libtinfo6    6.4-4

Versions of packages bash recommends:
ii  bash-completion  1:2.11-6

Versions of packages bash suggests:
pn  bash-doc  <none>

-- no debconf information
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