Skip to content

running rmarkdown::render_site() crashes radian on windows #2339

Closed

Description

@fisher-j

Any time I attempt to run rmarkdown::render_site() in radian in vscode (on windows), the terminal crashes with this message:

The terminal process "C:\Users\walki\AppData\Local\Programs\Python\Python39\Scripts\radian.exe '--no-save', '--no-restore'" terminated with exit code: 3221225725.

Radian also crashes (with render_site function) when running outside of vscode.

Running render_site() using R.exe in vscode terminal works fine, my site renders with no problems.

I've mentioned this problem on randy3k/radian.

I attempted using debug to trace down the problematic call, but was just making blind guesses, I'll copy the where: output here in case its helpful:

where 1: same_path(dir, file.path(dir, ".."))
where 2: proj_root(input, "^index.R?md$", "^\\s*site:.*::.*$")
where 3: doTryCatch(return(expr), name, parentenv, handler)
where 4: tryCatchOne(expr, names, parentenv, handlers[[1L]])
where 5: tryCatchList(expr, classes, parentenv, handlers)
where 6: tryCatch(proj_root(input, "^index.R?md$", "^\\s*site:.*::.*$"), 
    error = function(e) NULL)
where 7: site_generator(input, output_format)
where 8: rmarkdown::render_site()

Output of xfun::session_info()

R version 4.1.2 (2021-11-01)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042), RStudio 0

Locale:
  LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252 LC_NUMERIC=C
  LC_TIME=English_United States.1252

Package version:
  base64enc_0.1.3 bslib_0.3.1     digest_0.6.29   evaluate_0.15   fastmap_1.1.0   fs_1.5.2        glue_1.6.2      graphics_4.1.2  grDevices_4.1.2 highr_0.9
  htmltools_0.5.2 jquerylib_0.1.4 jsonlite_1.8.0  knitr_1.38      magrittr_2.0.2  methods_4.1.2   R6_2.5.1        rappdirs_0.3.3  rlang_1.0.2     rmarkdown_2.13
  sass_0.4.1      stats_4.1.2     stringi_1.7.6   stringr_1.4.0   tinytex_0.37    tools_4.1.2     utils_4.1.2     xfun_0.30       yaml_2.3.5

Pandoc version: 2.17.1.1

Activity

  1. changed the title [-]running `rmarkdown::render_site()` crashes radian in vscode on windows[/-] [+]running `rmarkdown::render_site()` crashes radian on windows[/+] on Mar 26, 2022
  2. cderv commented on Mar 28, 2022

    @cderv
    Collaborator

    Thanks for the report. I can reproduce this.

    At some point, this is called , which cause a C stack limit outside of radian

    > rmarkdown:::proj_root('.', "^index.R?md$", "^\\s*site:.*::.*$")
    Error: C stack usage  15923520 is too close to the limit

    I am surprised that this happens - rmarkdown::render_site() does not error the same inside RStudio

  3. cderv commented on Mar 28, 2022

    @cderv
    Collaborator

    rmarkdown::render_site() does not error the same inside RStudio

    In fact I can sometime reproduce inside R and RStudio too... not sure when this infinite loop of proj_root() was introduced...

    @yihui does this happen to you also on Mac ?

  4. added
    bug
    on Mar 28, 2022
  5. yihui commented on Mar 28, 2022

    @yihui
    Collaborator

    I just pushed a fix for the problem in rmarkdown:::proj_root('.', "^index.R?md$", "^\\s*site:.*::.*$"). Not sure if that would fix the original radian issue, though. @fisher-j We can re-open and investigate further if the dev version of rmarkdown still doesn't work for you. Thanks!

  6. moved this from Backlog to Done in R Markdown Team Projectson Mar 28, 2022
  7. cderv commented on Mar 28, 2022

    @cderv
    Collaborator

    Thanks. I can confirm this is fixed with radian also and this was the issue.

    I wonder where this comes from though - seems like an issue we would have found earlier.

  8. yihui commented on Mar 28, 2022

    @yihui
    Collaborator

    I was also a little surprised that we didn't find this bug earlier. Sounds like the infinite recursion inside tryCatch() can crash radian more easily than RStudio? I don't know.

  9. cderv commented on Mar 28, 2022

    @cderv
    Collaborator

    I was curious so looked futher. My tests showned that in RStudio IDE it seemed to work, but not in debug mode oddly. And in R console, it worked. It seems like tryCatch() is correctly catching the issue... disturbing...
    So I really don't know what is causing the issue. I just know it happened when we removed rprojtoot use to add our own version (0ea439d). So I guess no other side effect to expect....

  10. fisher-j commented on Mar 28, 2022

    @fisher-j
    Author
  11. added a commit that references this issue on May 5, 2022
    acd53a3
  12. github-actions commented on Sep 27, 2022

    @github-actions

    This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.

  13. locked as resolved and limited conversation to collaborators on Sep 27, 2022
  14. added a commit that references this issue on May 22, 2025
    f89f98b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions