RickKessler / SNANA

Supernova Analysis package
38 stars 23 forks source link

Error message in simulation: *** stack smashing detected ***: terminated Aborted (core dumped) #946

Closed anibal-art closed 2 years ago

anibal-art commented 2 years ago

Hi, I'm trying to run a SNANA simulation and an error message arise, this is all the output with the abort message

(base) anibal@anibal-VivoBook-15-ASUS-Laptop-X540UAR:~/Escritorio/sim_ulens$ snlc_sim.exe SIMGEN_TEMPLATE_LSST.input

 ****************************************************************** 
   Begin execution of snlc_sim.exe    
 SNDATA_ROOT = /home/anibal/SNDATA_ROOT 
 SNANA_DIR   = /home/anibal/SNANA 
   Full command: snlc_sim.exe SIMGEN_TEMPLATE_LSST.input 

  ######################################################## 
     INIT_SNVAR: Init variables.
  ######################################################## 

   HOST MACHINE =    ()
   SNDATA_ROOT = /home/anibal/SNDATA_ROOT
   SNANA_DIR = /home/anibal/SNANA    (v11_04k)
   Allocate 12.50 MB for CIDMASK array (to check duplicates)
   sizeof(INPUTS) =   1.641 MB 
   sizeof(GENLC)  =   9.638 MB 

  init_SNDATA_GLOBAL: 
 --------------------------------------------------------
  Initialize NstringMatch for sim-input file
  Read 91 words from user input file 1: 
     SIMGEN_TEMPLATE_LSST.input 
 --------------------------------------------------------
  Read 14 words from user input file 2: 
     SIMGEN_INCLUDE_LCLIB_uLens-Single-PyLIMA.input 

 ****************************************************************** 
   init_HzFUN_INFO  
     H0         = 70.00      # km/s/Mpc 
     OM, OL, Ok = 0.31500, 0.68500, 0.00000 
     w0, wa     = -1.000,  0.000 

 ****************************************************************** 
    prep_user_inputs summary   
     SIMLIB file        : /home/anibal/Escritorio/sim_ulens/SNANA_LSST_ROOT/simlibs/PLASTICC_ORIGINAL_DDF.SIMLIB   (start LIBID=0)
     Generation Version : uLens_test 
     Generation source  : RANDOM 
     Generation model   : LCLIB 
     Number of LC to Generate: 0 
     OMEGA_(MATTER,LAMBDA)= 0.315, 0.685,    w0= -1.00   H0= 70.0 
     KCOR  file : /home/anibal/Escritorio/sim_ulens/SNANA_LSST_ROOT/kcor/2017-04_approx/kcor_LSST.fits 
     Observer Gen-FILTERS  :  ugrizY  
     Random number seed: 123459  (NSTREAM=2)
     Gen-Range for RA(deg)  : -360.000 to  360.000 
     Gen-Range for DEC(deg): -360.000 to  360.000 
     Gen-Range for ZCMB :  0.000 to  0.000  (sigma= 0.0000, bias=0.00000) 
     Gen-Range for PEAKMJD  :  59570.0 to  59570.0  
     Gen-Range for Trest    :      0.0 to   1105.0  days 
     Gen-Range for SHAPEPAR  :      0.0 to      0.0  
     Gen-Range for AV  : -9.00 to -9.00  (dN/dAv = exp(-AV/-9.00) 
     Gen-Mean  for RV  : 3.10  
     Gen-sigma for RV  : 0.00 , 0.00 (lower , upper ) 
     Gen-Range for RV  : 1.00 to 5.00 
     ZP offsets (ugrizY) :  0.000 0.000 0.000 0.000 0.000 0.000
     MODEL mag offsets (ugrizY) :   0.00  0.00  0.00  0.00  0.00  0.00

 ****************************************************************** 
    init_RANDOMsource : CIDOFF=0   

 ****************************************************************** 
   SIMLIB_readGlobalHeader_TEXT  
     Opened : /home/anibal/Escritorio/sim_ulens/SNANA_LSST_ROOT/simlibs/PLASTICC_ORIGINAL_DDF.SIMLIB 

 ****************************************************************** 
   SIMLIB_prepGlobalHeader  
     SIMLIB Survey    : LSST 
     SIMLIB telescope : LSST 
     SIMLIB Field : VOID 
     SIMLIB Pixel Saturation: 3900000 photoelectrons. 
     SIMLIB Filters   : ugrizY 
     SIMLIB created by: rbisw 
     SIMLIB PSF unit:    PIXEL_SIGMA 
     SIMLIB SKYSIG unit: ADU_PER_SQPIXEL 
   SIMULATED RATE(BPOLY)
 dN/db = POLY(20383,-1757.7,65.293,-1.1885,0.10405E-01,-0.35119E-04)
 Calculated Number of EVENTS per season = 1400  (NGENTOT_LC)

 ****************************************************************** 
   Initialize SEARCH EFFICIENCY for 'LSST' 

   Read Detection-efficiency curves: 
     Epoch SEARCH_EFF(u) =  1.00 at SNR = 15.00      Epoch SEARCH_EFF(u) =  0.46 at SNR =  5.50      Epoch SEARCH_EFF(g) =  1.00 at SNR = 15.00      Epoch SEARCH_EFF(g) =  0.46 at SNR =  5.50      Epoch SEARCH_EFF(r) =  1.00 at SNR = 50.00      Epoch SEARCH_EFF(r) =  0.43 at SNR =  5.00      Epoch SEARCH_EFF(i) =  1.00 at SNR = 50.00      Epoch SEARCH_EFF(i) =  0.54 at SNR =  5.50      Epoch SEARCH_EFF(z) =  1.00 at SNR = 50.00      Epoch SEARCH_EFF(z) =  0.47 at SNR =  5.00      Epoch SEARCH_EFF(Y) =  1.00 at SNR = 50.00      Epoch SEARCH_EFF(Y) =  0.47 at SNR =  5.00 
   Fetch SOFTWARE SEARCH-LOGIC from :    /home/anibal/Escritorio/sim_ulens/SNANA_LSST_ROOT/models/searcheff/SEARCHEFF_PIPELINE_LOGIC.DAT     Logic: 2 MJDs require filters=u+g+r+i+z+Y   Trigger epoch contains all obs withing 0.021 days

   Reading spectroscopic efficiency from 
     /home/anibal/Escritorio/sim_ulens/SNANA_LSST_ROOT/models/searcheff/PLASTICC_ORIGINAL_LSST_SPECEFF.DAT
   WARNING: Should remove obsolete NVAR key from /home/anibal/Escritorio/sim_ulens/SNANA_LSST_ROOT/models/searcheff/PLASTICC_ORIGINAL_LSST_SPECEFF.DAT
    Load GRIDMAP-030 'SPECEFF:(i SPECEFF)'  NROW=3 
     malloc_GRIDMAP: allocate
     for FIELDLIST=ALL
   WARNING: Should remove obsolete NVAR key from /home/anibal/Escritorio/sim_ulens/SNANA_LSST_ROOT/models/searcheff/PLASTICC_ORIGINAL_LSST_SPECEFF.DAT
    Load GRIDMAP-031 'SPECEFF:(i SPECEFF)'  NROW=79 
     malloc_GRIDMAP: allocate
     for FIELDLIST=ALL

   Read zHOST-for-unconfirmed effic map from 
     /home/anibal/Escritorio/sim_ulens/SNANA_LSST_ROOT/models/searcheff/PLASTICC_ORIGINAL_zHOST_4MOST_DDF.DAT

   Read zHOST-for-unconfirmed effic map from 
     /home/anibal/Escritorio/sim_ulens/SNANA_LSST_ROOT/models/searcheff/PLASTICC_ORIGINAL_zHOST_4MOST_DDF.DAT
     Stored 65 redshift bins for SEARCHEFF_zHOST map. 

  ============================================= 
  RDKCOR_FITS: Read Calib/Kcor tables.
    Opened /home/anibal/Escritorio/sim_ulens/SNANA_LSST_ROOT/kcor/2017-04_approx/kcor_LSST.fits
    with Blocksize=  1   and ISTAT=     0

      RDKCOR_FITS_HEAD    
         Read VERSION      =   3  (kcor.exe version)
         Read NPRIM        =   1  primary refs
         Read NFILTERS     =   6  filters
         Read NKCOR        =   0  K-COR tables
      RDKCOR_FITS_ZPT 
      RDKCOR_FITS_SNSED 
      RDKCOR_FITS_KCOR  
      RDKCOR_FITS_MAGS  
      RDKCOR_FITS_FILTERS 
      RDKCOR_FITS_PRIMARYSED  
      FTCLOSE  
         ---------------------- 
         !!! RDKCOR_SUMMARY !!! 
         ---------------------- 
    Primary spectrum: AB                                      

  FILTER SUMMARY (RDKCOR) : 
  internal                    LAM  LAM   rest-lam      primary
  index name                  AVG  RMS   kcor range    mag   ZP
 ------------------------------------------------------------------
  01 LSST-u                  3671  198      0-    0   0.000  0.000
  02 LSST-g                  4827  424      0-    0   0.000  0.000
  03 LSST-r                  6223  406      0-    0   0.000  0.000
  04 LSST-i                  7546  376      0-    0   0.000  0.000
  05 LSST-z                  8691  305      0-    0   0.000  0.000
  06 LSST-Y                  9710  338      0-    0   0.000  0.000
 ------------------------------------------------------------------
    NFILTDEF[SURVEY,REST] =    6   0

   RDKCOR: Done. 
  ---------------------------------------------- 

    Zeropoint offsets (ZPOFF) from : KCOR file
         Will apply net MAGOBS_SHIFT_ZP(u) =  0.0000
         Will apply net MAGOBS_SHIFT_ZP(g) =  0.0000
         Will apply net MAGOBS_SHIFT_ZP(r) =  0.0000
         Will apply net MAGOBS_SHIFT_ZP(i) =  0.0000
         Will apply net MAGOBS_SHIFT_ZP(z) =  0.0000
         Will apply net MAGOBS_SHIFT_ZP(Y) =  0.0000

 ****************************************************************** 
   init_genmag_LCLIB  
     Template epoch  0 : 1.000 days 
     Template epoch  1 : 2.000 days 
     Template epoch  2 : 3.000 days 
     Template epoch  3 : 4.000 days 
     Template epoch range: 3.00 days 

     Opened : /home/anibal/Escritorio/sim_ulens/SNANA_LSST_ROOT/PLASTICC_MODELS/LCLIB_uLens-Single-PyLIMA.TEXT 
     MODEL: uLens_GaiaStar  (NON-RECUR) 
       ModelParam-00(TEFF)    
       ModelParam-01(LOGG)    
       ModelParam-02(GAIA_DIST)    
       ModelParam-03(DIST)    
       ModelParam-04(T0)    
       ModelParam-05(U0)    
       ModelParam-06(TE)    
       ModelParam-07(EVENT_ID)    

 ****************************************************************** 
   init_modelSmear: init intrinsic SN smearing with model=NONE  
     Smear-mode: interpolate from central filter wavelengths.

 ****************************************************************** 
   README_DOCANA_DRIVER: Prepare README content (iflag=1)  

 ****************************************************************** 
   clr_VERSION  
     LCMERGE Version uLens_test does not exist. 
     SIM Version uLens_test exists. 
     PHOTOMETRY Version uLens_test does not exist. 
     Removing version uLens_test files ... 
 execute command: rm -rf  /home/anibal/SNDATA_ROOT/SIM/uLens_test/  
 Done. 

 ****************************************************************** 
   Init SIMGEN_DUMP file   
     open /home/anibal/SNDATA_ROOT/SIM/uLens_test/uLens_test.DUMP

 ****************************************************************** 
   WR_SNFITSIO_INIT  

 ****************************************************************** 
   set_TIMERS  
     Sim-init time: 1.0 sec 

 ****************************************************************** 
    Begin Generating Lightcurves.   
     Finished generating        1 of 1400 (CID=1) 
*** stack smashing detected ***: terminated
Aborted (core dumped)

As a previous task in order to run this simulation I add the same DOCANA block at the top of the file, for all the files that the simulation needed. If I didn't then this error message arise for every file needed

  PRE-ABORT DUMP from function react_missing_docana : 

  Missing required 'DOCUMENTATION:'  key in 
    /home/anibal/Escritorio/sim_ulens/SNANA_LSST_ROOT/models/searcheff/PLASTICC_ORIGINAL_LSST_SPECEFF.DAT 
  See DOCANA examples with linux command: 
    grep -R DOCUMENTATION_END $SNDATA_ROOT 
  File must begin with 'DOCUMENTATION:' key

   `|```````|`    
   <| o\ /o |>    
    | ' ; ' |     
    |  ___  |     ABORT program on Fatal Error. 
    | |' '| |     
    | `---' |     
    \_______/    

 FATAL ERROR ABORT called by react_missing_docana
   See DOCANA error above. Must add DOCUMENTATION block to
   /home/anibal/Escritorio/sim_ulens/SNANA_LSST_ROOT/models/searcheff/PLASTICC_ORIGINAL_LSST_SPECEFF.DAT 

A bad declaration for the DOCANA block could be the reason for the first error?

RickKessler commented 2 years ago

I compiled codes with -Wall (ALL warnings) and fixed many of them. They all seem to be harmless (e.g., unused variable declaration), except for one fix that might have caused stack smash. Please try again.

anibal-art commented 2 years ago

The problem is solved. Just install the software again (with GSL and CFITSIO) and this time it works. Thanks.