[Rd] detach(package:base) kills R (PR#1271)

david.heffernan@orcina.com david.heffernan@orcina.com
Thu, 17 Jan 2002 09:54:15 +0100 (MET)


Full_Name: David Heffernan
Version: 1.3.1
OS: Windows & Linux
Submission from: (NULL) (158.152.160.7)


The command detach(package:base) kills R with segmentation fault on Linux and an
access violation on Windows.  I guess the same will happen on any platform. 
Obviously this is a not a sensible command to execute but you could easily do it
by accident particularly if using the pos parameter to detach and getting it
wrong.

It seems to me that an obvious fix is to report an error in do_detach in envir.c
if the base package is the one which the caller is attempting to detach.

As a related issue it seems bad that when R crashes it doesn't give you a chance
to save your workspace.  In fact, why does an access violation have to cause
termination?  At the least the user should get a chance to save their workspace
before termination.  At best R would report the error an carry running.

By the way, it's a great piece of software!!

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