Closed tobyhodges closed 5 months ago
A similar problem on another site helped me discover that the multiplication sign × also triggers the segfault. This made me wonder if it is a problem with the whole Latin-1 Supplement block of Unicode, but testing with other characters in that block (e.g. thorn Þ ) did not provoke the error.
Interestingly this worked just fine for me on R 4.3.2, but when I upgraded to R 4.4.0, I see the same problem as you.
Backtrace from C:
* frame #0: 0x0000000184750904 libsystem_platform.dylib`_platform_strlen + 4
frame r-lib/pkgdown#1: 0x00000001009f2954 libR.dylib`Rf_mkChar(name=0x0000000000000000) at envir.c:4076:19 [opt]
frame r-lib/pkgdown#2: 0x0000000100a463ac libR.dylib`finalizeData at gram.c:0 [opt]
frame r-lib/pkgdown#3: 0x0000000100a456dc libR.dylib`R_Parse(n=-1, status=0x000000016fdf91ac, srcfile=0x000000010876db68) at gram.c:4215:10 [opt]
frame r-lib/pkgdown#4: 0x0000000100a45770 libR.dylib`R_ParseConn(con=<unavailable>, n=<unavailable>, status=<unavailable>, srcfile=<unavailable>) at gram.c:4277:12 [opt] [artificial]
frame r-lib/pkgdown#5: 0x0000000100adca6c libR.dylib`do_parse(call=<unavailable>, op=<unavailable>, args=<unavailable>, env=<unavailable>) at source.c:294:6 [opt]
Simpler reprex 😄
downlit::autolink_url("×")
Moving to downlit since the source of the problem is there, but it's either a bug with R 4.4 or something is wrong with the way I'm parsing the code. A base R reprex is:
text <- "×"
srcfile <- srcfilecopy("test.r", text)
Encoding(text) <- "unknown"
con <- textConnection(text)
parse(con, keep.source = TRUE, encoding = "UTF-8", srcfile = srcfile)
Thanks very much for the quick response and fix @hadley
Running
pkgdown::build_site()
on a package that includes Markdown files with the ÷ character formatted as code triggers a segfault. See my error output below, when I ran the function on a minimal package whoseindex.md
contains:In my investigations so far, I have come across no other characters that trigger the problem. I am unsure whether the problem is with pkgdown, pandoc, or somewhere else, and I am right at the limits of my R debugging abilities (so far!). Any suggestions you can provide for where to look next would be much appreciated, and I would be happy to provide more information from my side if needed.
Output of
devtools::session_info()
: