Javascript error - segmentation fault and core dumped.

51 views
Skip to first unread message

Patrick Chamberlain

unread,
Sep 23, 2014, 2:06:48 AM9/23/14
to shinyap...@googlegroups.com
I built a simple app for the Coursera Developing Data Products course.  I saw Javascript errors a couple of times before, but on Sunday I couldn't get a single error, no matter how many times myself or other people tried. 

Yesterday evening and today this issue reappeared. Very frustrating because the peer review period just started and its' too late to do anything about it now.  URL is https://pjchamberlain.shinyapps.io/devdataprod/ 

Error message ends with segmentation fault, core dumped - full message from the Javascript console below. Did I do something wrong or is this on the server side?

 package: RColorBrewer *** caught segfault ***address 0x28, cause 'memory not mapped'Traceback: 1: text.default(x1, y1, words[i], cex = size[i], offset = 0, srt = rotWord *     90, col = cc, ...) 2: text(x1, y1, words[i], cex = size[i], offset = 0, srt = rotWord *     90, col = cc, ...) 3: wordcloud(c("setosa", "versicolor", "virginica"), predict(modFit,     newdata = testdata()), colors = "purple") 4: func() 5: withVisible(func()) 6: func() 7: withCallingHandlers(expr, error = function(e) {    handle <- getOption("shiny.error")    if (is.function(handle))         handle()}) 8: shinyCallingHandlers(func()) 9: tryCatchList(expr, classes, parentenv, handlers)10: tryCatch(shinyCallingHandlers(func()), finally = dev.off(dv))11: (function (func, filename = tempfile(fileext = ".png"), width = 400,     height = 400, res = 72, ...) {    if (capabilities("aqua")) {        pngfun <- png    }    else if ((getOption("shiny.usecairo") %OR% TRUE) && nchar(system.file(package = "Cairo"))) {        pngfun <- Cairo::CairoPNG    }    else {        pngfun <- png    }    pngfun(filename = filename, width = width, height = height,         res = res, ...)    op <- par(mar = rep(0, 4))    tryCatch(plot.new(), finally = par(op))    dv <- dev.cur()    tryCatch(shinyCallingHandlers(func()), finally = dev.off(dv))    filename})(function () {    result <- withVisible(func())    if (result$visible) {        capture.output(print(result$value))    }    usrCoords <- par("usr")    usrBounds <- usrCoords    if (par("xlog")) {        usrBounds[c(1, 2)] <- 10^usrBounds[c(1, 2)]    }    if (par("ylog")) {        usrBounds[c(3, 4)] <- 10^usrBounds[c(3, 4)]    }    coordmap <<- list(usr = c(left = usrCoords[1], right = usrCoords[2],         bottom = usrCoords[3], top = usrCoords[4]), bounds = c(left = grconvertX(usrBounds[1],         "user", "nfc") * width, right = grconvertX(usrBounds[2],         "user", "nfc") * width, bottom = (1 - grconvertY(usrBounds[3],         "user", "nfc")) * height, top = (1 - grconvertY(usrBounds[4],         "user", "nfc")) * height), log = c(x = par("xlog"), y = par("ylog")),         pixelratio = pixelratio)}, width = 670, height = 400, res = 72)12: do.call(plotPNG, c(plotFunc, width = width * pixelratio, height = height *     pixelratio, res = res * pixelratio, args))13: orig(name = name, shinysession = .self)14: func()15: withCallingHandlers(expr, error = function(e) {    handle <- getOption("shiny.error")    if (is.function(handle))         handle()})16: shinyCallingHandlers(func())17: doTryCatch(return(expr), name, parentenv, handler)18: tryCatchOne(expr, names, parentenv, handlers[[1L]])19: tryCatchList(expr, classes, parentenv, handlers)20: tryCatch(shinyCallingHandlers(func()), shiny.silent.error = function(cond) {    structure(NULL, class = "try-error", condition = cond)})21: doTryCatch(return(expr), name, parentenv, handler)22: tryCatchOne(expr, names, parentenv, handlers[[1L]])23: tryCatchList(expr, classes, parentenv, handlers)24: 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))})25: try({    tryCatch(shinyCallingHandlers(func()), shiny.silent.error = function(cond) {        structure(NULL, class = "try-error", condition = cond)    })}, silent = FALSE)26: func()27: withCallingHandlers(expr, error = function(e) {    handle <- getOption("shiny.error")    if (is.function(handle))         handle()})28: shinyCallingHandlers(func())29: env$runWith(.self, func)30: tryCatchList(expr, classes, parentenv, handlers)31: tryCatch(env$runWith(.self, func), finally = .graphExitContext(id))32: withReactiveDomain(.domain, {    env <- .getReactiveEnvironment()    .graphEnterContext(id)    tryCatch(env$runWith(.self, func), finally = .graphExitContext(id))})33: ctx$run(.func)34: run()35: func()36: withCallingHandlers({    func()}, warning = function(e) {}, error = function(e) {})37: FUN(X[[1L]], ...)38: lapply(.flushCallbacks, function(func) {    withCallingHandlers({        func()    }, warning = function(e) {    }, error = function(e) {    })})39: ctx$executeFlushCallbacks()40: .getReactiveEnvironment()$flush()41: flushReact()42: handler(binary, message)43: doTryCatch(return(expr), name, parentenv, handler)44: tryCatchOne(expr, names, parentenv, handlers[[1L]])45: tryCatchList(expr, classes, parentenv, handlers)46: 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))})47: try(handler(binary, message))48: (function (handle, binary, message) {    for (handler in .wsconns[[as.character(handle)]]$.messageCallbacks) {        result <- try(handler(binary, message))        if (inherits(result, "try-error")) {            .wsconns[[as.character(handle)]]$close()            return()        }    }})("50379104", FALSE, "{\"method\":\"update\",\"data\":{\"SL\":2.4000000000000004}}")49: eval(substitute(expr), envir, enclos)50: evalq((function (handle, binary, message) {    for (handler in .wsconns[[as.character(handle)]]$.messageCallbacks) {        result <- try(handler(binary, message))        if (inherits(result, "try-error")) {            .wsconns[[as.character(handle)]]$close()            return()        }    }})("50379104", FALSE, "{\"method\":\"update\",\"data\":{\"SL\":2.4000000000000004}}"),     <environment>)51: doTryCatch(return(expr), name, parentenv, handler)52: tryCatchOne(expr, names, parentenv, handlers[[1L]])53: tryCatchList(expr, classes, parentenv, handlers)54: tryCatch(evalq((function (handle, binary, message) {    for (handler in .wsconns[[as.character(handle)]]$.messageCallbacks) {        result <- try(handler(binary, message))        if (inherits(result, "try-error")) {            .wsconns[[as.character(handle)]]$close()            return()        }    }})("50379104", FALSE, "{\"method\":\"update\",\"data\":{\"SL\":2.4000000000000004}}"),     <environment>), error = .rcpp_error_recorder)55: .Call("httpuv_run", PACKAGE = "httpuv", timeoutMillis)56: run(timeoutMs)57: service(timeout)58: serviceApp()59: withCallingHandlers(expr, error = function(e) {    handle <- getOption("shiny.error")    if (is.function(handle))         handle()})60: shinyCallingHandlers(while (!.globals$stopped) {    serviceApp()    Sys.sleep(0.001)})61: runApp(Sys.getenv("SHINY_APP"), port = port, launch.browser = FALSE,     workerId = Sys.getenv("WORKER_ID"))aborting .../opt/shiny-server/scripts/shiny-run: line 3:    52 Segmentation fault      (core dumped) /bin/bash --login -c "$SHINY_EXEC_COMMAND $SHINY_R_PATH $*" shiny-server-pro.js:338
