SIGSEGV: Segmentation fault

Post questions and find resources to convert meteorological data into a format HYSPLIT can read.
kto031
Posts: 25
Joined: February 20th, 2014, 3:05 pm
Registered HYSPLIT User: Yes

SIGSEGV: Segmentation fault

Post by kto031 »

Hi.
I'm trying to convert some WRF-ARW files to ARL, but keep getting this error message:

[ktofte@yslogin2 working]$ ./../exec/arw2arl -iwrfout_d03_2010-01-20_00:00:00.nc
Using an existing decoding configuration: WRFDATA.CFG
Using an existing encoding configuration: ARLDATA.CFG
NOTICE pakset:
Number of index records = 1
Number of records /time = 216
NetCDF: Start+count exceeds dimension bound
NOTICE pakini: start initialization rec = 1
NOTICE pakini: end initialization rec = 216
NetCDF: Start+count exceeds dimension bound
NetCDF: Start+count exceeds dimension bound
NetCDF: Start+count exceeds dimension bound
NetCDF: Start+count exceeds dimension bound
NetCDF: Start+count exceeds dimension bound
NetCDF: Start+count exceeds dimension bound
NetCDF: Start+count exceeds dimension bound
NetCDF: Start+count exceeds dimension bound
NetCDF: Start+count exceeds dimension bound
NetCDF: Start+count exceeds dimension bound
NetCDF: Start+count exceeds dimension bound

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0 0x2AF3BA8F22E7
#1 0x2AF3BA8F28EE
#2 0x3E9483291F
#3 0x407C3D in MAIN__ at arw2arl.f:0
Segmentation fault (core dumped)

I found this online: This signal is generated when a program tries to read or write outside the memory that is allocated for it, or to write memory that can only be read. (Actually, the signals only occur when the program goes far enough outside to be detected by the system’s memory protection mechanism.) The name is an abbreviation for “segmentation violation”.
Common ways of getting a SIGSEGV condition include dereferencing a null or uninitialized pointer, or when you use a pointer to step through an array, but fail to check for the end of the array. It varies among systems whether dereferencing a null pointer generates SIGSEGV or SIGBUS. But I'm not sure how to fix it.

Help would be greatly appreciated.

-Kristine
ariel.stein
Posts: 660
Joined: November 7th, 2012, 3:14 pm
Registered HYSPLIT User: Yes

Re: SIGSEGV: Segmentation fault

Post by ariel.stein »

Are you running the latest version of arw2arl? If yes, please send me the WRF output file (wrfout_d03_2010-01-20_00:00:00.nc) you were trying to convert.
kto031
Posts: 25
Joined: February 20th, 2014, 3:05 pm
Registered HYSPLIT User: Yes

Re: SIGSEGV: Segmentation fault

Post by kto031 »

I had to change the vertical levels (e_vert) from 30 to 35 in the namelist.input, and now it runs fine.
Do you know why that is?

-Kristine
ariel.stein
Posts: 660
Joined: November 7th, 2012, 3:14 pm
Registered HYSPLIT User: Yes

Re: SIGSEGV: Segmentation fault

Post by ariel.stein »

Can you please send me a sample of the file that gives you the error?
kto031
Posts: 25
Joined: February 20th, 2014, 3:05 pm
Registered HYSPLIT User: Yes

Re: SIGSEGV: Segmentation fault

Post by kto031 »

How do I add files to an email in here? Could I just send you parts of the ncdump -h wrfout_d03_2010_01_20_00:00:00.nc file that I have?

-Kristine
ariel.stein
Posts: 660
Joined: November 7th, 2012, 3:14 pm
Registered HYSPLIT User: Yes

Re: SIGSEGV: Segmentation fault

Post by ariel.stein »

OK, send me the header information
kto031
Posts: 25
Joined: February 20th, 2014, 3:05 pm
Registered HYSPLIT User: Yes

Re: SIGSEGV: Segmentation fault

