Ksh segfaults when using "trap <whatever> DEBUG" and then creating a file with stdout redirection (>)
Issue
These few lines of ksh code will cause a segfault and coredump in ksh for RHEL 6.6:
function dlog
{
fc -ln -0
}
trap dlog DEBUG
>/tmp/blah
The creation of an empty file instead of a command that executes anything causes the coredump.
The result is:
ksh[761]: segfault at 1 ip 000000000044e1d8 sp 00007fff8b7d04a0 error 4 in ksh93[400000+15b000]
ksh[7223]: segfault at 1 ip 000000000044e1d8 sp 00007fffb2f324d0 error 4 in ksh93[400000+15b000]
Reproduced with version:
# rpm -q ksh
ksh-20120801-21.el6.1.x86_64
This sounds very similar to the solution listed as Ksh scripts segfault in job lob list code but this is still happening on the ksh version that is listed as a fix for that issue.
Environment
- Red Hat Enterprise Linux (RHEL) 6.6
- ksh-20120801-21.el6.1.x86_64
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
