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

NEFTH@pacbell.net NEFTH@pacbell.net
Tue, 28 May 2002 08:42:02 +0200 (MET DST)


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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._