Bug 14790 - segfault - svg device with non-existing path
Summary: segfault - svg device with non-existing path
Alias: None
Product: R
Classification: Unclassified
Component: Graphics (show other bugs)
Version: R 2.14.1
Hardware: All All
: P5 normal
Assignee: R-core
Depends on:
Reported: 2012-01-23 10:17 UTC by Rainer Stuetz
Modified: 2014-02-16 11:43 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Rainer Stuetz 2012-01-23 10:17:25 UTC
Using the svg device (cairo) with a nonexistent directory and invoking two plot commands causes a crash.

Reproducible example:

svg(filename="/foo/bar/baz.svg")  # non-existing path
plot(1)  # Error in plot.new() : cairo error 'error while writing to output stream'
plot(1)  # -> segfault

I have reproduced the problem with R 2.14.1 on Ubuntu/64 Bit (Oneiric), Windows 7/64 Bit (32 and 64 Bit R) and Mac OS 10.7 (Lion).

$ R --vanilla -q -d gdb
GNU gdb (Ubuntu/Linaro 7.3-0ubuntu2) 7.3-2011.08
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
Reading symbols from /usr/lib/R/bin/exec/R...(no debugging symbols found)...done.
(gdb) run
Starting program: /usr/lib/R/bin/exec/R --vanilla -q
[Thread debugging using libthread_db enabled]
> svg("/foo/bar/baz.svg")
> plot(1)
Error in plot.new() : cairo error 'error while writing to output stream'
> plot(1)

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff2b1b551 in cairo_show_page () from /usr/lib/x86_64-linux-gnu/libcairo.so.2

> sessionInfo()
R version 2.14.1 (2011-12-22)
Platform: x86_64-pc-linux-gnu (64-bit)

 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [7] LC_PAPER=C                 LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base
Comment 1 Brian Ripley 2012-02-10 08:41:07 UTC
Really a cairo bug, worked around.
Comment 2 Jackie Rosen 2014-02-16 11:43:29 UTC
(spam comment removed)