Bug 473528

Summary: command hang in ksh and cpu workload is high
Product: Red Hat Enterprise Linux 4 Reporter: Freax <holmes86>
Component: pdkshAssignee: Michal Hlavinka <mhlavink>
Status: CLOSED WONTFIX QA Contact: BaseOS QE <qe-baseos-auto>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.9   
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-05 13:50:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
backported from mksh none

Description Freax 2008-11-29 03:58:57 UTC
Description of problem:
command hang in ksh and cpu workload is high

Version-Release number of selected component (if applicable):
pdksh-5.2.14-30.2

How reproducible:


Steps to Reproduce:
1. create a script like belowing:
# cat hang.sh 
#!/bin/ksh
alias ls="ls"
i=`ls`
echo $i

2. issuce the script
  # ./hang.sh

Actual Results:
  script hangs while executing  i=`ls`, and the cpu workload is nearly 100%

Expected Results:
   The script runs smoothly.


Additional Information:

# ps -e | grep hang
21776 pts/3    00:00:27 hang.sh

# strace -p 21776 
brk(0xa057000)                          = 0xa057000
brk(0xa078000)                          = 0xa078000
brk(0xa099000)                          = 0xa099000
brk(0xa0ba000)                          = 0xa0ba000
brk(0xa0db000)                          = 0xa0db000
brk(0xa0fc000)                          = 0xa0fc000
brk(0xa11d000)                          = 0xa11d000
...

# ltrace -p 21776 
__rawmemchr(0x9480688, 0, 0xbff7e808, 0x8049a6a, 0x9fb71a8)          =
0x948068a 
memset(0x80758a2, '\000', 63)                                        =
0x80758a2 
strcmp("ls", "ls")                                                   = 0
__ctype_b_loc()                                                      =
0xb7fdda84
__rawmemchr(0x9480688, 0, 0xbff7e808, 0x8049a6a, 0x9fb7210)          =
0x948068a 
memset(0x80758a2, '\000', 63)                                        =
0x80758a2 
strcmp("ls", "ls")                                                   = 0
__ctype_b_loc()                                                      =
0xb7fdda84
__rawmemchr(0x9480688, 0, 0xbff7e808, 0x8049a6a, 0x9fb7278)          =
0x948068a 
memset(0x80758a2, '\000', 63)                                        =
0x80758a2 
strcmp("ls", "ls")                                                   = 0
__ctype_b_loc()                                                      =
0xb7fdda84
__rawmemchr(0x9480688, 0, 0xbff7e808, 0x8049a6a, 0x9fb72e0)          =
0x948068a 
memset(0x80758a2, '\000

Comment 1 Michal Hlavinka 2008-12-03 12:55:22 UTC
Created attachment 325531 [details]
backported from mksh

patch backported from mksh, thanks to Thorsten Glaser

Comment 2 Michal Hlavinka 2010-03-05 13:50:35 UTC
I'm sorry for not addressing the issue in RHEL-4. As pdksh
is not scheduled for update in RHEL-4.9, I'm closing that bugzilla WONTFIX. If
you are still experiencing the issue with RHEL-5, feel free to reopen it
against RHEL-5.