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
popupTable for many points crashes RStudio session #154
Comments
On my windows machine at work the respective
> sessionInfo()
R version 3.5.0 (2018-04-23)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252 LC_MONETARY=German_Germany.1252 LC_NUMERIC=C
[5] LC_TIME=German_Germany.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] mapview_2.4.2 sf_0.6-2
loaded via a namespace (and not attached):
[1] Rcpp_0.12.16 plyr_1.8.4 compiler_3.5.0 later_0.7.1 R.methodsS3_1.7.1 R.utils_2.6.0 base64enc_0.1-3
[8] class_7.3-14 iterators_1.0.9 tools_3.5.0 gdalUtils_2.0.1.14 digest_0.6.15 viridisLite_0.3.0 satellite_1.0.1
[15] lattice_0.20-35 png_0.1-7 foreach_1.4.4 shiny_1.0.5 DBI_0.8 crosstalk_1.0.0 RPostgreSQL_0.6-2
[22] yaml_2.1.18 rgdal_1.2-18 spData_0.2.8.3 e1071_1.6-8 raster_2.6-7 htmlwidgets_1.2 webshot_0.5.0
[29] classInt_0.2-3 stats4_3.5.0 leaflet_2.0.0 grid_3.5.0 R6_2.2.2 sp_1.2-7 udunits2_0.13
[36] magrittr_1.5 scales_0.5.0 codetools_0.2-15 promises_1.0.1 htmltools_0.3.6 units_0.5-1 colorspace_1.3-2
[43] mime_0.5 xtable_1.8-2 httpuv_1.4.1 munsell_0.4.3 R.oo_1.22.0 |
On windows in R started from cmd I can happily produce 3 million popups (i.e. |
I can confirm your finding on rstudio/ubuntu 17.10. |
I can reproduce this in on ubuntu/bionic with R 3.4.4 (no rstudio), seeing (in valgrind):
|
As indicated by @edzer, this seems like some memory allocation issue related to our generous use of In any case, as of 3d88f6e, library(sf)
library(mapview)
n = 1e6
df = data.frame(x = runif(n, 0, 40),
y = runif(n, 0, 40),
z = sample.int(3, n, replace = TRUE))
df = st_as_sf(df, coords = c("x", "y"), crs = 4326)
pp = popupTable(df)
pp[5e5]
# [1] "<html><head><link rel=\"stylesheet\" type=\"text/css\" href=\"lib/popup/popup.css\"></head><body><div class=\"scrollableContainer\"><table class=\"popup scrollable\"><table id=\"popup\"><tr class='coord'><td></td><td><b>Feature ID</b></td><td align='right'>500000 </td></tr><tr class='alt'><td>1</td><td><b>z </b></td><td align='right'>3 </td></tr><tr><td>2</td><td><b>geometry </b></td><td align='right'>sfc_POINT </td></tr></table></body></html>" Here's my > sessionInfo()
R version 3.5.0 (2018-04-23)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252 LC_MONETARY=German_Germany.1252 LC_NUMERIC=C
[5] LC_TIME=German_Germany.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] mapview_2.4.5 sf_0.6-2
loaded via a namespace (and not attached):
[1] Rcpp_0.12.16 RColorBrewer_1.1-2 plyr_1.8.4 compiler_3.5.0 later_0.7.2 R.methodsS3_1.7.1 R.utils_2.6.0
[8] base64enc_0.1-3 class_7.3-14 iterators_1.0.9 tools_3.5.0 gdalUtils_2.0.1.14 digest_0.6.15 memoise_1.1.0
[15] viridisLite_0.3.0 satellite_1.0.1 lattice_0.20-35 png_0.1-7 foreach_1.4.4 shiny_1.0.5 DBI_1.0.0
[22] crosstalk_1.0.0 RPostgreSQL_0.6-2 yaml_2.1.19 rgdal_1.2-20 xfun_0.1 spData_0.2.8.3 e1071_1.6-8
[29] knitr_1.20 withr_2.1.2 raster_2.6-7 devtools_1.13.5 htmlwidgets_1.2 webshot_0.5.0 classInt_0.2-3
[36] stats4_3.5.0 leaflet_2.0.0 grid_3.5.0 R6_2.2.2 bookdown_0.7 sp_1.2-7 latticeExtra_0.6-28
[43] udunits2_0.13 magrittr_1.5 Orcs_1.0.7 scales_0.5.0 codetools_0.2-15 promises_1.0.1 htmltools_0.3.6
[50] units_0.5-1 colorspace_1.3-2 mime_0.5 xtable_1.8-2 httpuv_1.4.2 munsell_0.4.3 R.oo_1.22.0 |
Sweet, on my linux machine, I can now run this with |
Confirm working for windows, hence closing this. Thanks again @fdetsch !! |
The following code crashes the RStudio session when
n = 523000
but doesn't ifn = 522000
on my linux machine.This happens somewhere in listPopupTemplates.
@fdetsch do you have any idea why this crashes? Can we make this safer so that it doesn't crash the entire session?
Note: R does not crash when run from the terminal, but the following error is emitted
Error: segfault from C stack overflow
I have not pinned down the exact
n
when this happens in native R, butn = 523000
works,n = 1e6
causes segfault.RStudio version is
1.1.383
The text was updated successfully, but these errors were encountered: