2017-06-14 109 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解決了我的問題。