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

pmap_chr() on a 0-column tibble crashes 32-bit R 3.5.1 #565

Closed
wlandau opened this issue Oct 24, 2018 · 4 comments
Closed

pmap_chr() on a 0-column tibble crashes 32-bit R 3.5.1 #565

wlandau opened this issue Oct 24, 2018 · 4 comments

Comments

@wlandau
Copy link

@wlandau wlandau commented Oct 24, 2018

Using 43c3eb3:

purrr::pmap_chr(tibble::tibble(x = 1)[, 0], paste)

crash

sessionInfo()
#> R version 3.5.1 (2018-07-02)
#> Platform: i386-w64-mingw32/i386 (32-bit)
#> Running under: Windows 7 x64 (build 7601) Service Pack 1
#> 
#> Matrix products: default
#> 
#> locale:
#> [1] LC_COLLATE=English_United States.1252 
#> [2] LC_CTYPE=English_United States.1252   
#> [3] LC_MONETARY=English_United States.1252
#> [4] LC_NUMERIC=C                          
#> [5] LC_TIME=English_United States.1252    
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> loaded via a namespace (and not attached):
#>  [1] compiler_3.5.1  backports_1.1.2 magrittr_1.5    rprojroot_1.3-2
#>  [5] tools_3.5.1     htmltools_0.3.6 yaml_2.2.0      Rcpp_0.12.19   
#>  [9] stringi_1.2.4   rmarkdown_1.10  knitr_1.20      stringr_1.3.1  
#> [13] digest_0.6.18   evaluate_0.12
@wlandau
Copy link
Author

@wlandau wlandau commented Oct 25, 2018

I forgot to mention: for Windows, this error appears to happen on 32-bit R 3.5.1 and devel, but not on 64-bit R and not for R 3.4.4.

@lionel-
Copy link
Member

@lionel- lionel- commented Nov 14, 2018

Simpler reprex:

pmap(list(), identity)
lionel- added a commit that referenced this issue Nov 14, 2018
Part of #565
lionel- added a commit that referenced this issue Nov 14, 2018
lionel- added a commit that referenced this issue Nov 14, 2018
lionel- added a commit that referenced this issue Nov 14, 2018
@lionel-
Copy link
Member

@lionel- lionel- commented Nov 14, 2018

It seems that VECTOR_ELT(empty_list, 0) usually returns NULL but crashes on that platform. That's weird, I'd have thought it'd crash on all platforms.

@wlandau
Copy link
Author

@wlandau wlandau commented Nov 14, 2018

Just a guess, but I wonder if this could somehow be related to ALTREP. From Rinternals.h, VECTOR_ELT is just ((SEXP *) DATAPTR(x))[i], and DATAPTR now seems to rely on ALTREP functionality. This might explain why it crashes on R 3.5.1 but not 3.4.4. cc @gmbecker.

@lionel- lionel- closed this in #572 Nov 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants