wilkelab / ggtext

Improved text rendering support for ggplot2
https://wilkelab.org/ggtext/
GNU General Public License v2.0
651 stars 37 forks source link

Error: segfault from C stack overflow #34

Closed bhive01 closed 4 years ago

bhive01 commented 4 years ago

See here for my initial look at the issue: https://github.com/tidyverse/dplyr/issues/5243 I have continued to work on this all week and figured some things out. Essentially, all of the data in my example is required to reproduce the problem and so is ggtext.

You need 3 components: RDS: https://drive.google.com/file/d/1lhz7kOTZTKT7Dt0D5bcmbwSldiOLwe6F/view?usp=sharing RMD: https://gist.github.com/bhive01/6f68c3301dbfb75ba0063db2abbc7f64 Rscript: https://gist.github.com/bhive01/e293135e904745a129165794bd4c0032

The RDS is compressed and uncompresses to about 2 GB in RAM. It is a very large multilayered tibble with premade plots embedded. When I run the Rscript with the entire dataset and ggtext, I get:

processing file: PerTrialReportDev.Rmd
  |.............................                                                                                                                                                  |  17%
  |..........................................................                                                                                                                     |  33%
  |........................................................................................                                                                                       |  50%
  |.....................................................................................................................                                                          |  67%
  |..................................................................................................................................................                             |  83%
  |...............................................................................................................................................................................| 100%
label: outputs (with options) 
List of 7
 $ message   : logi FALSE
 $ warning   : logi FALSE
 $ error     : logi FALSE
 $ fig.retina: logi TRUE
 $ fig.height: num 7
 $ fig.width : num 8
 $ results   : chr "asis"

Error: segfault from C stack overflow

This happens consistently for me (session_info's below). If you '#' out library(ggtext) it runs without issue. I've tried it with only slice 1, 2, 3, 1&2, 1&3, 2&3 and it works, but all 3 rows and it segfaults (with ggtext). In Rstudio you get the bomb, I'm using R-gui.

When I run the script without ggtext:


processing file: PerTrialReportDev.Rmd
  |.............................                                                                                                                                                  |  17%
  |..........................................................                                                                                                                     |  33%
  |........................................................................................                                                                                       |  50%
  |.....................................................................................................................                                                          |  67%
  |..................................................................................................................................................                             |  83%
  |...............................................................................................................................................................................| 100%
label: outputs (with options) 
List of 7
 $ message   : logi FALSE
 $ warning   : logi FALSE
 $ error     : logi FALSE
 $ fig.retina: logi TRUE
 $ fig.height: num 7
 $ fig.width : num 8
 $ results   : chr "asis"

output file: PerTrialReportDev.knit.md

/usr/local/bin/pandoc +RTS -K512m -RTS PerTrialReportDev.utf8.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash+smart --output pandoc100c61db9570d.html --email-obfuscation none --self-contained --standalone --section-divs --table-of-contents --toc-depth 4 --variable toc_float=1 --variable toc_selectors=h1,h2,h3,h4 --variable toc_collapsed=1 --variable toc_smooth_scroll=1 --variable toc_print=1 --template /Library/Frameworks/R.framework/Versions/4.0/Resources/library/rmarkdown/rmd/h/default.html --no-highlight --variable highlightjs=1 --variable 'theme:bootstrap' --include-in-header /var/folders/y8/67ytt5n148qfmft0xgrb663m0000gn/T//RtmpAcnOAe/rmarkdown-str100c63c1b331f.html --mathjax --variable 'mathjax-url:https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' --lua-filter /Library/Frameworks/R.framework/Versions/4.0/Resources/library/rmarkdown/rmd/lua/pagebreak.lua --lua-filter /Library/Frameworks/R.framework/Versions/4.0/Resources/library/rmarkdown/rmd/lua/latex-div.lua 

Output created: DEVoutputs/Strawberry/NZPN/NZS1802/NZPN_NZS1802_Experiment_Data_Summary.html

session_info taken after running without ggtext: https://gist.github.com/bhive01/491477484034ad109b9f6791d99afa75 with ggtext: https://gist.github.com/bhive01/43e7aa0f1e52e5e53d8f48801153d403

clauswilke commented 4 years ago

Could you file this with gridtext, please? It's almost certainly not a ggtext issue. ggtext just provides a thin layer on top of gridtext. https://github.com/wilkelab/gridtext/issues