randy3k / radian

A 21 century R console
MIT License
1.96k stars 73 forks source link

Problem with rendering {shiny} app: Error: C stack usage 1914576 is too close to the limit #378

Open jooyoungseo opened 1 year ago

jooyoungseo commented 1 year ago

When rendering {shiny} apps using radian on Windows, I see the following errer:

Error: C stack usage 1914576 is too close to the limit

However, this issue does not happen when I render the {shiny} app via an original R term.

Current Result (when executed in radian)

image

Expected Result (when executed in an original R terminal)

# Load
library(shiny)

# Front-end user interface
ui <- fluidPage(
    titlePanel("Shiny App"),
    sidebarLayout(
        sidebarPanel(
            "Sidebar Panel",
            numericInput(inputId = "num", "Type any integer:", value = 50),
            selectInput(inputId = "color", "Choose your color for histogram:", choices = colors(), selected = "blue")
        ),
        mainPanel(
            "Main panel",
            plotOutput(outputId = "histogram")
        )
    )
)

# Back-end logic
server <- function(input, output, session) {
    num <- reactive(input$num)

    color <- reactive(input$color)
    output$histogram <- renderPlot(hist(rnorm(num()), col = color()))
}

# Execute
shinyApp(ui, server)
#> 
#> Listening on http://127.0.0.1:8575

Created on 2022-08-04 by the reprex package (v2.0.1)

Session info ``` r sessioninfo::session_info() #> ─ Session info ─────────────────────────────────────────────────────────────── #> setting value #> version R version 4.2.1 (2022-06-23 ucrt) #> os Windows 10 x64 (build 22000) #> system x86_64, mingw32 #> ui RTerm #> language (EN) #> collate English_United States.utf8 #> ctype English_United States.utf8 #> tz America/Chicago #> date 2022-08-04 #> pandoc 2.18 @ C:/PROGRA~3/CHOCOL~1/bin/ (via rmarkdown) #> #> ─ Packages ─────────────────────────────────────────────────────────────────── #> package * version date (UTC) lib source #> bslib 0.4.0 2022-07-16 [1] CRAN (R 4.2.1) #> cachem 1.0.6 2021-08-19 [1] CRAN (R 4.2.0) #> callr 3.7.1 2022-07-13 [1] CRAN (R 4.2.1) #> chromote 0.1.0 2022-04-19 [1] CRAN (R 4.2.1) #> cli 3.3.0 2022-04-25 [1] CRAN (R 4.2.0) #> curl 4.3.2 2021-06-23 [1] CRAN (R 4.2.0) #> digest 0.6.29 2021-12-01 [1] CRAN (R 4.2.0) #> ellipsis 0.3.2 2021-04-29 [1] CRAN (R 4.2.0) #> evaluate 0.15 2022-02-18 [1] CRAN (R 4.2.0) #> fansi 1.0.3 2022-03-24 [1] CRAN (R 4.2.0) #> fastmap 1.1.0 2021-01-25 [1] CRAN (R 4.2.0) #> fs 1.5.2 2021-12-08 [1] CRAN (R 4.2.0) #> glue 1.6.2 2022-02-24 [1] CRAN (R 4.2.0) #> highr 0.9 2021-04-16 [1] CRAN (R 4.2.0) #> htmltools 0.5.3 2022-07-18 [1] CRAN (R 4.2.1) #> httpuv 1.6.5 2022-01-05 [1] CRAN (R 4.2.0) #> httr 1.4.3 2022-05-04 [1] CRAN (R 4.2.0) #> jquerylib 0.1.4 2021-04-26 [1] CRAN (R 4.2.0) #> jsonlite 1.8.0 2022-02-22 [1] CRAN (R 4.2.0) #> knitr 1.39 2022-04-26 [1] CRAN (R 4.2.0) #> later 1.3.0 2021-08-18 [1] CRAN (R 4.2.0) #> lifecycle 1.0.1 2021-09-24 [1] CRAN (R 4.2.0) #> magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.2.0) #> memoise 2.0.1 2021-11-26 [1] CRAN (R 4.2.0) #> mime 0.12 2021-09-28 [1] CRAN (R 4.2.0) #> pillar 1.8.0 2022-07-18 [1] CRAN (R 4.2.1) #> pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.2.0) #> processx 3.7.0 2022-07-07 [1] CRAN (R 4.2.1) #> promises 1.2.0.1 2021-02-11 [1] CRAN (R 4.2.0) #> ps 1.7.1 2022-06-18 [1] CRAN (R 4.2.0) #> purrr 0.3.4 2020-04-17 [1] CRAN (R 4.2.0) #> R.cache 0.16.0 2022-07-21 [1] CRAN (R 4.2.1) #> R.methodsS3 1.8.2 2022-06-13 [1] CRAN (R 4.2.0) #> R.oo 1.25.0 2022-06-12 [1] CRAN (R 4.2.0) #> R.utils 2.12.0 2022-06-28 [1] CRAN (R 4.2.1) #> R6 2.5.1 2021-08-19 [1] CRAN (R 4.2.0) #> ragg 1.2.2 2022-02-21 [1] CRAN (R 4.2.0) #> Rcpp 1.0.9 2022-07-08 [1] CRAN (R 4.2.1) #> reprex 2.0.1 2021-08-05 [1] CRAN (R 4.2.0) #> rlang 1.0.4 2022-07-12 [1] CRAN (R 4.2.1) #> rmarkdown 2.14.3 2022-06-24 [1] Github (rstudio/rmarkdown@d23e479) #> sass 0.4.2 2022-07-16 [1] CRAN (R 4.2.1) #> sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.2.0) #> shiny * 1.7.2.9000 2022-07-25 [1] Github (rstudio/shiny@c21ba0b) #> stringi 1.7.8 2022-07-11 [1] CRAN (R 4.2.1) #> stringr 1.4.0 2019-02-10 [1] CRAN (R 4.2.0) #> styler 1.7.0.9001 2022-07-26 [1] Github (r-lib/styler@3414b81) #> systemfonts 1.0.4 2022-02-11 [1] CRAN (R 4.2.0) #> textshaping 0.3.6 2021-10-13 [1] CRAN (R 4.2.0) #> tibble 3.1.8 2022-07-22 [1] CRAN (R 4.2.1) #> utf8 1.2.2 2021-07-24 [1] CRAN (R 4.2.0) #> vctrs 0.4.1 2022-04-13 [1] CRAN (R 4.2.0) #> webshot 0.5.3 2022-04-14 [1] CRAN (R 4.2.0) #> webshot2 0.1.0 2022-05-18 [1] CRAN (R 4.2.1) #> websocket 1.4.1 2021-08-18 [1] CRAN (R 4.2.0) #> withr 2.5.0 2022-03-03 [1] CRAN (R 4.2.0) #> xfun 0.31 2022-05-10 [1] CRAN (R 4.2.0) #> xml2 1.3.3 2021-11-30 [1] CRAN (R 4.2.0) #> xtable 1.8-4 2019-04-21 [1] CRAN (R 4.2.0) #> yaml 2.3.5 2022-02-21 [1] CRAN (R 4.2.0) #> #> [1] C:/Program Files/R/R-4.2.1/library #> #> ────────────────────────────────────────────────────────────────────────────── ```

