Re: RedHat / Fedora build of ncl

From: Orion Poplawski <orion_at_nyahnyahspammersnyahnyah>
Date: Fri Jul 13 2012 - 16:37:22 MDT

Sending this to the ncl-talk list to see if we can get any more insight.

Summary - seeing a segfault in Fedora/EPEL RPMs of ncl.

This is where I've tracked it to now.

In userAddFuncs.c:_Nclstr_match_ic()

     str_size = 1;
     for(i=0; i<ndim_input_strs; i++)
         str_size *= dimsz_input_strs[i];

     output_strs = (string *) NclMalloc(str_size*sizeof(string));
     if (! output_strs)
     {
         NHLPERROR((NhlFATAL,ENOMEM,NULL));
         return NhlFATAL;
     }

It appears that ndim_input_strs is 1, and

(gdb) print dimsz_input_strs
$17 = {0 <repeats 13 times>, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0}

so str_size=0, NclMalloc(0) returns null and we return NhlFATAL which somehow
ends up segfaulting.

I can't grok how ncl handles arguments, seems very complicated.

I believe things have gone awry before this point, but that is the symptom I see.

continuing:

3485 NHLPERROR((NhlFATAL,ENOMEM,NULL));
(gdb)
fatal:["userAddFuncs.c":3485]:[errno=12]
3486 return NhlFATAL;
(gdb)
3532 }
(gdb)
0x00000000 in ?? ()

so perhaps the stack is already smashed.

FWIW - get the same with 6.1.0-beta.

Any more suggestions for debugging this?

On 06/22/2012 01:57 AM, Paul Scorer wrote:
> Greetings,
>
> I write as I have stamped on a bug in both the i686 and x86_64 versions
> of ncl as distributed with F15 and F16. I have not tested other
> versions.
>
> The specific packages tested were
>
> ncl-6.0.0-2.fc16.i686
> and
> ncl-6.0.0-2.fc15.x86_64
>
> A simple test is to start ncl and enter the script as below. This is an
> example script from
> http://www.ncl.ucar.edu/Document/Functions/Built-in/str_match.shtml
>
> $ ncl
> Copyright (C) 1995-2011 - All Rights Reserved
> University Corporation for Atmospheric Research
> NCAR Command Language Version 6.0.0
> The use of this software is governed by a License Agreement.
> See http://www.ncl.ucar.edu/ for more details.
> ncl 0> class_out = NhlGetClassResources("contourPlotClass", "")
> ncl 1> cnConst = str_match_ic(class_out, "cnConst")
> Segmentation fault
> $
>
> It the same for both str_match() and str_match_ic()
>
> I have taken this up with Mary Haley <haley@ucar.edu> of
> ncl-talk@ucar.edu
>
> Clearly, they cannot support a build done by others. However, she has
> noted that there have been a number of other issues with the RedHat
> build of ncl, and has suggested that this may relate to the optimiser
> options used.
>
>>From my point of view the matter has been resolved by downloading a
> version of the ncl binary from Earth System Grid, but I am sure you
> would agree that this is something that should get fixed.
>
> HTH
>
> PaulS
>

-- 
Orion Poplawski
Technical Manager                     303-415-9701 x222
NWRA/CoRA Division                    FAX: 303-415-9702
3380 Mitchell Lane                  orion@cora.nwra.com
Boulder, CO 80301              http://www.cora.nwra.com
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Jul 13 16:37:33 2012

This archive was generated by hypermail 2.1.8 : Wed Jul 18 2012 - 14:33:00 MDT