Re: RedHat / Fedora build of ncl

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Fri Jul 13 2012 - 17:33:03 MDT

Orion,

There's definintely an issue if "dimsz_input_strs[0]" is equal to 0. If you are passing one string to str_match_ic, then this value should be 1.

Do you have similar issues with str_match?

Unfortunately, I can't reproduce this problem.

What happens with this following script, in the debugger, as far as dimsz_input_strs goes?
In other words, can you print dimsz_input_strs[0] right

  ic1 = str_match_ic("Nothing to do","to")
  print("ic1 = " + ic1)
  ic2 = str_match_ic("Nothing to do","done")
  print("ic2 = " + ic2)

It would help if you can do this for both str_match_ic and str_match.

--Mary

On Jul 13, 2012, at 4:37 PM, Orion Poplawski wrote:

> 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

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Jul 13 17:33:11 2012

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