2017-06-14 130 views
4

我一直在我的Linux机器上运行闪亮服务器上得到以下分段错误:[R闪亮服务器分段错误

-bash: line 1: 29254 Segmentation fault  R --no-save --slave -f \/opt\/shiny-server\/R\/SockJSAdapter\.R 
" 

它开始三天前在以前工作正常的应用程序。该应用程序不会在我的Windows机器上发生错误。我已经更新了机器上的所有软件包和RStudio。我试图找到答案,但关于Segfaults的信息很少。

我试图重现错误并将代码剥离为最小值。我发现渲染文本和表格(base和DataTables)是可以的,但渲染任何plot(base,ggplot,plotly)会产生分割错误。下面是从JavaScript控制台给出错误和错误消息的代码。

我也试图通过从RStudio Linux机器上的Web浏览器启动代码,看看我是否能得到更多的信息,但它只是crached给我下面的错误信息: Rstudio browser error message

> sessionInfo() 
R version 3.4.0 (2017-04-21) 
Platform: x86_64-redhat-linux-gnu (64-bit) 
Running under: CentOS Linux 7 (Core) 

Matrix products: default 
BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so 

locale: 
[1] LC_CTYPE=en_US.UTF-8  LC_NUMERIC=C    LC_TIME=en_US.UTF-8  LC_COLLATE=en_US.UTF-8  
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8  LC_NAME=C     
[9] LC_ADDRESS=C    LC_TELEPHONE=C    LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C  

attached base packages: 
[1] stats  graphics grDevices utils  datasets methods base  

loaded via a namespace (and not attached): 
[1] compiler_3.4.0 tools_3.4.0 

ui.R

library(shinydashboard) 

dashboardPage(

    dashboardHeader(), 


    dashboardSidebar(), 


    dashboardBody(
    h4('Text'), 
    textOutput('TextT'), 
    dataTableOutput('Tabel'), 
    plotOutput('Plot') 

) 

) 

server.R

server <- function(input, output, session) { 

    output$TextT = renderText('text text') 

    output$Tabel = renderDataTable(data.frame(A = 1)) 

    output$Plot = renderPlot(plot(data.frame(x = c(1:10), y = c(11:20)))) 

} 

JavaScript错误控制台:

68: messageHandler(binary, msg) 
69: withCallingHandlers(expr, error = function(e) { if (is.null(attr(e, "stack.trace", exact = TRUE))) {  calls <- sys.calls()  attr(e, "stack.trace") <- calls  stop(e) }}) 
70: captureStackTraces(expr) 
71: withCallingHandlers(captureStackTraces(expr), error = function(cond) { if (inherits(cond, "shiny.silent.error"))   return() if (isTRUE(getOption("show.error.messages"))) {  printError(cond, full = full, offset = offset) }}) 
72: withLogErrors(messageHandler(binary, msg)) 
73: handler(binary, message) 
74: doTryCatch(return(expr), name, parentenv, handler) 
75: tryCatchOne(expr, names, parentenv, handlers[[1L]]) 
76: tryCatchList(expr, classes, parentenv, handlers) 
77: 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 = outFile)  .Internal(printDeferredWarnings()) } invisible(structure(msg, class = "try-error", condition = e))}) 
78: try(handler(binary, message)) 
79: (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()  } }})("60893360", FALSE, "{\"method\":\"init\",\"data\":{\"sidebarItemExpanded\":null,\"sidebarCollapsed\":false,\".clientdata_output_Plot_width\":1190,\".clientdata_output_Plot_height\":400,\".clientdata_output_TextT_hidden\":false,\".clientdata_output_Tabel_hidden\":false,\".clientdata_output_Plot_hidden\":false,\".clientdata_pixelratio\":0.8695651888847351,\".clientdata_url_protocol\":\"http:\",\".clientdata_url_hostname\":\"apps.teed.ee\",\".clientdata_url_port\":\"\",\".clientdata_url_pathname\":\"/VisualiseerimineVer2/\",\".clientdata_url_search\":\"\",\".clientdata_url_hash_initial\":\"\",\".clientdata_url_hash\":\"\",\".clientdata_singletons\":\"\",\".clientdata_allowDataUriScheme\":true}}") 
80: 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()  } }})("60893360", FALSE, "{\"method\":\"init\",\"data\":{\"sidebarItemExpanded\":null,\"sidebarCollapsed\":false,\".clientdata_output_Plot_width\":1190,\".clientdata_output_Plot_height\":400,\".clientdata_output_TextT_hidden\":false,\".clientdata_output_Tabel_hidden\":false,\".clientdata_output_Plot_hidden\":false,\".clientdata_pixelratio\":0.8695651888847351,\".clientdata_url_protocol\":\"http:\",\".clientdata_url_hostname\":\"apps.teed.ee\",\".clientdata_url_port\":\"\",\".clientdata_url_pathname\":\"/VisualiseerimineVer2/\",\".clientdata_url_search\":\"\",\".clientdata_url_hash_initial\":\"\",\".clientdata_url_hash\":\"\",\".clientdata_singletons\":\"\",\".clientdata_allowDataUriScheme\":true}}"),  <environment>) 
81: 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()  } }})("60893360", FALSE, "{\"method\":\"init\",\"data\":{\"sidebarItemExpanded\":null,\"sidebarCollapsed\":false,\".clientdata_output_Plot_width\":1190,\".clientdata_output_Plot_height\":400,\".clientdata_output_TextT_hidden\":false,\".clientdata_output_Tabel_hidden\":false,\".clientdata_output_Plot_hidden\":false,\".clientdata_pixelratio\":0.8695651888847351,\".clientdata_url_protocol\":\"http:\",\".clientdata_url_hostname\":\"apps.teed.ee\",\".clientdata_url_port\":\"\",\".clientdata_url_pathname\":\"/VisualiseerimineVer2/\",\".clientdata_url_search\":\"\",\".clientdata_url_hash_initial\":\"\",\".clientdata_url_hash\":\"\",\".clientdata_singletons\":\"\",\".clientdata_allowDataUriScheme\":true}}"),  <environment>) 
82: doTryCatch(return(expr), name, parentenv, handler) 
83: tryCatchOne(expr, names, parentenv, handlers[[1L]]) 
84: tryCatchList(expr, names[-nh], parentenv, handlers[-nh]) 
85: doTryCatch(return(expr), name, parentenv, handler) 
86: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),  names[nh], parentenv, handlers[[nh]]) 
87: tryCatchList(expr, classes, parentenv, handlers) 
88: 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()  } }})("60893360", FALSE, "{\"method\":\"init\",\"data\":{\"sidebarItemExpanded\":null,\"sidebarCollapsed\":false,\".clientdata_output_Plot_width\":1190,\".clientdata_output_Plot_height\":400,\".clientdata_output_TextT_hidden\":false,\".clientdata_output_Tabel_hidden\":false,\".clientdata_output_Plot_hidden\":false,\".clientdata_pixelratio\":0.8695651888847351,\".clientdata_url_protocol\":\"http:\",\".clientdata_url_hostname\":\"apps.teed.ee\",\".clientdata_url_port\":\"\",\".clientdata_url_pathname\":\"/VisualiseerimineVer2/\",\".clientdata_url_search\":\"\",\".clientdata_url_hash_initial\":\"\",\".clientdata_url_hash\":\"\",\".clientdata_singletons\":\"\",\".clientdata_allowDataUriScheme\":true}}"),  <environment>), error = function (x) x, interrupt = function (x) x) 
89: .Call("httpuv_run", PACKAGE = "httpuv", timeoutMillis) 
90: run(timeoutMs) 
91: service(timeout) 
92: serviceApp() 
93: withCallingHandlers(expr, error = function(e) { if (is.null(attr(e, "stack.trace", exact = TRUE))) {  calls <- sys.calls()  attr(e, "stack.trace") <- calls  stop(e) }}) 
94: captureStackTraces({ scheduleFlush() while (!.globals$stopped) {  serviceApp()  Sys.sleep(0.001) }}) 
95: ..stacktraceoff..(captureStackTraces({ scheduleFlush() while (!.globals$stopped) {  serviceApp()  Sys.sleep(0.001) }})) 
96: runApp(Sys.getenv("SHINY_APP"), port = port, launch.browser = FALSE) 
An irrecoverable exception occurred. R is aborting now ... 
-bash: line 1: 3049 Segmentation fault  R --no-save --slave -f \/opt\/shiny-server\/R\/SockJSAdapter\. 

你有什么想法可以在它后面或如何解决它?

预先感谢您。

PS:我用闪亮的仪表板,但我得到了同样的信息,当我运行它作为一个经常闪亮应用

+0

你使用的是Nvidia显卡吗? – Phi

+0

不是。它是一个服务器(带有Intel处理器和显卡的戴尔R620) –

+0

@KarmenKütt你解决了吗?我有同样的问题 – CPhil

回答

-2

我正经历着完全相同的问题(有光泽的仪表盘+ rhandsontable + GGPLOT2)。

至于Bárbara Borges suggested in a comment,将options(java.parameters = "-Xss2560k")添加到ui.R解决了我的问题。