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

R session crash with %>% #1309

Closed
r2evans opened this issue Aug 10, 2015 · 4 comments
Closed

R session crash with %>% #1309

r2evans opened this issue Aug 10, 2015 · 4 comments

Comments

@r2evans
Copy link

r2evans commented Aug 10, 2015

This may be similar or the same bug as several other issues, but they all appear to be triggered by specific events/functions; this is generic enough that it may apply or be something completely different.

The R session crashes (or sometimes "hangs" busily) with just mutate or transmute. The "when" of a crash is unpredictable, but I can always crash it with enough replications:

library(dplyr)
for (i in 1:10000) ign <- replicate(10, {ign=mtcars %>% mutate(a=c(NA,diff(hp)))})

Sometimes 100 times works, sometimes 50000 is needed multiple times to get a crash. The system is not otherwise task-saturated. (Though I am using a for-loop here, I initially played with replicate with similar results.)

It behaves the same with transmute in place of mutate, perhaps no surprise. If I use mtcars %>% mutate(a=lag(hp)), I have not seen it hang, nor have I seen it hang with arrange(mpg) or similar.

When it fails, it usually full-up crashes. Infrequently, it just hangs "busily"; I can see no appreciable change in CPU or memory usage. At one point, when I was repeatedly trying to crash it, I started timing things so I knew how long to do something else before coming back to check.

system.time({for (i in 1:50000) ign <- mutate(mtcars, a=c(NA, diff(hp)))})
## Error in structure(NextMethod(), class = "lazy_dots") (from #1) : 
##   GC encountered a node (0x000000000c04b470) with an unknown SEXP type: BUILTINSXP at memory.c:999
## Timing stopped at: 15.28 0 15.44 

Does this help at all? (It doesn't always err like this, it occasionally just hangs here as well.) Even more interesting to me is that immediately after this error, I tried

system.time({for (i in 1:50000) ign <- mutate(mtcars, a=lag(hp))})

and it crashed, despite my previous statement that I never saw lag produce a crash.

Anecdotally, it seems to crash less often with mutate(mtcars, a=c(NA,diff(hp))) than it does with mtcars %>% mutate(a=c(NA,diff(hp))), but I don't have hard numbers on it.

I cannot reproduce it on ubuntu-14.04, so I believe it's a windows thing.

R-3.2.1, dplyr-0.4.2 and dplyr-0.4.2.9002

@codref
Copy link

codref commented Aug 11, 2015

I experienced the very same issue (on windows), the only workaround was to revert to an older version of the library. Unfortunately the Access Violation exception seems to appear "randomly", I do not have the expertise to provide you further details, except the ADplus log

@romainfrancois
Copy link
Member

I cannot reproduce it locally on OSX. I'd bet it's the same as #1231.

(BTW 0.4.1.9002 does not clearly identify which version you mean, it just means it's a version after a given fix).

Do you still see the problem with the dev version ?

@r2evans
Copy link
Author

r2evans commented Aug 12, 2015

I just did a pull and cannot reproduce the problem, thanks Romain! I had read #1231 and thought it was perhaps different. I also had done a git pull, but apparently I didn't get it recent enough. Thanks.

@romainfrancois
Copy link
Member

Symptoms were different, but the cause wzs the same i guess

@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.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants