unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Problems with HOME on w32
@ 2006-05-18 17:47 Lennart Borgman
  2006-05-18 19:31 ` Eli Zaretskii
  2006-05-19  8:02 ` Jason Rumney
  0 siblings, 2 replies; 9+ messages in thread
From: Lennart Borgman @ 2006-05-18 17:47 UTC (permalink / raw)


There is a message about a problem with HOME on w32 on 
http://www.emacswiki.org/cgi-bin/wiki/EmacsW32 :

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
The symptom is “Error (initialization): User has no home directory” and 
no .emacs file loaded.

A quick kook at HOME env. var shows:

    (getenv "HOME") -> "Š,ûw"

I traced Emacs22 file access with NTFILMON 
(http://www.sysinternals.com). I found that Emacs try to query 
information on |C:\.emacs| (after one on |C:\|) and fails with buffer 
overflow (I guess the structure passed to store query result is too 
small). Seems something goes bad inside Emacs so that HOME is corrupted.

It should be noted that without a |C:\.emacs| file, everything works and 
then .emacs file is expected in %APPDATA% directory for 22.0.50.1 and 
HOME env. var point to this place too.
 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

I tested and got the same result with GNU Emacs 22.0.50.1 
(i386-mingw-nt5.0.2195) of 2006-05-13.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problems with HOME on w32
  2006-05-18 17:47 Problems with HOME on w32 Lennart Borgman
@ 2006-05-18 19:31 ` Eli Zaretskii
       [not found]   ` <446CDB19.9030807@student.lu.se>
  2006-05-19  8:02 ` Jason Rumney
  1 sibling, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2006-05-18 19:31 UTC (permalink / raw)
  Cc: emacs-devel

> Date: Thu, 18 May 2006 19:47:01 +0200
> From: Lennart Borgman <lennart.borgman.073@student.lu.se>
> 
> I traced Emacs22 file access with NTFILMON 
> (http://www.sysinternals.com). I found that Emacs try to query 
> information on |C:\.emacs| (after one on |C:\|) and fails with buffer 
> overflow (I guess the structure passed to store query result is too 
> small). Seems something goes bad inside Emacs so that HOME is corrupted.
> 
> It should be noted that without a |C:\.emacs| file, everything works and 
> then .emacs file is expected in %APPDATA% directory for 22.0.50.1 and 
> HOME env. var point to this place too.
>  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> 
> I tested and got the same result with GNU Emacs 22.0.50.1 
> (i386-mingw-nt5.0.2195) of 2006-05-13.

Lennart, could you please explain in plain English what is the
problem?  I'm sorry, but I cannot make heads or tails out of the
original report you cited, nor can I understand the precise recipe to
reproduce the bug.  Is the reason the non-ASCII characters used in the
value of HOME? or is that the symptom of corruption? what does probing
C:\.emacs have to do with this? etc., etc.

Since you say that you can reproduce the problem with a fairly recent
build, please give a precise recipe for that, including what should be
the value of HOME, which .emacs files should be present in what
directories, etc.

And please don't use NTFILMON or similar tracing tools; instead, if
you need to see what is going on under the hood, please step with a
debugger into the relevant code (it's in the function init_environment
defined on w32.c), and tell what you see.

Thanks.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problems with HOME on w32
  2006-05-18 17:47 Problems with HOME on w32 Lennart Borgman
  2006-05-18 19:31 ` Eli Zaretskii
@ 2006-05-19  8:02 ` Jason Rumney
  2006-05-19 16:37   ` Eli Zaretskii
  1 sibling, 1 reply; 9+ messages in thread
From: Jason Rumney @ 2006-05-19  8:02 UTC (permalink / raw)
  Cc: Emacs Devel

Seems like a bug in the library if the following causes a buffer 
overflow when .emacs exists:

struct stat ignored;
stat ("C:/.emacs", &ignored);


Lennart Borgman wrote:
> There is a message about a problem with HOME on w32 on 
> http://www.emacswiki.org/cgi-bin/wiki/EmacsW32 :
>
> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> The symptom is “Error (initialization): User has no home directory” 
> and no .emacs file loaded.
>
> A quick kook at HOME env. var shows:
>
>    (getenv "HOME") -> "Š,ûw"
>
> I traced Emacs22 file access with NTFILMON
It would be more useful to use gdb.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problems with HOME on w32
       [not found]   ` <446CDB19.9030807@student.lu.se>
@ 2006-05-19  9:50     ` Eli Zaretskii
  2006-05-19 14:14       ` Lennart Borgman
  2006-05-19 19:09     ` Eli Zaretskii
  1 sibling, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2006-05-19  9:50 UTC (permalink / raw)
  Cc: emacs-devel

> Date: Thu, 18 May 2006 22:37:45 +0200
> From: Lennart Borgman <lennart.borgman.073@student.lu.se>
> 
> - Create "C:\.emacs". Put something like (message "c:/emacs here") in it.
> - In cmd.exe shell do "set home="
> - Then start Emacs from this cmd.exe shell with just "emacs.exe".
> 
> The Emacs frame that is shown is for me then splitted in two windows 
> with a warning in the bottom window saying
> 
> Error (initialization): User has no home directory

Thanks, I will look into this today or tomorrow.

And please don't drop the mailing list from the addressees.

Also, I suggest to put on your site somewhere a request that users who
find a bug in Emacs please report it here, because I doubt that any of
the Emacs maintainers track your wiki.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problems with HOME on w32
  2006-05-19  9:50     ` Eli Zaretskii
@ 2006-05-19 14:14       ` Lennart Borgman
  0 siblings, 0 replies; 9+ messages in thread
From: Lennart Borgman @ 2006-05-19 14:14 UTC (permalink / raw)
  Cc: emacs-devel

Eli Zaretskii wrote:
> And please don't drop the mailing list from the addressees.
>   
Sorry, I was in a hurry I guess.

> Also, I suggest to put on your site somewhere a request that users who
> find a bug in Emacs please report it here, because I doubt that any of
> the Emacs maintainers track your wiki.
>   
There is already a page on EmacsWiki:

    http://www.emacswiki.org/cgi-bin/wiki/EmacsBugs

I will put a link to that on my little wiki page. (As soon as I can get 
the table of contents to work for my page ;-|

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problems with HOME on w32
  2006-05-19  8:02 ` Jason Rumney
@ 2006-05-19 16:37   ` Eli Zaretskii
  0 siblings, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2006-05-19 16:37 UTC (permalink / raw)
  Cc: lennart.borgman.073, emacs-devel

> Date: Fri, 19 May 2006 09:02:13 +0100
> From: Jason Rumney <jasonr@gnu.org>
> Cc: Emacs Devel <emacs-devel@gnu.org>
> 
> Seems like a bug in the library if the following causes a buffer 
> overflow when .emacs exists:
> 
> struct stat ignored;
> stat ("C:/.emacs", &ignored);

Sorry, Jason I'm not following: what made you think there's a buffer
overflow in the call to `stat'?  Did you step through the code with a
debugger?  If so, what you saw?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problems with HOME on w32
       [not found]   ` <446CDB19.9030807@student.lu.se>
  2006-05-19  9:50     ` Eli Zaretskii
@ 2006-05-19 19:09     ` Eli Zaretskii
  2006-05-20  6:52       ` Lennart Borgman
  1 sibling, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2006-05-19 19:09 UTC (permalink / raw)
  Cc: emacs-devel

> Date: Thu, 18 May 2006 22:37:45 +0200
> From: Lennart Borgman <lennart.borgman.073@student.lu.se>
> 
> - Create "C:\.emacs". Put something like (message "c:/emacs here") in it.
> - In cmd.exe shell do "set home="
> - Then start Emacs from this cmd.exe shell with just "emacs.exe".
> 
> The Emacs frame that is shown is for me then splitted in two windows 
> with a warning in the bottom window saying
> 
> Error (initialization): User has no home directory

It turns out the code in init_environment was simply not dump-safe.  I
think I fixed it now in CVS; please check.  But beware: to reproduce
the bug you _must_ dump Emacs when C:/.emacs does not exist, then
invoke the dumped Emacs with C:/.emacs in place.  If temacs sees
C:/.emacs, the bug will not happen, even with the sources before my
change.  This puzzled me at first, as just recompiling w32.c seemed to
solve the problem.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problems with HOME on w32
  2006-05-19 19:09     ` Eli Zaretskii
@ 2006-05-20  6:52       ` Lennart Borgman
  2006-05-20  8:52         ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Lennart Borgman @ 2006-05-20  6:52 UTC (permalink / raw)
  Cc: emacs-devel

Eli Zaretskii wrote:
>> Date: Thu, 18 May 2006 22:37:45 +0200
>> From: Lennart Borgman <lennart.borgman.073@student.lu.se>
>>
>> - Create "C:\.emacs". Put something like (message "c:/emacs here") in it.
>> - In cmd.exe shell do "set home="
>> - Then start Emacs from this cmd.exe shell with just "emacs.exe".
>>
>> The Emacs frame that is shown is for me then splitted in two windows 
>> with a warning in the bottom window saying
>>
>> Error (initialization): User has no home directory
>>     
>
> It turns out the code in init_environment was simply not dump-safe.  I
> think I fixed it now in CVS; please check.  But beware: to reproduce
> the bug you _must_ dump Emacs when C:/.emacs does not exist, then
> invoke the dumped Emacs with C:/.emacs in place.  If temacs sees
> C:/.emacs, the bug will not happen, even with the sources before my
> change.  This puzzled me at first, as just recompiling w32.c seemed to
> solve the problem.
>   
Thanks Eli, it looks like the problem is fixed now.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Problems with HOME on w32
  2006-05-20  6:52       ` Lennart Borgman
@ 2006-05-20  8:52         ` Eli Zaretskii
  0 siblings, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2006-05-20  8:52 UTC (permalink / raw)
  Cc: emacs-devel

> Date: Sat, 20 May 2006 08:52:22 +0200
> From: Lennart Borgman <lennart.borgman.073@student.lu.se>
> CC:  emacs-devel@gnu.org
> 
> > It turns out the code in init_environment was simply not dump-safe.  I
> > think I fixed it now in CVS; please check.  But beware: to reproduce
> > the bug you _must_ dump Emacs when C:/.emacs does not exist, then
> > invoke the dumped Emacs with C:/.emacs in place.  If temacs sees
> > C:/.emacs, the bug will not happen, even with the sources before my
> > change.  This puzzled me at first, as just recompiling w32.c seemed to
> > solve the problem.
> >   
> Thanks Eli, it looks like the problem is fixed now.

Thanks for testing.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2006-05-20  8:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-18 17:47 Problems with HOME on w32 Lennart Borgman
2006-05-18 19:31 ` Eli Zaretskii
     [not found]   ` <446CDB19.9030807@student.lu.se>
2006-05-19  9:50     ` Eli Zaretskii
2006-05-19 14:14       ` Lennart Borgman
2006-05-19 19:09     ` Eli Zaretskii
2006-05-20  6:52       ` Lennart Borgman
2006-05-20  8:52         ` Eli Zaretskii
2006-05-19  8:02 ` Jason Rumney
2006-05-19 16:37   ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).