Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfault in mutate #1641

enbrown opened this issue Jan 26, 2016 · 0 comments

Segfault in mutate #1641

enbrown opened this issue Jan 26, 2016 · 0 comments


Copy link

@enbrown enbrown commented Jan 26, 2016

I'm not sure if this has been reported before or is another version of a previously seen bug, but I can get R to crash quite consistently with the following 3 lines. I realize that this is a bug in my code, but I don't expect it to crash R (and force reloading of RStudio which I use to do some of my developing.) Taking out the group_by call prevents the crash and just throws an error:

df <- data.frame(ID = rep(1:5, each = 3), x = 1:15)
df %>% group_by(ID) %>% mutate(foo = mean)

I've reinstalled RCPP from source (install.packages("Rcpp", type="source")) and dplyr from GitHub (devtools::install_github("hadley/dplyr", build_vignettes = FALSE)) and it still occurs.

The error output is:

 *** caught segfault ***
address (nil), cause 'memory not mapped'

 1: .Call("dplyr_mutate_impl", PACKAGE = "dplyr", df, dots)
 2: mutate_impl(.data, dots)
 3: mutate_.tbl_df(.data, .dots = lazyeval::lazy_dots(...))
 4: mutate_(.data, .dots = lazyeval::lazy_dots(...))
 5: mutate(., foo = mean)
 6: function_list[[k]](value)
 7: withVisible(function_list[[k]](value))
 8: freduce(value, `_function_list`)
 9: `_fseq`(`_lhs`)
10: eval(expr, envir, enclos)
11: eval(quote(`_fseq`(`_lhs`)), env, env)
12: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
13: df %>% dplyr::group_by(ID) %>% mutate(foo = mean)
14: eval(expr, envir, enclos)
15: eval(ei, envir)
16: withVisible(eval(ei, envir))
17: source("test.R")


With debugging through gdb, it segfaults at (I don't know how to turn on dubugging info when compiling dplyr to see the exact line it crashes at):

0x00007ffff0726ecf in SEXPREC* mutate_grouped<Rcpp::GroupedDataFrame, dplyr::LazyGroupedSubsets>(Rcpp::DataFrame_Impl<Rcpp::PreserveStorage> const&, Rcpp::LazyDots const&) () from /home/enb/R/x86_64-redhat-linux-gnu-library/3.2/dplyr/libs/

Finally, the sessionInfo is:

> sessionInfo()
R version 3.2.3 (2015-12-10)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: Fedora 23 (Workstation Edition)

[1] C

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

other attached packages:
[1] dplyr_0.4.3.9000

loaded via a namespace (and not attached):
[1] magrittr_1.5   R6_2.1.2       assertthat_0.1 parallel_3.2.3 DBI_0.3.1     
[6] tools_3.2.3    Rcpp_0.12.3   
@romainfrancois romainfrancois self-assigned this Jan 26, 2016
@lock lock bot locked as resolved and limited conversation to collaborators Jun 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants