[ncl-talk] Attribute multi-dimension segfault

Kyle Griffin ksgriffin2 at wisc.edu
Fri Dec 18 21:08:12 MST 2015


Yes, a simple work around is to assign the colors to a separate variable
first, then process (in my case, pull the dimsizes for the first dimension)
and assign back to the attribute.

Thanks for filing the ticket.

Kyle
On Dec 18, 2015 4:34 PM, "Rick Brownrigg" <brownrig at ucar.edu> wrote:

> Hi Kyle,
>
> Yes, I can reproduce this, and in other ways as well.  It does seem like a
> bug, and I'll file a ticket on it.
>
> Do you have a work-around for the time being?
>
> Thanks for reporting this...
> Rick
>
>
> On Fri, Dec 18, 2015 at 9:35 AM, Kyle Griffin <ksgriffin2 at wisc.edu> wrote:
>
>> Hi all,
>>
>> Interesting little problem when trying to read colors assigned to
>> attributes. A Nx4 array of colors can be assigned but not properly
>> subscripted. Given the code below:
>>
>> ares = True
>> ares at cnLineColors = read_colormap_file("BlRe")
>>
>> I then tried three different operations.
>> 1) print(ares at cnLineColors) ----> results in full Nx4 array output on
>> screen.
>> 2) print(ares at cnLineColors(0:10,:) ----> Warning that attributes are
>> only one dimension (not a true statement), no output
>> 3) print(ares at cnLineColors(0:10) -----> Segfault, no warning received,
>> in contrast to most other attempts to read with wrong number of subscripts.
>>
>> Warning is received as expected if indices exceed dimensions, regardless
>> of dimensions included/referenced in the subscripts.
>>
>> Seems like this may have been overlooked at some point. Further, is
>> support for any 2+ dimensioned attributes an intended feature?
>>
>> Full output for cases 1-3 below.
>>
>>
>> Kyle
>>
>>
>>  Copyright (C) 1995-2015 - All Rights Reserved
>>
>>  University Corporation for Atmospheric Research
>>
>>  NCAR Command Language Version 6.3.0
>>
>>  The use of this software is governed by a License Agreement.
>>
>>  See http://www.ncl.ucar.edu/ for more details.
>>
>> ncl 0> ares=True
>>
>> ncl 1> ares at cnLineColors = read_colormap_file("BlRe")
>>
>> ncl 2> print(ares at cnLineColors(0:10))
>>
>> Segmentation fault (core dumped)
>>
>>
>>  Copyright (C) 1995-2015 - All Rights Reserved
>>
>>  University Corporation for Atmospheric Research
>>
>>  NCAR Command Language Version 6.3.0
>>
>>  The use of this software is governed by a License Agreement.
>>
>>  See http://www.ncl.ucar.edu/ for more details.
>>
>> ncl 0> ares=True
>>
>> ncl 1> ares at cnLineColors = read_colormap_file("BlRe")
>>
>> ncl 2> print(ares at cnLineColors(0:10,:))
>>
>> fatal:Attributes only have one dimension, 2 subscripts used
>>
>> fatal:["Execute.c":8573]:Execute: Error occurred at or near line 2
>>
>>
>> ncl 3> print(ares at cnLineColors)
>>
>> (0,0) 0
>>
>> (0,1) 0
>>
>> (0,2) 0.5019608
>>
>> (0,3) 1
>>
>> (1,0) 0
>>
>> (1,1) 0
>>
>> (1,2) 0.5215687
>>
>> (1,3) 1
>>
>> (2,0) 0
>>
>> (2,1) 0
>>
>> (2,2) 0.5411765
>>
>> (2,3) 1
>>
>> .......
>> ----------------------------------------
>> Kyle S. Griffin
>> Department of Atmospheric and Oceanic Sciences
>> University of Wisconsin - Madison
>> Room 1407
>> 1225 W Dayton St, Madison, WI 53706
>> Email: ksgriffin2 at wisc.edu
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20151218/508c9ecf/attachment.html 


More information about the ncl-talk mailing list