D Brown
2011-Sep-07 07:22 UTC
[R] Error: in routine alloca() there is a stack overflow: thread 0, max 535822282KB, used 0KB, request 24B
Dear Colleagues: Through your help an R related installation issue was resolved, but I now have the following usage issue. On any "get.var.ncdf" usage I am seeing: Error: in routine alloca() there is a stack overflow: thread 0, max 535822282KB, used 0KB, request 24B The same error is posted on a file as small as 50MB and as large as 500GB, with ulimit set to unlimited. I have seen the 'double netcdf import' references and do not feel that is an issue as netcdf is not being imported (i.e. fails with and without the import). The system is: Red Hat Enterprise Linux AS release 4 (Nahant Update 5), using R-2.13.1 with the latest ncdf package, and netcdf-3.6.2. If someone suggests the latest netcdf, please point me to an associated symptom/fix reference if one is available, but that is likely my next step. Your assistance is greatly appreciated. ### Here is the relevant portion of the R script: # load R libraries library(ncdf) library(maps) library(fields) # file path gcfilename <- "/users/me/MEGANv2.04/Output/latlong_spec2_WOCONV_150s_2004187.ncf" gcfilename.ori <- "/users/me/MEGANv2.04/Output/latlong_spec2_WOCONV_2001187.ncf" # ---------------- # Open file # ---------------- nc <- open.ncdf(gcfilename) nc.ori <- open.ncdf(gcfilename.ori) print ("fininshed open file") print(nc) print("Reading TFLAG") # error occurs on any of the following "get.var.ncdf" calls: tflag<- get.var.ncdf(nc,varid="TFLAG") # So this would produce the failure isop <- get.var.ncdf(nc,varid="ISOPRENE") isop.ori <- get.var.ncdf(nc.ori,varid="ISOPRENE") meoh <- get.var.ncdf(nc,varid="MEOH") meoh.ori <- get.var.ncdf(nc.ori,varid="MEOH") ### Here is the output associated with the print ("fininshed open file") and print(nc) portion of the script: [1] "fininshed open file" [1] "file /users/me/latlong_spec2_WOCONV_150s_2004187.ncf has 6 dimensions:" [1] "TSTEP Size: 2" [1] "DATE-TIME Size: 2" [1] "LAY Size: 1" [1] "VAR Size: 30" [1] "ROW Size: 1200" [1] "COL Size: 2496" [1] "------------------------" [1] "file /users/huxxx249/MEGANv2.04/Output/latlong_spec2_WOCONV_150s_2004187.ncf has 31 variables:" [1] "int TFLAG[DATE-TIME,VAR,TSTEP] Longname:TFLAG Missval:NA" [1] "float ISOPRENE[COL,ROW,LAY,TSTEP] Longname:ISOPRENE Missval:1e+30" [1] "float TRP1[COL,ROW,LAY,TSTEP] Longname:TRP1 Missval:1e+30" [1] "float MEOH[COL,ROW,LAY,TSTEP] Longname:MEOH Missval:1e+30" [1] "float ACET[COL,ROW,LAY,TSTEP] Longname:ACET Missval:1e+30" [1] "float CH4[COL,ROW,LAY,TSTEP] Longname:CH4 Missval:1e+30" [1] "float NO[COL,ROW,LAY,TSTEP] Longname:NO Missval:1e+30" [1] "float NO2[COL,ROW,LAY,TSTEP] Longname:NO2 Missval:1e+30" [1] "float NH3[COL,ROW,LAY,TSTEP] Longname:NH3 Missval:1e+30" [1] "float CCHO[COL,ROW,LAY,TSTEP] Longname:CCHO Missval:1e+30" [1] "float HCOOH[COL,ROW,LAY,TSTEP] Longname:HCOOH Missval:1e+30" [1] "float HCHO[COL,ROW,LAY,TSTEP] Longname:HCHO Missval:1e+30" [1] "float CCO_OH[COL,ROW,LAY,TSTEP] Longname:CCO_OH Missval:1e+30" [1] "float BALD[COL,ROW,LAY,TSTEP] Longname:BALD Missval:1e+30" [1] "float MEK[COL,ROW,LAY,TSTEP] Longname:MEK Missval:1e+30" [1] "float RCO_OH[COL,ROW,LAY,TSTEP] Longname:RCO_OH Missval:1e+30" [1] "float CO[COL,ROW,LAY,TSTEP] Longname:CO Missval:1e+30" [1] "float ETHENE[COL,ROW,LAY,TSTEP] Longname:ETHENE Missval:1e+30" [1] "float ALK1[COL,ROW,LAY,TSTEP] Longname:ALK1 Missval:1e+30" [1] "float ALK2[COL,ROW,LAY,TSTEP] Longname:ALK2 Missval:1e+30" [1] "float ALK3[COL,ROW,LAY,TSTEP] Longname:ALK3 Missval:1e+30" [1] "float ALK4[COL,ROW,LAY,TSTEP] Longname:ALK4 Missval:1e+30" [1] "float ALK5[COL,ROW,LAY,TSTEP] Longname:ALK5 Missval:1e+30" [1] "float ARO1[COL,ROW,LAY,TSTEP] Longname:ARO1 Missval:1e+30" [1] "float ARO2[COL,ROW,LAY,TSTEP] Longname:ARO2 Missval:1e+30" [1] "float OLE1[COL,ROW,LAY,TSTEP] Longname:OLE1 Missval:1e+30" [1] "float OLE2[COL,ROW,LAY,TSTEP] Longname:OLE2 Missval:1e+30" [1] "float RCHO[COL,ROW,LAY,TSTEP] Longname:RCHO Missval:1e+30" [1] "float NONR[COL,ROW,LAY,TSTEP] Longname:NONR Missval:1e+30" [1] "float LAT[COL,ROW,LAY,TSTEP] Longname:LAT Missval:1e+30" [1] "float LONG[COL,ROW,LAY,TSTEP] Longname:LONG Missval:1e+30" [1] "Reading TFLAG" Error: in routine alloca() there is a stack overflow: thread 0, max 535822282KB, used 0KB, request 24B [[alternative HTML version deleted]]
D Brown
2011-Sep-19 16:46 UTC
[R] Error: in routine alloca() there is a stack overflow: thread 0, max 535822282KB, used 0KB, request 24B
In a previous post I detailed the error indicated in the subject. I am posting now to indicate the problem was likely an incompatibility between the versions of netcdf (3.6.2) and ncdf (1.6.5). What I did to resolve the problem was install netcdf-4.1.3 and then reinstalled ncdf_1.6.5. [[alternative HTML version deleted]]