[R] Error with 1.9.0 - Invalid HOMEDRIVE

Duncan Murdoch dmurdoch at pair.com
Wed Apr 21 17:14:19 CEST 2004


On Wed, 21 Apr 2004 14:49:51 +0100 (BST), Prof Brian Ripley
<ripley at stats.ox.ac.uk> wrote:

>
>> What symptoms
>> make you think getenv() is broken?
>
>Because it is the result from getenv that is tested in 1.9.0 and not in
>1.8.1.  The error message from 1.9.0 is generated iff getenv returns an
>overlong string for HOMEDRIVE or HOMEPATH, or a null string for HOMEPATH.  
>We can discard the last being true in the environment, as it works if the
>patch is backed out (as I understand it).  So getenv must suddenly be 
>returning an incorrect result (or something very catastrophic happens to 
>end up jumping to that error message, but let's look for simple 
>explanations first).
>
>> My suspicion about the reported problems would be the usual suspects:
>> anti-virus software, keyboard accelerators, virus infection, etc.
>
>Or in this case we have been told by David Scott and less unequivocably 
>by others, Microsoft critical updates.

What I meant is that there seems to be some interaction between those
updates and something else, and the usual suspects would be the ones I
listed.  (And another suspect I forgot:  getenv is in the MSVCRT dll,
and the version of that probably varies from system to system.)  Since
you and I don't get the errors, it's not *only* the updates that are
causing problems.  

I think it would be helpful if the affected users tried your
suggestion of setting the environment variables explicitly.  Here's
more detail on how:

Change the command line that invokes R to explicitly set the
environment variables, e.g. change the shortcut to have target

[Rhome]\Rgui.exe HOMEDRIVE=C:

If this works, then it would indicate to me that the environment
Windows is passing to R is messed up somehow.  If someone with the
error gets in touch with me offline, I could send them a little
program to examine the environment block and see if there's something
wrong with it.

Duncan Murdoch




More information about the R-help mailing list