Subject: Re: [ksh93-integration-discuss] CR 6715496 Updated P2 shell/korn93  
ksh93 SEGVs on array reinitialization
--------

> *Synopsis*: ksh93 SEGVs on array reinitialization
> 
> CR 6715496 changed on Jun 17 2008 by <User 1-6Y4MMS>
> 
> === Field ============ === New Value ============= === Old Value =============
> 
> Work Around            New Note                                               
> ====================== =========================== ===========================
> 
> 
> *Change Request ID*: 6715496
> 
> *Synopsis*: ksh93 SEGVs on array reinitialization
> 
>   Product: solaris
>   Category: shell
>   Subcategory: korn93
>   Type: Defect
>   Subtype: 
>   Status: 1-Dispatched
>   Substatus: 
>   Priority: 2-High
>   Introduced In Release: 
>   Introduced In Build: 
>   Responsible Engineer: 
>   Keywords: 
> 
> === *Description* ============================================================
> ksh93 dumps core when an array variable previously declared with "set -A 
> vname" 
> is reinitialized
> by redeclaring it using "set -A vname".  
> 
> By reinitializing, we mean throwing away all array data that has been 
> assigned s
> o far and 
> recreating the array as a freshly created 'set -A' variable would -- with no 
> ini
> tial data
> until specifically assigned.
> 
> Attached are a script that reproduces the bug and a core file produced when 
> the 
> script was run.
> 
> *** (#1 of 1): 2008-06-17 13:57:39 GMT+00:00 <User 1-5Q-8946>
> 
> 
> === *Workaround* =============================================================
> Instead of using simply 'set -A vname' to reinitialize the array, use
>         set -A vname -- ""
> This creates an array of size 1.
> 
> Do note that this is NOT exactly identical to "set -A vname" which 
> creates an array of ZERO size (i.e., ${vname[*]} returns 0).
> 
> *** (#1 of 2): 2008-06-17 13:57:39 GMT+00:00 <User 1-5Q-8946>
> 
> AFAIK it should be possible to do an $ unset arrayname # before the $ set -A 
> arr
> ayname # to work around this problem, too.
> 
> *** (#2 of 2): 2008-06-17 20:09:48 GMT+00:00 <User 1-6Y4MMS>
> 
> 

I tried to reproduce on Linux without success with the following:
============cut here==========
set -A vname  -- foo bar
set -A vname 
============cut here==========

Is this correct?  If not, what sequence reproduces it?


David Korn
dgk at research.att.com

Reply via email to