System Info

OS Name:                   Microsoft Windows 11 Education
OS Version:                10.0.22000 N/A Build 22000
OS Build Type:             Multiprocessor Free
System Type:               x64-based PC
Processor(s):              1 Processor(s) Installed.
                           [01]: Intel64 Family 6 Model 140 Stepping 1 GenuineIntel ~1104 Mhz

Radian Info

radian version: 0.6.3                                                                                                                                  

r executable: C:\PROGRA~1\R\R-42~1.1\bin\R                                                                                                             

r version: 4.2.1                                                                                                                                       

python executable: C:\ProgramData\Miniconda3\envs\r-reticulate\python.exe                                                                              

python version: 3.7.11                                                                                                                                 
randy3k commented 1 year ago

Look like the same issue as #214.

nikolasharing commented 1 year ago

I'm having the same issue. Sadly the issue https://github.com/randy3k/radian/issues/214 does not have an easy solution for Windows users as well, does it? Or is downgrading to R 4.1.3 the current solution?

pholck commented 1 year ago

I have the same issue. Curiously the small stack size appears to be the same when using R 4.2.3 and R 4.1.3 (1914470 as per Cstack_info() ), and yet I hit that limit running the same shiny app in 4.2.3 whereas I do not (tho it appears close) when running 4.1.3.

Really the problem is as per issue #214 as mentioned by @nikolasharing ...no easy solution for WIndows users, and downgrading to R 4.1.3 (I only upgraded because of other limitations of R 4.1.3) is the only realistic option.

Any chance this will be resolved sometime? It is pretty limiting/constraining (and I am hooked on Radian!). Thank you.

toxintoxin commented 10 months ago

Is it will be solved in the future version?

randy3k commented 10 months ago

There is no easy way to change the stack size on Windows. One thing that we could do is to disable stack check, but it also means that R will be frozen when there is stack overflow.