Post by kto031 »

Here is the header to the file that did work:

// global attributes:
:TITLE = " OUTPUT FROM WRF V3.5.1 MODEL" ;
:START_DATE = "2010-01-20_00:00:00" ;
:SIMULATION_START_DATE = "2010-01-20_00:00:00" ;
:WEST-EAST_GRID_DIMENSION = 151 ;
:SOUTH-NORTH_GRID_DIMENSION = 151 ;
:BOTTOM-TOP_GRID_DIMENSION = 35 ;
:DX = 3333.33f ;
:DY = 3333.33f ;
:STOCH_FORCE_OPT = 0 ;
:GRIDTYPE = "C" ;
:DIFF_OPT = 1 ;
:KM_OPT = 4 ;
:DAMP_OPT = 0 ;
:DAMPCOEF = 0.2f ;
:KHDIF = 0.f ;
:KVDIF = 0.f ;
:MP_PHYSICS = 3 ;
:RA_LW_PHYSICS = 1 ;
:RA_SW_PHYSICS = 1 ;
:SF_SFCLAY_PHYSICS = 1 ;
:SF_SURFACE_PHYSICS = 2 ;
:BL_PBL_PHYSICS = 1 ;
:CU_PHYSICS = 0 ;
:SURFACE_INPUT_SOURCE = 1 ;
:SST_UPDATE = 1 ;
:GRID_FDDA = 0 ;
:GFDDA_INTERVAL_M = 0 ;
:GFDDA_END_H = 0 ;
:GRID_SFDDA = 0 ;
:SGFDDA_INTERVAL_M = 0 ;
:SGFDDA_END_H = 0 ;
:HYPSOMETRIC_OPT = 2 ;
:SF_URBAN_PHYSICS = 0 ;
:SHCU_PHYSICS = 0 ;
:MFSHCONV = 0 ;
:FEEDBACK = 1 ;
:SMOOTH_OPTION = 0 ;
:SWRAD_SCAT = 1.f ;
:W_DAMPING = 0 ;
:DT = 20.f ;
:RADT = 30.f ;
:BLDT = 0.f ;
:CUDT = 5.f ;
:SWINT_OPT = 0 ;
:MOIST_ADV_OPT = 1 ;
:SCALAR_ADV_OPT = 1 ;
:TKE_ADV_OPT = 1 ;
:DIFF_6TH_OPT = 0 ;
:DIFF_6TH_FACTOR = 0.12f ;
:OBS_NUDGE_OPT = 0 ;
:BUCKET_MM = -1.f ;
:BUCKET_J = -1.f ;
:PREC_ACC_DT = 0.f ;
:SF_OCEAN_PHYSICS = 0 ;
:ISFTCFLX = 0 ;
:ISHALLOW = 0 ;
:DFI_OPT = 0 ;
:WEST-EAST_PATCH_START_UNSTAG = 1 ;
:WEST-EAST_PATCH_END_UNSTAG = 150 ;
:WEST-EAST_PATCH_START_STAG = 1 ;
:WEST-EAST_PATCH_END_STAG = 151 ;
:SOUTH-NORTH_PATCH_START_UNSTAG = 1 ;
:SOUTH-NORTH_PATCH_END_UNSTAG = 150 ;
:SOUTH-NORTH_PATCH_START_STAG = 1 ;
:SOUTH-NORTH_PATCH_END_STAG = 151 ;
:BOTTOM-TOP_PATCH_START_UNSTAG = 1 ;
:BOTTOM-TOP_PATCH_END_UNSTAG = 34 ;
:BOTTOM-TOP_PATCH_START_STAG = 1 ;
:BOTTOM-TOP_PATCH_END_STAG = 35 ;
:GRID_ID = 3 ;
:PARENT_ID = 2 ;
:I_PARENT_START = 105 ;
:J_PARENT_START = 95 ;
:PARENT_GRID_RATIO = 3 ;
:CEN_LAT = 20.77044f ;
:CEN_LON = -156.2695f ;
:TRUELAT1 = 15.f ;
:TRUELAT2 = 35.f ;
:MOAD_CEN_LAT = 20.99999f ;
:STAND_LON = -157.f ;
:POLE_LAT = 90.f ;
:POLE_LON = 0.f ;
:GMT = 0.f ;
:JULYR = 2010 ;
:JULDAY = 20 ;
:MAP_PROJ = 1 ;
:MAP_PROJ_CHAR = "Lambert Conformal" ;
:MMINLU = "USGS" ;
:NUM_LAND_CAT = 24 ;
:ISWATER = 16 ;
:ISLAKE = -1 ;
:ISICE = 24 ;
:ISURBAN = 1 ;
:ISOILWATER = 14 ;
kto031
Posts: 25
Joined: February 20th, 2014, 3:05 pm
Registered HYSPLIT User: Yes

