Re: Segmentation Fault

From: Marco Pastore <marco.pastore_at_nyahnyahspammersnyahnyah>
Date: Mon, 15 Sep 2008 17:31:49 +0200
Mary,

if you want i can send you all my scripts, so you can run it yourself, but you need also 2 very big netcdf files..ad it is hard to send them.

So this is the results (text file) of the print instructions in the last 3 execution of the "creating labelbar" module, that i sended you before.

TX

Mary Haley ha scritto:

Marco,

It's going to be hard for me to debug this problem without actually
being able to run it, but I'll give you some suggestions about things
that I try when I get a seg fault:

  - Call "print(lbres)" right before you call gsn_create_labelbar,
    to make sure there aren't any resource values that are bogus or
    wrong.  (Please email me this output.)

  - Try drawing the labelbar by itself, before calling
    gsn_add_annotation, to make sure it looks okay:

     draw(lbid)
     frame(wks)

  - "print(amres)" to also make sure these resources are okay.

Is there something unusual about "plot" that you are trying to
attach the labelbar to?  For example, have you already attached
a lot of things to it, like text strings?

--Mary



On Mon, 15 Sep 2008, Marco Pastore wrote:

TX, Mary. Now i try to execute my script with -x option, but i know that
the exactly line where my script abends is these one:

annoid = gsn_add_annotation(plot,lbid,amres)

I create manually labelbars, because i need also to duplicate it for
velocity plots, and the two labelbars should be identical, but with
values in different scale (m/s and knots).

Now i try also to delete the three resources that have no effect in
labelbar production.

var_ix = 2 means that i am plotting the velocity map

Marco

Mary Haley ha scritto:

      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@cnMinLevelValF���� = gsn_MinLevelVal(var_ix,dpt_ix)
      �� lbres@cnMaxLevelValF���� = gsn_MaxLevelVal(var_ix,dpt_ix)
      �� lbres@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
&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;
            &#65533;&#65533;
            &#65533;&#65533; getvaluesplot&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65
