*Synopsis*: ksh93 coredumps with script that calls trap

CR 6878981 changed on Jan 7 2010 by <User 1-5Q-1267>

=== Field ============ === New Value ============= === Old Value =============

Introduced in Release  solaris_nevada                                         
====================== =========================== ===========================

     
*Change Request ID*: 6878981

*Synopsis*: ksh93 coredumps with script that calls trap

  Product: solaris
  Category: shell
  Subcategory: korn93
  Type: Defect
  Subtype: 
  Status: 3-Accepted
  Substatus: 
  Priority: 2-High
  Introduced In Release: solaris_nevada
  Introduced In Build: 
  Responsible Engineer: <User 1-5Q-6085>
  Keywords: 

=== *Description* ============================================================
The following is a whittled-down test-case that, when run and takes certain 
input (described below), causes ksh93 to crash.

----

#!/bin/ksh93

# Block all signals which could terminate the menu or return to a parent process
trap "" TSTP INT TERM ABRT QUIT

# Define the menu of commands and prompts
menu_items=( \
(menu_str="sleep"       cmd="/bin/sleep 5"      ) \
)

for ((;;)) ; do

        # Take an entry (by number).
        input=""
        dummy=""
        print -n "Please enter a number: "
        read input dummy

        (
        trap - INT TERM ABRT QUIT
        ${menu_items[$input].cmd}
        )
done
----

Run the above as follows:

strongheart:/home/schwartz/org/notes/ddu> bug.ksh
Please enter a number: 0
^CPlease enter a number: 0
^CSegmentation Fault (core dumped)
strongheart:/home/schwartz/org/notes/ddu> 

Enter 0, ^C while sleep is running, enter 0 again, ^C again, while sleep is 
running, and.... bammo!
Corefile attached.

Crash is somewhat random in that things which shouldn't affect the crash could, 
for example "set -x" might cause it to crash differently.  Based on this, my 
guess is that theres some kind of memory corruption, a variable being 
overwritten, etc, inside ksh93 proper.

A more complete script, from which the above was gleened, is also attached.  
That script crashes when sleep is selected and then the first ^C is attempted.

System is an Ultra40 running OpenSolaris snv_121, fresh install.

*** (#1 of 1): 2009-09-03 20:47:26 GMT+00:00 <User 1-5Q-13671>


=== *Public Comments* ========================================================

=== *Workaround* =============================================================

=== *Additional Details* =====================================================
        Targeted Release: solaris_nevada
        Commit To Fix In Build: 
        Fixed In Build: 
        Integrated In Build: 
        Verified In Build: 
  See Also: 
  Duplicate of: 
  Hooks:
        Hook1: 
        Hook2: 
        Hook3: 
        Hook4: 
        Hook5: 
        Hook6: 
  Program Management: 
  Root Cause: 
  Fix Affects Documentation: No
  Fix Affects Localization: No

=== *History* ================================================================
        Date Submitted: 2009-09-03 20:47:25 GMT+00:00
        Submitted By: <User 1-5Q-13671>

        Status Changed    Date Updated                  Updated By
        3-Accepted        2009-09-22 11:05:37 GMT+00:00 <User 1-5Q-6085>


=== *Service Request* ========================================================
        Impact: Significant
        Functionality: Primary
        Severity: 2
        Product Name: solaris
        Product Release: solaris_nevada
        Product Build: 
        Operating System: snv_121
        Hardware: generic
        Submitted Date: 2009-09-03 20:47:26 GMT+00:00


=== *Multiple Release (MR) Cluster* - 0 ======================================

Reply via email to