RStan vignette build problems

122 views
Skip to first unread message

Daniel Lee

unread,
Mar 11, 2014, 2:17:28 PM3/11/14
to stan...@googlegroups.com
Anyone have any idea what I should do to fix this problem?


~/dev/rstan/rstan (develop)> mk check
if test -d tmpstanlib; then ln -s ../../../tmpstanlib/ ./rstan/inst/include/stanlib; else ln -s ../../../../stan/lib ./rstan/inst/include/stanlib; fi
ln -s ../../../../stan/src ./rstan/inst/include/stansrc
R --vanilla CMD build rstan --md5   # --no-build-vignettes --no-manual
* checking for file ‘rstan/DESCRIPTION’ ... OK
* preparing ‘rstan’:
* checking DESCRIPTION meta-information ... OK
* cleaning src
* installing the package to process help pages
* saving partial Rd database
* creating vignettes ...sh: line 1: 35217 Segmentation fault: 11  '/Library/Frameworks/R.framework/Resources/bin/Rscript' --vanilla --default-packages= -e "tools::buildVignettes(dir = '.', tangle = TRUE)" > '/var/folders/z7/4wl_4ypj03g3fvr82p135bn00000gn/T//Rtmp2P0RnC/xshell89087e481239' 2>&1
 ERROR
Loading required package: Rcpp
Loading required package: inline

Attaching package: ‘inline’

The following object is masked from ‘package:Rcpp’:

    registerPlugin

rstan (Version 2.2.0, packaged: , GitRev: 68c183a6b42c)

 *** caught segfault ***
address 0x20, cause ‘memory not mapped’

Traceback:
 1: .Call(Module__functions_names, xp)
 2: Module(module, mustStart = TRUE)
 3: .getModulePointer(x)
 4: <S4 object of class "Module">$stan_fit4model89912cdbada0_schools
 5: <S4 object of class "Module">$stan_fit4model89912cdbada0_schools
 6: eval(expr, envir, enclos)
 7: eval(call("$", mod, paste("stan_fit4", model_cppname, sep = "")))
 8: .local(object, ...)
 9: sampling(sm, data, pars, chains, iter, warmup, thin, seed, init,     check_data = TRUE, sample_file = sample_file, diagnostic_file = diagnostic_file,     verbose = verbose, algorithm = match.arg(algorithm), control = control,     ...)