Re: SIGSEGV: Segmentation fault

Post by kto031 »

Seems like me first message didn't get through. Here the ncdump -h to the file that did not work:

// global attributes:
:TITLE = " OUTPUT FROM WRF V3.5.1 MODEL" ;
:START_DATE = "2010-01-20_00:00:00" ;
:SIMULATION_START_DATE = "2010-01-20_00:00:00" ;
:WEST-EAST_GRID_DIMENSION = 136 ;
:SOUTH-NORTH_GRID_DIMENSION = 136 ;
:BOTTOM-TOP_GRID_DIMENSION = 30 ;
:DX = 3333.33f ;
:DY = 3333.33f ;
:STOCH_FORCE_OPT = 0 ;
:GRIDTYPE = "C" ;
:DIFF_OPT = 1 ;
:KM_OPT = 4 ;
:DAMP_OPT = 0 ;
:DAMPCOEF = 0.2f ;
:KHDIF = 0.f ;
:KVDIF = 0.f ;
:MP_PHYSICS = 3 ;
:RA_LW_PHYSICS = 1 ;
:RA_SW_PHYSICS = 1 ;
:SF_SFCLAY_PHYSICS = 1 ;
:SF_SURFACE_PHYSICS = 2 ;
:BL_PBL_PHYSICS = 1 ;
:CU_PHYSICS = 0 ;
:SURFACE_INPUT_SOURCE = 1 ;
:SST_UPDATE = 1 ;
:GRID_FDDA = 0 ;
:GFDDA_INTERVAL_M = 0 ;
:GFDDA_END_H = 0 ;
:GRID_SFDDA = 0 ;
:SGFDDA_INTERVAL_M = 0 ;
:SGFDDA_END_H = 0 ;
:HYPSOMETRIC_OPT = 2 ;
:SF_URBAN_PHYSICS = 0 ;
:SHCU_PHYSICS = 0 ;
:MFSHCONV = 0 ;
:FEEDBACK = 1 ;
:SMOOTH_OPTION = 0 ;
:SWRAD_SCAT = 1.f ;
:W_DAMPING = 0 ;
:DT = 20.f ;
:RADT = 30.f ;
:BLDT = 0.f ;
:CUDT = 5.f ;
:SWINT_OPT = 0 ;
:MOIST_ADV_OPT = 1 ;
:SCALAR_ADV_OPT = 1 ;
:TKE_ADV_OPT = 1 ;
:DIFF_6TH_OPT = 0 ;
:DIFF_6TH_FACTOR = 0.12f ;
:OBS_NUDGE_OPT = 0 ;
:BUCKET_MM = -1.f ;
:BUCKET_J = -1.f ;
:PREC_ACC_DT = 0.f ;
:SF_OCEAN_PHYSICS = 0 ;
:ISFTCFLX = 0 ;
:ISHALLOW = 0 ;
:DFI_OPT = 0 ;
:WEST-EAST_PATCH_START_UNSTAG = 1 ;
:WEST-EAST_PATCH_END_UNSTAG = 135 ;
:WEST-EAST_PATCH_START_STAG = 1 ;
:WEST-EAST_PATCH_END_STAG = 136 ;
:SOUTH-NORTH_PATCH_START_UNSTAG = 1 ;
:SOUTH-NORTH_PATCH_END_UNSTAG = 135 ;
:SOUTH-NORTH_PATCH_START_STAG = 1 ;
:SOUTH-NORTH_PATCH_END_STAG = 136 ;
:BOTTOM-TOP_PATCH_START_UNSTAG = 1 ;
:BOTTOM-TOP_PATCH_END_UNSTAG = 29 ;
:BOTTOM-TOP_PATCH_START_STAG = 1 ;
:BOTTOM-TOP_PATCH_END_STAG = 30 ;
:GRID_ID = 3 ;
:PARENT_ID = 2 ;
:I_PARENT_START = 105 ;
:J_PARENT_START = 92 ;
:PARENT_GRID_RATIO = 3 ;
:CEN_LAT = 20.27075f ;
:CEN_LON = -156.5149f ;
:TRUELAT1 = 15.f ;
:TRUELAT2 = 35.f ;
:MOAD_CEN_LAT = 20.99999f ;
:STAND_LON = -157.f ;
:POLE_LAT = 90.f ;
:POLE_LON = 0.f ;
:GMT = 0.f ;
:JULYR = 2010 ;
:JULDAY = 20 ;
:MAP_PROJ = 1 ;
:MAP_PROJ_CHAR = "Lambert Conformal" ;
:MMINLU = "USGS" ;
:NUM_LAND_CAT = 24 ;
:ISWATER = 16 ;
:ISLAKE = -1 ;
:ISICE = 24 ;
:ISURBAN = 1 ;
:ISOILWATER = 14 ;
ariel.stein
Posts: 660
Joined: November 7th, 2012, 3:14 pm
Registered HYSPLIT User: Yes

