RCall.jl icon indicating copy to clipboard operation
RCall.jl copied to clipboard

segfault with ggplot

Open jotwin opened this issue 8 years ago • 8 comments

works without + geom_smooth() R version 3.3.2 ggplot2 2.2.1

  _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.5.0 (2016-09-19 18:14 UTC)
 _/ |\__'_|_|_|\__'_|  |  
|__/                   |  x86_64-linux-gnu

julia> using RCall

julia> R"library(ggplot2)"
RCall.RObject{RCall.StrSxp}
[1] "ggplot2"   "stats"     "graphics"  "grDevices" "utils"     "datasets" 
[7] "methods"   "base"     

julia> R"qplot(data=data.frame(x=rnorm(100), y=rnorm(100)), x=x, y= y)"
RCall.RObject{RCall.VecSxp}

julia> R"qplot(data=data.frame(x=rnorm(100), y=rnorm(100)), x=x, y= y) + geom_smooth()"
RCall.RObject{RCall.VecSxp}

signal (11): Segmentation fault

signal (ding no file, in expression starting on line 0

signal (11): Segmentation fault
while loading no file, in expresswhile loading no file, in expression starting on line 0
while loading no file, in expresswhile loading no file, in expresswhile loading no file, in expression starting on line 0
while loading no file, in expression starting on line 0
while loading no file, in expressSegmentation fault (core dumped)

jotwin avatar Feb 06 '17 22:02 jotwin

Works fine on mine, but I did notice it throws a warning: maybe this is the problem. Does

R"qplot(data=data.frame(x=rnorm(100), y=rnorm(100)), x=x, y= y) + geom_smooth(method='loess')"

work? Also, does

R"warning('test')"

work?

simonbyrne avatar Feb 07 '17 13:02 simonbyrne

warning works, your other suggestion does not

julia> R"warning('test')"
WARNING: RCall.jl: Warning: test
RCall.RObject{RCall.StrSxp}
[1] "test"


julia> R"qplot(data=data.frame(x=rnorm(100), y=rnorm(100)), x=x, y= y) + geom_smooth(method='loess')"
RCall.RObject{RCall.VecSxp}

signal (11): Segmentation fault

signal (11): Segmentation fault

signal (11): Segmentation fault

signal (11): Segmentation fault
on starting on line 0

signal (11): Segmentation fault
while loading no file, in expression starting on line 0
Segmentation fault (core dumped)

jotwin avatar Feb 07 '17 14:02 jotwin

Hmm, that ruins that theory then. What OS & version (i.e. output of lsb_release -a)?

simonbyrne avatar Feb 07 '17 14:02 simonbyrne

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.1 LTS
Release:	16.04
Codename:	xenial

jotwin avatar Feb 07 '17 15:02 jotwin

@jotwin Were you using X11 as the graphical device? Would you try using pdf device?

R"""
pdf("a.pdf")
print(qplot(data=data.frame(x=rnorm(100), y=rnorm(100)), x=x, y= y) + geom_smooth(method='loess'))
dev.off()
"""

randy3k avatar Feb 07 '17 16:02 randy3k

julia> R"""
       pdf("a.pdf")
       print(qplot(data=data.frame(x=rnorm(100), y=rnorm(100)), x=x, y= y) + geom_smooth(method='loess'))
       dev.off()
       """

signal (11): Segmentation fault
while loading Segmentation fault

signal (11): Segmentation fault
while loading no file, in expresswhile loading no file, in expression starting on line 79

signal (11): Segmentation fault
on starting on line 79

signal (11): Segmentation fault
while loading no file, in expression starting on line 79
Segmentation fault (core dumped)

jotwin avatar Feb 07 '17 16:02 jotwin

Does it work without geom_smotth? (i.e., it creates the file a.pdf). How about running the same commands in R? Does it raise a segfault?

randy3k avatar Feb 07 '17 17:02 randy3k

No problems in R, or in RCall without geom_smooth

jotwin avatar Feb 07 '17 18:02 jotwin