(PR#1605)When dev.list() is NULL, dev.control() causes core dump

ripley@stats.ox.ac.uk ripley@stats.ox.ac.uk
Tue, 28 May 2002 11:45:15 +0200 (MET DST)


This is of course an incorrect usage, which I've trapped at R level, so as
to give an informative warning.

On Tue, 28 May 2002 NEFTH@pacbell.net wrote:

> The following sequence of commands:
> graphics.off()
> dev.control("inhibit")
>
> causes R to memory-fault and core dump. This is reported
> for a new port of R, but is also reproducible on Windows
> and Solaris. The Windows fault is:
>
> RGUI caused an invalid page fault in
> module R.DLL at 017f:00475663.
> Registers:
> EAX=00e4dfd8 CS=017f EIP=00475663 EFLGS=00010246
> EBX=00000001 SS=0187 ESP=008ff144 EBP=008ff15c
> ECX=00002af0 DS=0187 ESI=0059f8c0 FS=4a17
> EDX=00000000 ES=0187 EDI=00e68dd0 GS=0000
> Bytes at CS:EIP:
> 89 82 d8 00 00 00 8d 65 e8 5b 5e c9 c3 55 89 e5
> Stack dump:
> 0059f8c0 00e4dfd8 01758ba0 8065a5a8 17a70d3f 0c700f47 008ff18c 00497293
> 0059f8c0 010abc04 008ff19c 004fb6d0 00000001 00476385 008ff1cc 0047da55
>
> The following patch (diff -c) corrects the problem,
> when applied to src/main/plot.c:
>
> PATCH BEGIN
> *** plot.c.orig Tue Dec  4 23:43:43 2001
> --- plot.c Sun May 26 11:06:25 2002
> ***************
> *** 52,58 ****
>   SEXP do_devcontrol(SEXP call, SEXP op, SEXP args, SEXP env)
>   {
>       checkArity(op, args);
> !     inhibitDisplayList(CurrentDevice());
>       return R_NilValue;
>   }
>
> --- 52,60 ----
>   SEXP do_devcontrol(SEXP call, SEXP op, SEXP args, SEXP env)
>   {
>       checkArity(op, args);
> !     if(!NoDevices()){
> !  inhibitDisplayList(CurrentDevice());
> !     }
>       return R_NilValue;
>   }
>
>
> PATCH END
>
> --please do not edit the information below--
>
> Version:
>  platform = i386-pc-sco3.2v4.2
>  arch = i386
>  os = sco3.2v4.2
>  system = i386, sco3.2v4.2
>  status =
>  major = 1
>  minor = 4.1
>  year = 2002
>  month = 01
>  day = 30
>  language = R
>
> Search Path:
>  .GlobalEnv, Autoloads, package:base
>
>
>
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._