Re: Segmentation Fault

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon, 15 Sep 2008 08:38:49 -0600 (MDT)

Hi Marco,

Can you try something for me, to help me debug it? If you have a main
"begin" and "end", temporarily comment these out, and then run "ncl"
with the "-x" option. This should echo every line back to you as it
executes, and then you'll hopefully be able to see exactly which line
it is failing on. I'm not sure this will provide me with enough
information, but I'm curious about where it's failing.

Also, I noticed you are setting these three resources in creating the
labelbar:

    lbres_at_cnMinLevelValF = gsn_MinLevelVal(var_ix,dpt_ix)
    lbres_at_cnMaxLevelValF = gsn_MaxLevelVal(var_ix,dpt_ix)
    lbres_at_cnLevelSpacingF = spacing

The LabelBar object doesn't know anything about contour resources
when you are creating it on its own, so these three resources
aren't going to have any effect.

Perhaps, rather than recreating the labelbar, is it possible for you
to set the above three resources to the same values for all your
*contour* plots, so this way the labelbar that comes with the contour
plots will be the same for each one? This way, you don't need to
recreate the labelbar yourself.

--Mary

On Mon, 15 Sep 2008, Marco Pastore wrote:

> Hi all.
>
> I am writing a very big script to produce in batch mode a lot of maps
> from oceanographic models data.
> In the script, i produce maually the labelbars, because her range should
> be the same for all days (9 Forecast days and 7 Hindcast days), but
> optimized.
> For velocity maps, i produce two labelbars ( m/s and knots )
>
> I don't have problems to plot scalar values (Temperature, Salinity...)
> with one labelbar, but abends occours during the Velocity plot.
> After 2/3 maps (well produced) , i recive a "segmentation fault" error
> (on Linux machine) or :
> 175 [main] ncl 3176 _cygtls::handle_exceptions: Error while dumping state
> (p
> robably corrupted stack)
> Segmentation fault (core dumped)
> on my laptop (i use cygwin on WinXP Pro).
>
> I attach the part of my script where labelbars are produced (the entire
> script is very big...2000 lines)
>
> ; ***************LABEL BAR *************
> ; see:
> http://www.ncl.ucar.edu/Document/Graphics/Interfaces/gsn_create_labelbar.shtml
>             
>    getvalues plot                      ; Get plot size for use in
>      "vpHeightF" : vph                 ; creating labelbar.
>      "vpWidthF"  : vpw 
>    end getvalues
>  
>    getvalues plot_at_contour 
>      "cnFillColors"           : colors
>      "cnInfoLabelFontHeightF" : font_height
>      "cnInfoLabelPerimColor"  : perim
>    end getvalues
>  
>    levels =
> fspan(gsn_MinLevelVal(var_ix,dpt_ix),gsn_MaxLevelVal(var_ix,dpt_ix),lbl_box+1)
>    labels = ""+decimalPlaces(levels,1,True)
>  
>    lbres                    = True          ; labelbar only resources
>    lbres_at_lbBoxLineColor     = perim
>    lbres_at_lbBoxLineThicknessF= 1.0
>    lbres_at_lbPerimOn          = False
>    lbres_at_vpWidthF           = 0.9 * vpw     ; labelbar width
>    lbres_at_vpHeightF          = 0.1 * vph     ; labelbar height
>    lbres_at_lbBoxMajorExtentF  = 1             ; relative dimension of the
> boxes
>    lbres_at_lbBoxMinorExtentF  = 0.4
>   
> if (var_ix.eq.2) then
>    lbres_at_lbBoxMinorExtentF  = 0.35          ; relative dimension of the
> boxes for velocity
> end if
>  
>    lbres_at_lbOrientation      = "Horizontal"  ; Orientamento delle boxes
>    lbres_at_lbFillColors       = colors        ; labelbar colors
>    lbres_at_lbMonoFillPattern  = True          ; Solid fill pattern
>    lbres_at_lbLabelFontHeightF = font_height   ; font height. default is
> small less values, bigger fonts
>    lbres_at_lbLabelJust        = "CenterCenter"; "CenterLeft"  ; left
> justify labels
>    lbres_at_cnMinLevelValF     = gsn_MinLevelVal(var_ix,dpt_ix)
>    lbres_at_cnMaxLevelValF     = gsn_MaxLevelVal(var_ix,dpt_ix)
>    lbres_at_cnLevelSpacingF    = spacing
>    lbres_at_lbLabelStride      = lbl_stride
>   
>   
>    lbid = gsn_create_labelbar(wks,dimsizes(levels)+1,labels,lbres)
>   
>    amres                    = True            ; resurce to place the new
> labelbar
>    amres_at_amZone             = 2
>    amres_at_amParallelPosF     = 0.5            ; Center labelbar.
>    amres_at_amOrthogonalPosF   = 0.05
>    amres_at_amJust             =  "CenterCenter"; "TopRight"; "CenterCenter"
> ; Punto di ancoraggio della nuova risorsa
>  
>    annoid = gsn_add_annotation(plot,lbid,amres)
>   
>    ; Second Label in Miles for Velocity
>  
> if (var_ix.eq.2) then
>    labels = ""+decimalPlaces((levels*3600/mile),1,True) ; Conversion in
> miles
>    lbid2 = gsn_create_labelbar(wks,dimsizes(levels)+1,labels,lbres)
>  
>    amres_at_amOrthogonalPosF   = 0.12
>  
>    annoid2 = gsn_add_annotation(plot,lbid2,amres)
>
> end if
>
>    delete(colors)
>    delete(levels)
>    delete(font_height)
>    delete(perim)
>    delete(labels)
> ; ***************LABEL BAR *************       
>
> I delete in the rest of the script the variable "plot" and destroy
> "lbid,amres,lbid2,amres2" (this is an attempt, i tryed also with delete,
> but without results).
>
> In internet i found somethings about "stack limit reached"; so i tried to
> add in my .bashrc file these instructions to increase the stack, but
> without results:
>
> %limit datasize unlimited
> %limit stacksize unlimited
>
> And now i am crying in front of my laptop...
>
> Any suggestion is really welcome !
>
> Thanks, Marco
>
> --
> ### ### ### ### ###
>
> MARCO PASTORE
>
> Istituto Nazionale di Geofisica e Vulcanologia
> Gruppo Nazionale di Oceanografia Operativa
> Viale Aldo Moro 44
> 40128, Bologna
>
> Tel:(+39)051-3782649
> Cel:(+39)339 8273965
>
> Skype: mapas71
>
>
> ### ### ### ### ###
>
>

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Sep 15 2008 - 08:38:49 MDT

This archive was generated by hypermail 2.2.0 : Wed Sep 17 2008 - 10:32:36 MDT