533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65
            533;&#65533; ; Get plot size for use in
            &#65533;&#65533;&#65533;&#65533; "vpHeightF" :vph&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#655
            33;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;
            ; creating labelbar.
            &#65533;&#65533;&#65533;&#65533;
            "vpWidthF"&#65533; : vpw&#65533;
            &#65533;&#65533; end getvalues
            &#65533;
            &#65533;&#65533; getvalues plot@contour&#65533;
            &#65533;&#65533;&#65533;&#65533;"cnFillColors"&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#
            65533;&#65533; : colors
            &#65533;&#65533;&#65533;&#65533;
            "cnInfoLabelFontHeightF" : font_height
            &#65533;&#65533;&#65533;&#65533;
            "cnInfoLabelPerimColor"&#65533; : perim
            &#65533;&#65533; end getvalues
            &#65533;
            &#65533;&#65533; levels =
            fspan(gsn_MinLevelVal(var_ix,dpt_ix),gsn_MaxLevelVal(var_ix,dpt_ix),lbl_box+1)
            &#65533;&#65533; labels =
            ""+decimalPlaces(levels,1,True)
            &#65533;
            &#65533;&#65533;lbres&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#6
            5533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;
            =
            True&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;
            ; labelbar only resources
            &#65533;&#65533;
            lbres@lbBoxLineColor&#65533;&#65533;&#65533;&#65533;
            = perim
            &#65533;&#65533; lbres@lbBoxLineThicknessF= 1.0
            &#65533;&#65533;lbres@lbPerimOn&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&
            #65533; = False
            &#65533;&#65533;lbres@vpWidthF&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#
            65533;&#65533; = 0.9 *
            vpw&#65533;&#65533;&#65533;&#65533; ; labelbar
            width
            &#65533;&#65533;lbres@vpHeightF&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&
            #65533; = 0.1 *
            vph&#65533;&#65533;&#65533;&#65533; ; labelbar
            height
            &#65533;&#65533; lbres@lbBoxMajorExtentF&#65533;
            =1&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533
            ;&#65533;&#65533; ; relative dimension of the
            boxes
            &#65533;&#65533; lbres@lbBoxMinorExtentF&#65533;
            = 0.4
            &#65533;&#65533;
            if (var_ix.eq.2) then
            &#65533;&#65533; lbres@lbBoxMinorExtentF&#65533;
            =
            0.35&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;
            ; relative dimension of the
            boxes for velocity
            end if
            &#65533;
            &#65533;&#65533;
            lbres@lbOrientation&#65533;&#65533;&#65533;&#65533;&#65533;
            = "Horizontal"&#65533; ; Orientamento delle boxes
            &#65533;&#65533;
            lbres@lbFillColors&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;
            =
            colors&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;
            ; labelbar colors
            &#65533;&#65533; lbres@lbMonoFillPattern&#65533;
            =
            True&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;
            ; Solid fill pattern
            &#65533;&#65533; lbres@lbLabelFontHeightF =
            font_height&#65533;&#65533; ; font height.
            default is
            small less values, bigger fonts
            &#65533;&#65533;
            lbres@lbLabelJust&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;
            = "CenterCenter"; "CenterLeft"&#65533; ; left
            justify labels
            &#65533;&#65533;
            lbres@cnMinLevelValF&#65533;&#65533;&#65533;&#65533;
            = gsn_MinLevelVal(var_ix,dpt_ix)
            &#65533;&#65533;
            lbres@cnMaxLevelValF&#65533;&#65533;&#65533;&#65533;
            = gsn_MaxLevelVal(var_ix,dpt_ix)
            &#65533;&#65533;
            lbres@cnLevelSpacingF&#65533;&#65533;&#65533; =
            spacing
            &#65533;&#65533;
            lbres@lbLabelStride&#65533;&#65533;&#65533;&#65533;&#65533;
            = lbl_stride
            &#65533;&#65533;
            &#65533;&#65533;
            &#65533;&#65533; lbid =
            gsn_create_labelbar(wks,dimsizes(levels)+1,labels,lbres)
            &#65533;&#65533;
            &#65533;&#65533;amres&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#6
            5533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;
            =True&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65
            533;&#65533; ; resurce to place the new
            labelbar
            &#65533;&#65533;amres@amZone&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65
            533;&#65533;&#65533;&#65533; = 2
            &#65533;&#65533;
            amres@amParallelPosF&#65533;&#65533;&#65533;&#65533;
            =0.5&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#655
            33;&#65533; ; Center labelbar.
            &#65533;&#65533;
            amres@amOrthogonalPosF&#65533;&#65533; = 0.05
            &#65533;&#65533;amres@amJust&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65
            533;&#65533;&#65533;&#65533; =&#65533;
            "CenterCenter"; "TopRight"; "CenterCenter"
            ; Punto di ancoraggio della nuova risorsa
            &#65533;
            &#65533;&#65533; annoid =
            gsn_add_annotation(plot,lbid,amres)
            &#65533;&#65533;
            &#65533;&#65533; ; Second Label in Miles for
            Velocity
            &#65533;
            if (var_ix.eq.2) then
            &#65533;&#65533; labels =
            ""+decimalPlaces((levels*3600/mile),1,True) ;
            Conversion in
            miles
            &#65533;&#65533; lbid2 =
            gsn_create_labelbar(wks,dimsizes(levels)+1,labels,lbres)
            &#65533;
            &#65533;&#65533;
            amres@amOrthogonalPosF&#65533;&#65533; = 0.12
            &#65533;
            &#65533;&#65533; annoid2 =
            gsn_add_annotation(plot,lbid2,amres)

            end if

            &#65533;&#65533; delete(colors)
            &#65533;&#65533; delete(levels)
            &#65533;&#65533; delete(font_height)
            &#65533;&#65533; delete(perim)
            &#65533;&#65533; delete(labels)
            ; ***************LABEL BAR
            *************&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;

            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


            ###�� ###�� ### ### ###

    ________________________________________________________________________
 No virus found in this incoming message.
Checked by AVG. Version: 7.5.524 / Virus Database: 270.6.21/1667 - Release Date: 11/09/2008 18.55




 -- ###   ###   ### ### ###

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


###   ###   ### ### ###


No virus found in this incoming message. Checked by AVG. Version: 7.5.524 / Virus Database: 270.6.21/1667 - Release Date: 11/09/2008 18.55