10: sampling(sm, data, pars, chains, iter, warmup, thin, seed, init,     check_data = TRUE, sample_file = sample_file, diagnostic_file = diagnostic_file,     verbose = verbose, algorithm = match.arg(algorithm), control = control,     ...)
11: stan(file = "schools.stan", data = schools_data, iter = 100,     chains = 4)
12: eval(expr, envir, enclos)
13: eval(expr, .GlobalEnv)
14: withVisible(eval(expr, .GlobalEnv))
15: doTryCatch(return(expr), name, parentenv, handler)
16: tryCatchOne(expr, names, parentenv, handlers[[1L]])
17: tryCatchList(expr, classes, parentenv, handlers)
18: tryCatch(expr, error = function(e) {    call <- conditionCall(e)    if (!is.null(call)) {        if (identical(call[[1L]], quote(doTryCatch)))             call <- sys.call(-4L)        dcall <- deparse(call)[1L]        prefix <- paste("Error in", dcall, ": ")        LONG <- 75L        msg <- conditionMessage(e)        sm <- strsplit(msg, "\n")[[1L]]        w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")        if (is.na(w))             w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],                 type = "b")        if (w > LONG)             prefix <- paste0(prefix, "\n  ")    }    else prefix <- "Error : "    msg <- paste0(prefix, conditionMessage(e), "\n")    .Internal(seterrmessage(msg[1L]))    if (!silent && identical(getOption("show.error.messages"),         TRUE)) {        cat(msg, file = stderr())        .Internal(printDeferredWarnings())    }    invisible(structure(msg, class = "try-error", condition = e))})
19: try(withVisible(eval(expr, .GlobalEnv)), silent = TRUE)
20: evalFunc(ce, options)
21: tryCatchList(expr, classes, parentenv, handlers)
22: tryCatch(evalFunc(ce, options), finally = {    cat("\n")    sink()})
23: driver$runcode(drobj, chunk, chunkopts)
24: utils::Sweave(...)
25: engine$weave(file, quiet = quiet)
26: doTryCatch(return(expr), name, parentenv, handler)
27: tryCatchOne(expr, names, parentenv, handlers[[1L]])
28: tryCatchList(expr, classes, parentenv, handlers)
29: tryCatch({    engine$weave(file, quiet = quiet)    setwd(startdir)    find_vignette_product(name, by = "weave", engine = engine)}, error = function(e) {    stop(gettextf("processing vignette ‘%s’ failed with diagnostics:\n%s",         file, conditionMessage(e)), domain = NA, call. = FALSE)})
30: tools::buildVignettes(dir = ".", tangle = TRUE)
aborting ...
make: *** [rstan_2.2.0.tar.gz] Error 1


Ben Goodrich

unread,
Mar 11, 2014, 2:49:57 PM3/11/14
to stan...@googlegroups.com
I don't know. But can you meet at like 3:30? -- Ben

Daniel Lee

unread,
Mar 11, 2014, 2:51:44 PM3/11/14
to stan...@googlegroups.com
Sure. I've just nuked my R again. Where should I meet you?


--
You received this message because you are subscribed to the Google Groups "stan development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jiqiang Guo

unread,
Mar 11, 2014, 3:30:35 PM3/11/14
to stan...@googlegroups.com
Don't know either.  It is weird.

Jiqiang


On Tue, Mar 11, 2014 at 2:49 PM, Ben Goodrich <goodri...@gmail.com> wrote:

Daniel Lee

unread,
Mar 11, 2014, 4:41:22 PM3/11/14
to stan...@googlegroups.com
Ben is the man. After about half an hour of looking at incomprehensible error messages, he asked "how old is your hard drive?" I told him that I didn't know and then he said he thought my disk was corrupt. He had to leave to teach class.

I rebooted the Mac, ran the disk utility, and found that my disk was corrupt. I spent a few minutes repairing the disk and now it runs.

Ben, I owe you. Next round of drinks are on me.



Daniel

Daniel Lee

unread,
Mar 11, 2014, 5:25:31 PM3/11/14
to stan...@googlegroups.com
I spoke too soon.

I'm still getting the weird segfault when running from within the built directory.

Daniel Lee

unread,
Mar 11, 2014, 5:49:24 PM3/11/14
to stan...@googlegroups.com
Ok... so something weird happens. I run:
make check

It gets to "running code in 'rstan_vignette.Rnw'" (see message below):
* checking tests ...
  Running ‘doRUnit.R’
 OK
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes in ‘inst/doc’ ... OK
* checking running R code from vignettes ...
   ‘rstan_vignette.Rnw’ ... failed
 ERROR
Errors in running code in vignettes:
when running code in ‘rstan_vignette.Rnw’
  ...

> seed <- 12345

> sflist1 <- mclapply(1:4, mc.cores = ifelse(WINDOWS,
+     1, 4), function(i) stan(fit = f1, seed = seed, data = schools_data,
+     chains = 1, ch .... [TRUNCATED]

  When sourcing ‘rstan_vignette.R’:
Error: 4 simultaneous processes spawned
Execution halted


But, something weird happens. The file in ~/.R/Makevars is now mysteriously gone. As in it no longer exists. WTF? Why is it getting removed??



Daniel Lee

unread,
Mar 11, 2014, 6:10:59 PM3/11/14
to stan...@googlegroups.com
I can run it fine from within R, when ~/.R/Makevars exists and has the correct CXX and CXXFLAGS.

For the last line,
1) is there a reason it would be truncated -- could that cause problems?
2) is there a limitation or could there be a weird interaction when running in parallel in R CMD check?


Daniel


Daniel Lee

unread,
Mar 11, 2014, 6:50:43 PM3/11/14
to stan...@googlegroups.com
Well -- I found a couple things:

1) if I run make check and it runs successfully or fails while running the vignette examples, it will remove ~/.R/Makevars from my machine.

2) I didn't realized I was running off my refactor branch. The develop branch runs fine with parallel, so it must be something in the changed code. I'll try to get that fixed.



Daniel

Ben Goodrich

unread,
Mar 11, 2014, 7:17:02 PM3/11/14
to stan...@googlegroups.com
Glad it is sometimes working. I too observed once that my ~/.R/Makevars file disappeared but I convinced myself that I must have accidentally done it myself.

The excess cores spawned error is a feature of the new R when --as-cran is specified. They only want people to test with 2 cores. I pushed a patch for that this weekend, so it should work if you are up to date.

Ben
Reply all
Reply to author
Forward
0 new messages