From ripley@stats.ox.ac.uk  Sat Jun  3 06:29:22 2000
From: ripley@stats.ox.ac.uk (Prof Brian D Ripley)
Date: Sat, 3 Jun 2000 06:29:22 +0100 (BST)
Subject: [Rd] R.bin (1.1.0) gives segfault
In-Reply-To: <Pine.OSF.4.21.0006022328510.9152-100000@zidsrv.sci.uni-klu.ac.at>
Message-ID: <Pine.GSO.4.05.10006030624570.5027-100000@auk.stats>

On Fri, 2 Jun 2000, Albrecht Gebhardt wrote:

> 
> During testing with R-devel on the alpha I just noticed (after misspelling
> "bin/R" as "bin/R.bin") that R.bin segfaults. It accesses the empty R_HOME
> variable and should better give an error instead of a crash:
> 
> a gdb output snippet:
> ...
> Program received signal SIGSEGV, Segmentation fault.
> 0x3ff800d6a10 in strcpy ()
> (gdb) backtrace
> #0  0x3ff800d6a10 in strcpy ()
> #1  0x1200efda0 in R_load_X11_shlib () at dynload.c:454
> #2  0x1200ecc88 in main (ac=1, av=0x11fffef28) at system.c:160
> (gdb) up
> #1  0x1200efda0 in R_load_X11_shlib () at dynload.c:454
> 454         strcpy(X11_DLL, getenv("R_HOME"));
> 
> some test for getenv returning NULL followed by exit(1) would be
> better. 

Yes, will do.  That's hardly a misspelling, though, and it is hard to know
how far to go to protect users from negligence.  I did actually think about
that, and think `it can't happen: R_HOME is always set in R.sh'.

We've been here before: that construction crashes on some systems and not
on others.

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


[Rd] R.bin (1.1.0) gives segfault
Prof Brian D Ripley