RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1261314 - ksh segfaults under specific circumstances
Summary: ksh segfaults under specific circumstances
Keywords:
Status: CLOSED DUPLICATE of bug 1247383
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: ksh
Version: 6.7
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Michal Hlavinka
QA Contact: BaseOS QE - Apps
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-09-09 07:46 UTC by Vasil Yonkov
Modified: 2015-09-09 08:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-09-09 08:22:24 UTC
Target Upstream Version:
Embargoed:


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

Description Vasil Yonkov 2015-09-09 07:46:26 UTC
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 07:49:26 UTC
Created attachment 1071599 [details]
ksh segfaults when this example is run (along with add.sh)

Comment 3 Michal Hlavinka 2015-09-09 08:22:24 UTC

*** This bug has been marked as a duplicate of bug 1247383 ***

Comment 4 Vasil Yonkov 2015-09-09 08:37:55 UTC
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.