🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.bugs.dist
Article #6074

Bug#1078107: bash: Additional reproducer: time output missing after trap and explicit exit in subshell

#6074
From: 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
Technical Details
Message-ID: <O3jZ0-e43p-7@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!news-fra.pugleaf.net!news.tcpreset.net!newsfeed.bofh.team!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
References: <J8G09-3fpB-1@gated-at.bofh.it>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-fra.pugleaf.net!news.tcpreset.net!newsfeed.bofh.team!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
From: Axel Werner <axel.werner@uniklinik-freiburg.de>
Newsgroups: linux.debian.bugs.dist
Subject: Bug#1078107: bash: Additional reproducer: time output missing after trap and explicit exit in subshell
Date: Wed, 25 Nov 2026 13:10:02 +0100
Message-ID: <O3jZ0-e43p-7@gated-at.bofh.it>
References: <J8G09-3fpB-1@gated-at.bofh.it>
X-Original-To: Debian Bug Tracking System <1078107@bugs.debian.org>
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Wed Nov 25 12:05:12 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: -1.451
Reply-To: Axel Werner <axel.werner@uniklinik-freiburg.de>, 1078107@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: doko@debian.org
X-Debian-Pr-Message: followup 1078107
X-Debian-Pr-Package: bash
X-Debian-Pr-Source: bash
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Mailer: reportbug 12.0.0
X-Feas-Bec-Info: WlpIGw0aAQkEARIJHAEHBlJSCRoLAAEeDUhZUEhYSFhIWUhZXkguLT4lWFpYWFhYWFtdWVFfSFtbSAkQDQRGHw0aBg0aKB0GAQMEAQYBA0UOGg0BCh0aD0YMDUhZSFtb
 SAkQDQRGHw0aBg0aKB0GAQMEAQYBA0UOGg0BCh0aD0YMDUhZSFlIWVpIWVhGWltYRlpYRlBbSFBIWEhYSFpIWEhYSFhIWltIWVhfUFlYXygKHQ8bRgwNCgEJBkYHGg9I
 WEhbW0gJEA0ERh8NGgYNGigdBgEDBAEGAQNFDhoNAQodGg9GDA1IWQ==
X-Feas-Client-IP: 10.230.20.83
X-Fe-Envelope-From: axel.werner@uniklinik-freiburg.de
X-Fe-Policy-ID: 1:1:1:SYSTEM, 1:1:2:uniklinik-freiburg.de
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/2004889
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 81
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Wed, 25 Nov 2026 13:02:05 +0100
X-Original-Message-ID: <179560812503.236479.1578923939415477461.reportbug@zks-backup.uniklinik-freiburg.de>
X-Original-References: <wlcr77fco3fttfzrwqpi3twrdkqm7bgqzdpzcdkyv52j346uji@tarta.nabijaczleweli.xyz>