追踪R segfault的根本原因 [英] Tracing root cause for R segfault

查看:104
本文介绍了追踪R segfault的根本原因的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Shiny和ggplot2编写一个用R编写的非常复杂的仪表板。

现在写了一切正常,但过了一段时间(数据每天更新)它在呈现特定页面时开始出现段错误。



我可以通过打开12个ggplot图形的特定选项卡来重现问题。 b

失败时的控制台输出如下所示:

  dashboard_1 |地址0x194b1,导致'内存未映射'
dashboard_1 |
dashboard_1 |回溯:
dashboard_1 | 1:mapply(FUN = f,...,SIMPLIFY = FALSE)
dashboard_1 | 2:地图(build_grob,绘制$ layer,data)
dashboard_1 | 3:ggplot_gtable(data)
dashboard_1 | 4:print.ggplot(result $ value)
dashboard_1 | 5:打印(结果$值)
dashboard_1 | 6:eval(expr,envir,enclos)
dashboard_1 | 7:eval(expr,pf)
dashboard_1 | 8:withVisible(eval(expr,pf))
dashboard_1 | 9:evalVis(expr)
dashboard_1 | 10:capture.output(print(result $ value))
...
dashboard_1 | 65:tryCatchOne(expr,names,parentenv,handlers [[1L]])
dashboard_1 | 66:tryCatchList(expr,classes,parentenv,handlers)
dashboard_1 | 67:tryCatch((函数(句柄,二进制,消息){for(处理器在.wsconns [[as.character(句柄)]] $。messageCallbacks){result< - try(handler(binary,message)) if(inherit(result,try-error)){.wsconns [[as.character(handle)]] $ close()return()}}})(62978544,FALSE,{\method \ :\ update\ \ data\:{\ 日期范围:shiny.date\:[\ 2014-04-26\,\ 2015年\group_by \:\weeks \}}),< environment>),error = .rcpp_error_recorder)
dashboard_1 | 68:withCallingHandlers(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()}}})(62978544,FALSE,{\ method\:\ update\,\ data\:{\ 日期范围:shiny.date\:[\ 2014-04-26\,\ 2015-04-26\],\group_by\:\weeks \}}),< environment>),error = .rcpp_error_recorder),warning = .rcpp_warning_recorder)
dashboard_1 |正在中止...
dashboard_1 |分段错误
rmreports_dashboard_1已退出,其代码为139

我想追踪根本原因并介绍更改以防止发生段错误。解决这个问题的最好方法是什么?

解决方案

我正在搜索你的问题能够找到这个线程。 https://github.com/hadley/dplyr/issues/322
其中说要尝试用'devtools'更新'dplyr'。
devtools :: install_github(hadley / dplyr,build_vignettes = FALSE)


I'm working on a quite complicated dashboard written in R using Shiny and ggplot2.

At the moment it was written everything worked fine, but after some time (data is updated daily) it started to segfault while rendering specific pages.

I can reproduce the problem by opening specific tab with 12 ggplot graphs.

Console output at the moment of failure looks like this:

dashboard_1 | address 0x194b1, cause 'memory not mapped'
dashboard_1 | 
dashboard_1 | Traceback:
dashboard_1 |  1: mapply(FUN = f, ..., SIMPLIFY = FALSE)
dashboard_1 |  2: Map(build_grob, plot$layer, data)
dashboard_1 |  3: ggplot_gtable(data)
dashboard_1 |  4: print.ggplot(result$value)
dashboard_1 |  5: print(result$value)
dashboard_1 |  6: eval(expr, envir, enclos)
dashboard_1 |  7: eval(expr, pf)
dashboard_1 |  8: withVisible(eval(expr, pf))
dashboard_1 |  9: evalVis(expr)
dashboard_1 | 10: capture.output(print(result$value))
...
dashboard_1 | 65: tryCatchOne(expr, names, parentenv, handlers[[1L]])
dashboard_1 | 66: tryCatchList(expr, classes, parentenv, handlers)
dashboard_1 | 67: 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()        }    }})("62978544", FALSE, "{\"method\":\"update\",\"data\":{\"daterange:shiny.date\":[\"2014-04-26\",\"2015-04-26\"],\"group_by\":\"weeks\"}}"),     <environment>), error = .rcpp_error_recorder)
dashboard_1 | 68: withCallingHandlers(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()        }    }})("62978544", FALSE, "{\"method\":\"update\",\"data\":{\"daterange:shiny.date\":[\"2014-04-26\",\"2015-04-26\"],\"group_by\":\"weeks\"}}"),     <environment>), error = .rcpp_error_recorder), warning = .rcpp_warning_recorder)
dashboard_1 | aborting ...
dashboard_1 | Segmentation fault
rmreports_dashboard_1 exited with code 139

I would like to trace the root cause and introduce changes to prevent segfault from happening. What is the best way to approach this problem?

解决方案

I was searching your problem was able to find this thread. https://github.com/hadley/dplyr/issues/322 Which says to try to update 'dplyr' with 'devtools'. "devtools::install_github("hadley/dplyr", build_vignettes = FALSE)"

这篇关于追踪R segfault的根本原因的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