Bug #1047
closedksh overwrites child core files
100%
Description
This script:
#!/bin/sh find . -name '*.[ch]' -print | sort
Run with these environment settings:
LANG=en_US.UTF-8
LC_COLLATE=C
and run in this illumos directory:
$ cd $SRC/cmd/smbsrv
$ ~/bin/findch
Memory fault(coredump)
$ file core
core: ELF 32-bit LSB core file 80386 Version 1, from 'findch'
$ mdb core
08047858 libc_hwcap1.so.1`kill+0x15(fee07bb0, 0, a, fedb01c5)
08047938 libshell.so.1`sh_main+0x840(2, 8047998, 0, fee6e9f2, 4, 0)
08047968 main+0x4a(2, 8047998, 80479a4, 804798c)
0804798c _start+0x7d(2, 8047ab8, 8047ac0, 0, 8061210, 8047af9)
After using coreadm as follows:
coreadm -i core.%p
one can observe that the real reason for this core was
the child (sort) having dumped core, after which ksh
does a kill(2) of itself with the signal from the child.
[alanc reports this is 7008357]
The reason for the child core was
https://www.illumos.org/issues/1046
ksh should avoid making itself dump core here.
Related issues