nx10 / httpgd

Asynchronous http server graphics device for R.
https://nx10.github.io/httpgd
GNU General Public License v2.0
377 stars 19 forks source link

Providing extra_css causes segfault #62

Closed ManuelHentschel closed 3 years ago

ManuelHentschel commented 3 years ago

First off, great package, I really like the possibility to inegrate nicely with vscode!

I tried adding custom CSS to hgd, but any string different from the default (empty string) causes R to crash. On windows, the R session just terminates, on wsl-ubuntu the following output is shown:

> httpgd::hgd(extra_css=' ')
httpgd server running at:
  http://127.0.0.1:43849/live?token=9kdFhp5x
> plot(1)
> httpgd::hgd_svg()

 *** caught segfault ***
address 0xd000000, cause 'memory not mapped'

Traceback:
 1: httpgd_svg_(which, page - 1, width, height)
 2: httpgd::hgd_svg()

Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Selection: 

This also happens when using browseURL(httpgd::hgd_url()) or with different values for extra_css. On windows I tried using the CRAN version and an installation from source, on wsl-ubuntu I used the version from CRAN.

nx10 commented 3 years ago

Thank you for checking out httpgd and for reporting this.

Should be fixed now (f0c6a1dcdaf3f935862eeed7c96365caaf2dbf66). I have also added a basic unit test for extra_css.