radian icon indicating copy to clipboard operation
radian copied to clipboard

radian crashes with `rmarkdown::render_site()`

Open fisher-j opened this issue 4 years ago • 7 comments

Radian crashes with the following error (courtesy of vscode):

The terminal process "c:\Python\Python39\Scripts\radian.exe '--no-save', '--no-restore'" terminated with exit code: 3221225725.

when attempting: rmarkdown::render_site()

The issue persisted when running radian from the console (cmd.exe).

I'm using Windows 10, radian version:

radian version: 0.5.11 r executable: C:\R\R-4.1.0\bin\R r version: 4.1.0 python executable: c:\python\python39\python.exe python version: 3.9.5

fisher-j avatar Aug 03 '21 21:08 fisher-j

To be honest, I have no idea, likely something interactive has broken radian. Could you do debug(rmarkdown::render_site) and check which lines of code are breaking it?

randy3k avatar Aug 06 '21 17:08 randy3k

The crash starts with line 13:

if (is.null(generator))
        stop("No site generator found.")
    generator$render(input_file = input_file, output_format = output_format,
        envir = envir, quiet = quiet)

It crashes pretty quickly, so I don't think my document is getting rendered at all.

fisher-j avatar Aug 06 '21 22:08 fisher-j

Could you step in generator$render and check?

randy3k avatar Aug 06 '21 23:08 randy3k

I'm not very good at debugging. The farthest I got was here:

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()

but I'm just making blind guesses about where to step in and where to skip functions.

fisher-j avatar Aug 07 '21 01:08 fisher-j

Thanks @fisher-j for the report. We have pushed a fixed in rmarkdown dev version that should solve the issue. It seems using RStudio was hiding the issue somehow.

In my test with radian this seems to be fixed.

cderv avatar Mar 28 '22 18:03 cderv

I recall that python on Windows has a different stack size which makes radian on windows easily subject to these kind of issues.

randy3k avatar Mar 29 '22 09:03 randy3k

Oh this would explain why the issue does not arise on R console then. @fisher-j confirmed it worked in https://github.com/rstudio/rmarkdown/issues/2339#issuecomment-1081139955 so I guess the issue could be closed here.

However, this means than rmarkdown::render_site() with radian require dev version of rmarkdown - Precising for anyone finding this issue and wondering about the fix. Next working release will be rmarkdown 2.14

cderv avatar Mar 29 '22 09:03 cderv