Re: SIGSEGV: Segmentation fault

Post by ariel.stein »

It seems you have a problem with the netcdf libraries.
I was able to convert your file in my machine.
You might want to test the file in another machine.
Oleg
Posts: 6
Joined: June 13th, 2019, 11:49 pm
Registered HYSPLIT User: Yes

Re: SIGSEGV: Segmentation fault

Post by Oleg »

Hello,
I recently obtained a similar problem:

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0 0x7ff82863d2ed in ???
#1 0x7ff82863c503 in ???
#2 0x7ff827cb9f0f in ???
#3 0x7ff827e095fd in ???
#4 0x7ff827d18a1d in ???
#5 0x7ff82863ca42 in ???
#6 0x7ff8287bb5fd in ???
#7 0x7ff8287a916b in ???
#8 0x5651aea1dc77 in ???
#9 0x5651aea0606c in ???
#10 0x5651aea038d2 in ???
#11 0x7ff827c9cc86 in ???
#12 0x5651aea03909 in ???
#13 0xffffffffffffffff in ???
./runarw_OS.sh: line 18: 353 Segmentation fault ${EXEC_DIR}/arw2arl -i${WRFOUT_DIR}/wrfout_d02_2022-03-24_00-00-00

HYSPLIT was installed from precompiled binaries created for Ubuntu 18.04. All tests in testing/xrun.scr were successful.
arw2arl was compiled with gfortran in WSL/Ubuntu 18.04 LTS. The same compiler was used to build WRF (including NetCDF). WRF successfully runs and provides outputs.

As I understood from the code of arw2arl, the error is obtained from PAKSET function (line 537 in arw2arl.f). Unfortunately, I cannot find the code of this function in provided version of HYSPLIT. My wrfout file is included.

Thanks in advance for any help/advice.
Attachments
wrfout.zip
(15.95 MiB) Downloaded 8868 times
Post Reply

Return to “Conversion programs”