-- 
###   ###   ### ### ###

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
    

###   ###   ### ### ### 

Variable: lbres
Type: logical
Total Size: 4 bytes
            1 values
Number of Dimensions: 1
Dimensions and sizes: [1]
Coordinates:
Number Of Attributes: 13
  lbLabelStride : 6
  lbLabelJust : CenterCenter
  lbLabelFontHeightF : 0.01419519
  lbMonoFillPattern : True
  lbFillColors : <ARRAY of 52 elements>
  lbOrientation : Horizontal
  lbBoxMinorExtentF : 0.35
  lbBoxMajorExtentF : 1
  vpHeightF : 0.075
  vpWidthF : 0.6387835
  lbPerimOn : False
  lbBoxLineThicknessF : 1
  lbBoxLineColor : 1
(0) True

Variable: amres
Type: logical
Total Size: 4 bytes
            1 values
Number of Dimensions: 1
Dimensions and sizes: [1]
Coordinates:
Number Of Attributes: 4
  amJust : CenterCenter
  amOrthogonalPosF : 0.05
  amParallelPosF : 0.5
  amZone : 2
(0) True
(0) 2008-09-15 17:11:02 Region Adriatic depth -0 day: 1 of: 1 DONE
(0) 2008-09-15 17:11:03 Region Adriatic depth -0 :Simulation loop
(0) 2008-09-15 17:11:03 Region Adriatic depth -0 day: 1 of: 1

Variable: lbres
Type: logical
Total Size: 4 bytes
            1 values
Number of Dimensions: 1
Dimensions and sizes: [1]
Coordinates:
Number Of Attributes: 13
  lbLabelStride : 6
  lbLabelJust : CenterCenter
  lbLabelFontHeightF : 0.01419519
  lbMonoFillPattern : True
  lbFillColors : <ARRAY of 52 elements>
  lbOrientation : Horizontal
  lbBoxMinorExtentF : 0.35
  lbBoxMajorExtentF : 1
  vpHeightF : 0.075
  vpWidthF : 0.6387835
  lbPerimOn : False
  lbBoxLineThicknessF : 1
  lbBoxLineColor : 1
(0) True

Variable: amres
Type: logical
Total Size: 4 bytes
            1 values
Number of Dimensions: 1
Dimensions and sizes: [1]
Coordinates:
Number Of Attributes: 4
  amJust : CenterCenter
  amOrthogonalPosF : 0.05
  amParallelPosF : 0.5
  amZone : 2
(0) True
(0) 2008-09-15 17:11:41 Region Adriatic depth -0 day: 1 of: 1 DONE
(0) 2008-09-15 17:11:41 Region Adriatic depth -2 skipped
(0) 2008-09-15 17:11:41 Region Adriatic depth -5 is plotting
(0) 2008-09-15 17:11:41 Region Adriatic depth -5 :Forecast loop
(0) 2008-09-15 17:11:41 Region Adriatic depth -5 day: 1 of: 1

Variable: lbres
Type: logical
Total Size: 4 bytes
            1 values
Number of Dimensions: 1
Dimensions and sizes: [1]
Coordinates:
Number Of Attributes: 13
  lbLabelStride : 6
  lbLabelJust : CenterCenter
  lbLabelFontHeightF : 0.01419519
  lbMonoFillPattern : True
  lbFillColors : <ARRAY of 52 elements>
  lbOrientation : Horizontal
  lbBoxMinorExtentF : 0.35
  lbBoxMajorExtentF : 1
  vpHeightF : 0.075
  vpWidthF : 0.6387835
  lbPerimOn : False
  lbBoxLineThicknessF : 1
  lbBoxLineColor : 1
(0) True

Variable: amres
Type: logical
Total Size: 4 bytes
            1 values
Number of Dimensions: 1
Dimensions and sizes: [1]
Coordinates:
Number Of Attributes: 4
  amJust : CenterCenter
  amOrthogonalPosF : 0.05
  amParallelPosF : 0.5
  amZone : 2
(0) True
Segmentation fault
vmimage_at_brachetto1c:~/pastore/AFS_SITE$

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

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