ksh script execution results in a memory fault (coredump)
Issue
- ksh script execution results in a Memory fault (coredump). User executed:
./script -U
- Further looking and debugging at the code we observed one particular line of code where redirection is done while sourcing a utility function shell script:
. /path/to/utility/functions/script 1>/dev/null 2>&1
This redirection leads to the core.
Corresponding stack trace shows invalid descriptor number:
fcntl(12, F_DUPFD, 2) = 2
close(12) = 0
fcntl(11, F_DUPFD, 4294967295) = -1 EINVAL (Invalid argument)
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV (core dumped) +++
Memory fault(coredump)
Environment
- Red Hat Enterprise Linux (RHEL) 6.4
- ksh-20100621-19.el6.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.
