Bash crashes with a segmentation fault on "trap 'kill 0' SIGTERM EXIT"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
bash (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Trusty's bash (4.3-7ubuntu1) crashes with a segmentation fault on the following trap statement:
trap 'kill 0' SIGTERM EXIT
Apport doesn't react to this crash and so I wasn't able to submit this bug via Apport. :-/
$ dpkg-query --show --showformat '${Package}
bash 4.3-7ubuntu1 amd64
$ cat test.sh
#!/bin/bash
trap 'kill 0' SIGTERM EXIT
$ ./test.sh ; echo $?
Segmentation fault (core dumped)
139
$ gdb --args /bin/bash test.sh (with nostrip and noopt bash build)
(gdb) bt
#0 0x00007ffff761e267 in kill () at ../sysdeps/
#1 0x000000000044fbf2 in kill_pid (pid=0, sig=15, group=0) at .././jobs.c:3158
#2 0x0000000000494a09 in kill_builtin (list=0x7388a8) at ../../.
#3 0x000000000043c7c0 in execute_builtin (builtin=0x494601 <kill_builtin>, words=0x738908, flags=0, subshell=0) at .././execute_
#4 0x000000000043d3d0 in execute_
at .././execute_
#5 0x000000000043c271 in execute_
#6 0x0000000000435fe1 in execute_
#7 0x0000000000490123 in parse_and_execute (string=0x737588 "kill 0", from_file=0x4e275f "exit trap", flags=21) at ../../.
#8 0x00000000004697ef in run_exit_trap () at .././trap.c:846
#9 0x000000000041ef9e in exit_shell (s=0) at .././shell.c:915
#10 0x000000000041eacf in main (argc=2, argv=0x7fffffff
Status changed to 'Confirmed' because the bug affects multiple users.