Your message dated Mon, 25 Mar 2024 15:17:50 +0100
with message-id <[email protected]>
and subject line Re: Bug#370813: bash: DEBUG trap munges job title to trap
command string, rather than job command string
has caused the Debian Bug report #370813,
regarding bash: DEBUG trap munges job title to trap command string, rather than
job command string
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
370813: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=370813
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: bash
Version: 3.1-4
Severity: normal
i'm experimenting with the DEBUG trap. There has been a regression
since sarge's bash version in how it interacts with bash's job list.
It appears that in bash 3.1.14, bash overwrites each job's title
string with the contents of the DEBUG trap itself, rather than
retaining the job's own invocation string.
in the transcripts below, i'll put ^Z to mean pressing ctrl-Z (even
though it doesn't actually show up in the terminal). Likewise with
^D for the EOF.
with nothing in the DEBUG trap (this is good, and the expected
behavior!):
[0 dkg@squeak ~]$ trap - DEBUG
[0 dkg@squeak ~]$ cat
^Z
[1]+ Stopped cat
[148 dkg@squeak ~]$ jobs
[1]+ Stopped cat
[0 dkg@squeak ~]$ fg
cat
^D
[0 dkg@squeak ~]$
on a sarge system (this is also the behavior i expect):
[0 dkg@grunt dkg]$ bash --version
GNU bash, version 2.05b.0(1)-release (i386-pc-linux-gnu)
Copyright (C) 2002 Free Software Foundation, Inc.
[0 dkg@grunt dkg]$ trap "echo foo" DEBUG
[0 dkg@grunt dkg]$ cat
foo
^Z
[1]+ Stopped cat
[0 dkg@grunt dkg]$ jobs
foo
[1]+ Stopped cat
[0 dkg@grunt dkg]$ fg
foo
cat
^D
[0 dkg@grunt dkg]$
But the job listings are screwed up by the DEBUG trap on an etch
version of bash. Note how the job is listed with the string of the
DEBUG command, rather than the job's own command:
[0 dkg@squeak ~]$ bash --version
GNU bash, version 3.1.14(1)-release (i486-pc-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.
[0 dkg@squeak ~]$ trap "echo foo" DEBUG
[0 dkg@squeak ~]$ cat
foo
^Z
[1]+ Stopped echo foo
[148 dkg@squeak ~]$ jobs
foo
[1]+ Stopped echo foo
[0 dkg@squeak ~]$ fg
foo
echo foo
^D
[0 dkg@squeak ~]$
Note that this problem doesn't seem to occur if you launch jobs that
are directly backgrounded. For example:
[0 dkg@squeak ~]$ trap "echo foo" DEBUG
[0 dkg@squeak ~]$ long-running-job &
foo
[1] 16522
[127 dkg@squeak ~]$ jobs
foo
[1]+ Running long-running-job &
[0 dkg@squeak ~]$
but it does effect jobs that are explicitly backgrounded later on:
[0 dkg@squeak ~]$ trap "echo foo" DEBUG
[0 dkg@squeak ~]$ long-running-job
foo
^Z
[1]+ Stopped echo foo
[148 dkg@squeak ~]$ bg
foo
[1]+ echo foo &
[0 dkg@squeak ~]$ jobs
foo
[1]+ Running echo foo &
[0 dkg@squeak ~]$
Perhaps this means that it is the suspend character itself causing the
munging to take place -- i'm not sure. At any rate, a broken jobs
table is the result, which could cause some headaches later on.
Let me know if i can do anything to help debug this further.
--dkg
-- System Information:
Debian Release: testing/unstable
APT prefers testing
APT policy: (500, 'testing')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15-1-686
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Versions of packages bash depends on:
ii base-files 3.1.13 Debian base system miscellaneous f
ii debianutils 2.16.1 Miscellaneous utilities specific t
ii libc6 2.3.6-7 GNU C Library: Shared libraries
ii libncurses5 5.5-2 Shared libraries for terminal hand
bash recommends no packages.
-- no debconf information
--- End Message ---
--- Begin Message ---
Version: 5.0-6
On Tue, 06 Jun 2006 17:13:15 -0400 Daniel Kahn Gillmor
<[email protected]> wrote:
Package: bash
Version: 3.1-4
Severity: normal
i'm experimenting with the DEBUG trap. There has been a regression
since sarge's bash version in how it interacts with bash's job list.
It appears that in bash 3.1.14, bash overwrites each job's title
string with the contents of the DEBUG trap itself, rather than
retaining the job's own invocation string.
Hi,
this issue does not seem to affect version 5.0-6 and later of bash.
$ trap "echo foo" DEBUG
$ cat
foo
^Z
[1]+ Stopped cat
$ jobs
foo
[1]+ Stopped cat
$ fg
foo
cat
Please reopen this bug if you can still reproduce this issue.
Regards,
--
Gioele Barabucci
--- End Message ---