Bug 1261314 - ksh segfaults under specific circumstances
ksh segfaults under specific circumstances
Status: CLOSED DUPLICATE of bug 1247383
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: ksh (Show other bugs)
6.7
x86_64 Linux
unspecified Severity medium
: rc
: ---
Assigned To: Michal Hlavinka
BaseOS QE - Apps
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-09-09 03:46 EDT by Vasil Yonkov
Modified: 2015-09-09 04:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-09-09 04:22:24 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
ksh segfaults when this example is run (along with add.sh) (160 bytes, text/plain)
2015-09-09 03:49 EDT, Vasil Yonkov
no flags Details
ksh segfaults when this example is run (along with add.sh) (160 bytes, application/x-shellscript)
2015-09-09 03:46 EDT, Vasil Yonkov
no flags Details

  None (edit)
Description Vasil Yonkov 2015-09-09 03:46:26 EDT
Created attachment 1071603 [details]
ksh segfaults when this example is run (along with add.sh)

Description of problem:
ksh segfaults when the attached example is run.

Version-Release number of selected component (if applicable):
This was introduced in ksh-20120801-28. ksh-20120801-21 doesn't have such problem.

How reproducible:
100%

Steps to Reproduce:
1. Put 'test.sh' and 'add.sh' into a directory and run 'test.sh'

Actual results:
<current date>
Segmentation fault

Expected results:
<current date>
not to segfault

Additional info:
The setup should really have all the components from the attached example.
If any of the following changes are made, ksh does not segfault:
 - no trap set
 - the trap is not a null string
 - any command (for example - date) is executed before *both* variable and fuction declaration
 - 'just_a_variable' is not the result of a subshell
 - the function is declared using the C-style syntax ( name () {} )
 - the function is not called
 - add.sh does not spawn a subshell
Comment 1 Vasil Yonkov 2015-09-09 03:49:26 EDT
Created attachment 1071599 [details]
ksh segfaults when this example is run (along with add.sh)
Comment 3 Michal Hlavinka 2015-09-09 04:22:24 EDT

*** This bug has been marked as a duplicate of bug 1247383 ***
Comment 4 Vasil Yonkov 2015-09-09 04:37:55 EDT
There seems to be a problem with me adding attachments, so I'll just paste the sripts here:

-- | This is 'test.sh':

#!/usr/bin/env ksh

trap '' HUP

# date

just_a_variable="$( date )"

function temp
{
    os="$( uname )"
    PACE_VAL=2
    dir="$( pwd )"
}

temp

. ./add.sh


-- | This is 'add.sh':

#!/usr/bin/env ksh

( date )

Note You need to log in before you can comment on or make changes to this bug.