Failed to load resource: the server responded with a status of 500 (Internal Server Error) https://pjchamberlain.shinyapps.io/devdataprod/_w_b19eb3956ed8928a3d97c33845fe28a493f19070c3cdc6cc/shared/shiny.css
Failed to load resource: the server responded with a status of 500 (Internal Server Error) https://pjchamberlain.shinyapps.io/devdataprod/_w_b19eb3956ed8928a3d97c33845fe28a493f19070c3cdc6cc/shared/bootstrap/css/bootstrap.min.css
Failed to load resource: the server responded with a status of 500 (Internal Server Error) https://pjchamberlain.shinyapps.io/devdataprod/_w_b19eb3956ed8928a3d97c33845fe28a493f19070c3cdc6cc/shared/bootstrap/css/bootstrap-responsive.min.css

Tareef Kawaf

unread,
Sep 23, 2014, 7:35:21 AM9/23/14
to Patrick Chamberlain, shinyap...@googlegroups.com
I am sorry you are seeing this error Patrick.  Does the application run well locally?  Would you mind sharing it with us so we can see if we can reproduce it outside the context of Shinyapps?
Also, if you could attach the output of showLogs(), and sessionInfo() that would be very helpful.

Thank you,
Tareef

--
You received this message because you are subscribed to the Google Groups "ShinyApps Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shinyapps-use...@googlegroups.com.
To post to this group, send email to shinyap...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shinyapps-users/47542ad4-15b3-4f3e-861a-1485d4d83542%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Patrick Chamberlain

unread,
Sep 23, 2014, 1:13:45 PM9/23/14
to shinyap...@googlegroups.com, pjcham...@gmail.com
Hi  Tareef

I've never seen a problem running the app locally in RStudio with runApp().  My code is on github https://github.com/pjchamberlain/devdataprod  

sessionInfo()
R version 3.1.0 (2014-04-10)
Platform: x86_64-pc-linux-gnu (64-bit)

(I haven't included the rest of the output because I've been doing other things since building the app)

showLogs()  - just throws an Error .. 

Hope that helps. Let me know if you need more information.

Patrick

Andy Kipp

unread,
Sep 23, 2014, 1:43:32 PM9/23/14
to Patrick Chamberlain, shinyap...@googlegroups.com
Hi,

We will be unable to help you further without the output from showLogs(). Can you copy the error message you are seeing and include it in an email? Thanks

Thanks
-Andy

Patrick Chamberlain

unread,
Sep 23, 2014, 3:24:35 PM9/23/14
to shinyap...@googlegroups.com, pjcham...@gmail.com
Hi

Sorry didn't realise showLogs() was in the shinyapps library. I've attached the output.  Something else I should have said is that the machine I built the app on and deployed it from is not the one I'm on now. Sorry I don't have access to that PC now.
showLogs.txt

Yihui Xie

unread,
Sep 23, 2014, 3:28:38 PM9/23/14
to Patrick Chamberlain, shinyap...@googlegroups.com
Not realizing showLogs() was in shinyapps is certainly not your fault
:) To avoid such confusion in the future, let's say
shinyapps::showLogs() from now on.

Regards,
Yihui
--
Yihui Xie <xiey...@gmail.com>
Web: http://yihui.name


On Tue, Sep 23, 2014 at 2:24 PM, Patrick Chamberlain
<pjcham...@gmail.com> wrote:
> Hi
>
Reply all
Reply to author
Forward
0 new messages