{"action":"created","issue":{"url":"https://api.github.com/repos/travis-ci/travis-ci/issues/8409","repository_url":"https://api.github.com/repos/travis-ci/travis-ci","labels_url":"https://api.github.com/repos/travis-ci/travis-ci/issues/8409/labels{/name}","comments_url":"https://api.github.com/repos/travis-ci/travis-ci/issues/8409/comments","events_url":"https://api.github.com/repos/travis-ci/travis-ci/issues/8409/events","html_url":"https://github.com/travis-ci/travis-ci/issues/8409","id":257271693,"number":8409,"title":"Segfault on R-devel build; how to bust package cache","user":{"login":"nealrichardson","id":2975928,"avatar_url":"https://avatars0.githubusercontent.com/u/2975928?v=4","gravatar_id":"","url":"https://api.github.com/users/nealrichardson","html_url":"https://github.com/nealrichardson","followers_url":"https://api.github.com/users/nealrichardson/followers","following_url":"https://api.github.com/users/nealrichardson/following{/other_user}","gists_url":"https://api.github.com/users/nealrichardson/gists{/gist_id}","starred_url":"https://api.github.com/users/nealrichardson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nealrichardson/subscriptions","organizations_url":"https://api.github.com/users/nealrichardson/orgs","repos_url":"https://api.github.com/users/nealrichardson/repos","events_url":"https://api.github.com/users/nealrichardson/events{/privacy}","received_events_url":"https://api.github.com/users/nealrichardson/received_events","type":"User","site_admin":false},"labels":[{"id":181619259,"url":"https://api.github.com/repos/travis-ci/travis-ci/labels/community:r","name":"community:r","color":"bfdadc","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-09-13T06:31:33Z","updated_at":"2017-09-19T18:26:17Z","closed_at":"2017-09-13T20:53:51Z","author_association":"NONE","body":"On a [recent build](https://travis-ci.org/Crunch-io/rcrunch/jobs/274903129) (incidentally, kicked off by an edit only to README.md, no code changes), the installation of the R package itself failed because knitting the vignettes threw a segfault:\r\n\r\n```\r\n$ R CMD build  .\r\n* checking for file ‘./DESCRIPTION’ ... OK\r\n* preparing ‘crunch’:\r\n* checking DESCRIPTION meta-information ... OK\r\n* installing the package to build vignettes\r\n      -----------------------------------\r\n* installing *source* package ‘crunch’ ...\r\n** R\r\n** inst\r\n** preparing package for lazy loading\r\nCreating a new generic function for ‘which’ in package ‘crunch’\r\nCreating a new generic function for ‘write.csv’ in package ‘crunch’\r\n** help\r\n*** installing help indices\r\n** building package indices\r\n** installing vignettes\r\n   ‘analyze.Rmd’ using ‘UTF-8’ \r\n *** caught segfault ***\r\naddress 0x1, cause 'memory not mapped'\r\nTraceback:\r\n 1: .Call(C_stri_locate_all_regex, str, pattern, omit_no_match, opts_regex)\r\n 2: stri_locate_all_regex(string, pattern, omit_no_match = TRUE,     opts_regex = opts)\r\n 3: stringr::str_locate_all(input, inline.code)\r\n 4: parse_inline(g, patterns)\r\n 5: FUN(X[[i]], ...)\r\n 6: lapply(groups, function(g) {    block = grepl(chunk.begin, g[1])    if (!set.preamble && !parent_mode()) {        return(if (block) \"\" else g)    }    if (block) {        n = length(g)        if (n >= 2 && grepl(chunk.end, g[n]))             g = g[-n]        g = strip_block(g, patterns$chunk.code)        params.src = if (group_pattern(chunk.begin)) {            stringr::str_trim(gsub(chunk.begin, \"\\\\1\", g[1]))        }        else \"\"        parse_block(g[-1], g[1], params.src)    }    else parse_inline(g, patterns)})\r\n 7: split_file(lines = text)\r\n 8: process_file(text, output)\r\n 9: knit(..., tangle = TRUE)\r\n10: purl(file, encoding = encoding, quiet = quiet)\r\n11: engine$tangle(file, quiet = TRUE, encoding = enc)\r\n12: installer(\".\", instdir, enc)\r\n13: doTryCatch(return(expr), name, parentenv, handler)\r\n14: tryCatchOne(expr, names, parentenv, handlers[[1L]])\r\n15: tryCatchList(expr, classes, parentenv, handlers)\r\n16: 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        sm <- strsplit(conditionMessage(e), \"\\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 = outFile)        .Internal(printDeferredWarnings())    }    invisible(structure(msg, class = \"try-error\", condition = e))})\r\n17: try(installer(\".\", instdir, enc))\r\n18: do_install_source(pkg_name, instdir, pkg, desc)\r\n19: do_install(pkg)\r\n20: tools:::.install_packages()\r\nAn irrecoverable exception occurred. R is aborting now ...\r\nSegmentation fault (core dumped)\r\n      -----------------------------------\r\n```\r\n\r\nI'm going to wager that this is related to the email today to the R-devel listserv:\r\n\r\n```\r\nFor anyone using the development version of R:\r\n\r\nsvn revision 73243 introduces some changes to the memory layout of R\r\nobjects that require reinstalling packages using compiled\r\ncode. Attempting to load incompatible packages should signal an\r\nerror. These changes are to support a new extension framework for\r\nbasic R objects\r\n(https://svn.r-project.org/R/branches/ALTREP/ALTREP.html outlines the\r\nframework).  Merging the remainder of the framework should not\r\nintroduce more binary changes and is expected to occur in the next few\r\nmonths.\r\n\r\nBest,\r\n\r\nluke\r\n```\r\n\r\nIndeed, the previous devel version build, which passed, was on r73242, while this failing one is r73243. \r\n\r\nIf that is in fact the problem, it might be fixed by resetting the package cache. I'm not sure how to do that--push a commit without `cache: packages` in the yaml and then add it back? The other reason I ask is that I'm guessing that others will have this problem too, and a more global solution might be helpful or necessary. \r\n\r\ncc @craigcitro @jimhester "},"comment":{"url":"https://api.github.com/repos/travis-ci/travis-ci/issues/comments/330628733","html_url":"https://github.com/travis-ci/travis-ci/issues/8409#issuecomment-330628733","issue_url":"https://api.github.com/repos/travis-ci/travis-ci/issues/8409","id":330628733,"user":{"login":"mkoohafkan","id":4790348,"avatar_url":"https://avatars1.githubusercontent.com/u/4790348?v=4","gravatar_id":"","url":"https://api.github.com/users/mkoohafkan","html_url":"https://github.com/mkoohafkan","followers_url":"https://api.github.com/users/mkoohafkan/followers","following_url":"https://api.github.com/users/mkoohafkan/following{/other_user}","gists_url":"https://api.github.com/users/mkoohafkan/gists{/gist_id}","starred_url":"https://api.github.com/users/mkoohafkan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkoohafkan/subscriptions","organizations_url":"https://api.github.com/users/mkoohafkan/orgs","repos_url":"https://api.github.com/users/mkoohafkan/repos","events_url":"https://api.github.com/users/mkoohafkan/events{/privacy}","received_events_url":"https://api.github.com/users/mkoohafkan/received_events","type":"User","site_admin":false},"created_at":"2017-09-19T18:26:17Z","updated_at":"2017-09-19T18:26:17Z","author_association":"NONE","body":"@jimhester, clearing the cache did not work for me. My package needs `sudo:required` to build with a modern version of an external library so I don't think I cache any packages.  However, I am installing many R packages from binaries using the ` r_binary_packages` option in travis.yml. I wonder if this is the problem---perhaps many of the R binaries have not been built on the latest R-devel, and that is why the memory error continues to occur? "}}
{"actor":{"display_login":"mkoohafkan"}}