all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* emacs won't start interactively
@ 2019-05-26  3:27 Joe_Trivers--- via help-gnu-emacs
  2019-05-26 13:43 ` Óscar Fuentes
  2019-05-26 14:41 ` Eli Zaretskii
  0 siblings, 2 replies; 11+ messages in thread
From: Joe_Trivers--- via help-gnu-emacs @ 2019-05-26  3:27 UTC (permalink / raw)
  To: help-gnu-emacs

O great emacs wizards,

I am trying to install emacs on a new (to me) desktop Windows 10 PC. After following the download instructions for Windows, clicking on the runemacs.exe icon has no apparent effect. Running emacs from the command prompt with a --help argument produces the Usage: line and list of command line options. Running emacs as:
 emacs-26.1\bin\emacs --batch -eval (message \"hi there\")
produces the expected string:
  hi there
so apparently command line parsing and elisp execution works. However, running just emacs-26.1\bin\emacs returns almost immediately with no output, and so does emacs-26.1\bin\emacs -nw.

First I downloaded and unpacked emacs-26.2-i686.zip from a mirror and it didn't work. I then tried emacs-26.2-x86_64.zip emacs-26.1-x86_64.zip from the ftp.gnu.org site, as well as the no-deps version with emacs-26-x86_64-deps unpacked on top. None of them worked. I moved the unpacked tree from <me>\Downloads to c:\GNU but that didn't seem to help either.

I installed 26.1-x86_64 on a Windows 10 laptop last year (in c:\GNU) and it works just fine. Both PCs are set up by my employer's IT department, presumably using the same procedure. I can't figure out what's different on this system. Using "run as administrator" doesn't seem to make any difference.

Can someone please advise me what might be wrong, or what I can try next?

/Joe

The content of this message is APPLIED MATERIALS CONFIDENTIAL. If you are not the intended recipient, please notify me, delete this email and do not use or distribute this email.



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

* Re: emacs won't start interactively
  2019-05-26  3:27 Joe_Trivers--- via help-gnu-emacs
@ 2019-05-26 13:43 ` Óscar Fuentes
  2019-05-26 14:41 ` Eli Zaretskii
  1 sibling, 0 replies; 11+ messages in thread
From: Óscar Fuentes @ 2019-05-26 13:43 UTC (permalink / raw)
  To: help-gnu-emacs

Joe_Trivers--- via help-gnu-emacs <help-gnu-emacs@gnu.org> writes:

> I am trying to install emacs on a new (to me) desktop Windows 10 PC.
> After following the download instructions for Windows, clicking on the
> runemacs.exe icon has no apparent effect. Running emacs from the
> command prompt with a --help argument produces the Usage: line and
> list of command line options. Running emacs as: emacs-26.1\bin\emacs
> --batch -eval (message \"hi there\") produces the expected string: hi
> there so apparently command line parsing and elisp execution works.
> However, running just emacs-26.1\bin\emacs returns almost immediately
> with no output, and so does emacs-26.1\bin\emacs -nw.
>
> First I downloaded and unpacked emacs-26.2-i686.zip from a mirror and
> it didn't work. I then tried emacs-26.2-x86_64.zip
> emacs-26.1-x86_64.zip from the ftp.gnu.org site, as well as the
> no-deps version with emacs-26-x86_64-deps unpacked on top. None of
> them worked. I moved the unpacked tree from <me>\Downloads to c:\GNU
> but that didn't seem to help either.
>
> I installed 26.1-x86_64 on a Windows 10 laptop last year (in c:\GNU)
> and it works just fine. Both PCs are set up by my employer's IT
> department, presumably using the same procedure. I can't figure out
> what's different on this system. Using "run as administrator" doesn't
> seem to make any difference.
>
> Can someone please advise me what might be wrong, or what I can try
> next?

What's the exit code of emacs?

emacs.exe -nw
echo %errorlevel%

or

start /wait emacs.exe
echo %errorlevel%

If, on the command line, you set PATH to the bare minimum
(c:\windows\system32) and then run emacs.exe, does it work?

You can try installing Dependencies [1] and see if there is some missing
dll or a mismatch.

1. https://github.com/lucasg/Dependencies




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

* Re: emacs won't start interactively
  2019-05-26  3:27 Joe_Trivers--- via help-gnu-emacs
  2019-05-26 13:43 ` Óscar Fuentes
@ 2019-05-26 14:41 ` Eli Zaretskii
  1 sibling, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2019-05-26 14:41 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Sun, 26 May 2019 03:27:24 +0000
> From: Joe_Trivers--- via help-gnu-emacs <help-gnu-emacs@gnu.org>
> 
> running just emacs-26.1\bin\emacs returns almost immediately with no output, and so does emacs-26.1\bin\emacs -nw.

What if you type "emacs-26.1\bin\emacs -Q", does that also exit
immediately?

> First I downloaded and unpacked emacs-26.2-i686.zip from a mirror and it didn't work. I then tried emacs-26.2-x86_64.zip emacs-26.1-x86_64.zip from the ftp.gnu.org site, as well as the no-deps version with emacs-26-x86_64-deps unpacked on top. None of them worked. I moved the unpacked tree from <me>\Downloads to c:\GNU but that didn't seem to help either.

How did you unpack the zip files, exactly?  Please describe what
utility/program you used to unpack, what did you type/click/select
etc., step by step.



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

* Re: emacs won't start interactively
       [not found] <BN6P102MB00661ACF5A35AD540DAC0C10EE1D0@BN6P102MB0066.NAMP102.PROD.OUTLOOK.COM>
@ 2019-05-27 16:59 ` Eli Zaretskii
  2019-05-27 17:09   ` Óscar Fuentes
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2019-05-27 16:59 UTC (permalink / raw)
  To: help-gnu-emacs

[Please reply to the list or Reply to All, so that everybody could see
your responses.]

> From: <Joe_Trivers@amat.com>
> Date: Mon, 27 May 2019 02:13:08 +0000
> 
> Hi Eli,
> Thank you for your reply.
> 
> > What if you type "emacs-26.1\bin\emacs -Q", does that also exit
> > immediately?
> 
> emacs -Q also exits immediately. I'm sure I tried that. I'm not where the machine is now so I can't try it today.
> 
> > How did you unpack the zip files, exactly?
> 
> I used Windows 10 native zip support. Right-click on the zip file icon, pick Unpack All, give it a directory name, and it unpacks all the files. Specifically, I gave it "c:\users\<my windows id>\Downloads\emacs-26.1" and it created directories bin, lib, and so on under that one.
> 
> I failed to mention that I copied the emacs-26.1.exe from the laptop where emacs works, using ftp binary to an HP-UX system and then ftp binary from there to the new machine. Running that file exited immediately, too. The file size of the .exe was identical on the two machines: 124,661,533 bytes.

I suspect some incompatible DLLs you have on your system.  Please
download the Dependency Walker from here:

  http://www.dependencywalker.com/

and use it to show what DLLs other than those which came with the
Emacs zip files you installed Emacs binds to on your system.
Incompatible DLLs should be shown in red, but in general I'd suspect
any DLL that didn't come with Windows which is found outside the Emacs
installation tree.

Please note that there are 2 kinds of executables on the GNU FTP site:
the 32-bit and the 64-bit.  Depending on which one you installed
(x86_64 is a 64-bit build), you will need a corresponding version of
the Dependency Walker and a corresponding version of the dependency
DLLs from the FTP site.



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

* Re: emacs won't start interactively
  2019-05-27 16:59 ` emacs won't start interactively Eli Zaretskii
@ 2019-05-27 17:09   ` Óscar Fuentes
  0 siblings, 0 replies; 11+ messages in thread
From: Óscar Fuentes @ 2019-05-27 17:09 UTC (permalink / raw)
  To: help-gnu-emacs

Eli Zaretskii <eliz@gnu.org> writes:

> I suspect some incompatible DLLs you have on your system.  Please
> download the Dependency Walker from here:
>
>   http://www.dependencywalker.com/
>
> and use it to show what DLLs other than those which came with the
> Emacs zip files you installed Emacs binds to on your system.
> Incompatible DLLs should be shown in red, but in general I'd suspect
> any DLL that didn't come with Windows which is found outside the Emacs
> installation tree.
>
> Please note that there are 2 kinds of executables on the GNU FTP site:
> the 32-bit and the 64-bit.  Depending on which one you installed
> (x86_64 is a 64-bit build), you will need a corresponding version of
> the Dependency Walker and a corresponding version of the dependency
> DLLs from the FTP site.

Dependency Walker is not realiable on recent Windows versions, less so
if they are 64 bits. It gives lots of false errors.

In my other response I recommended Dependencies, which is maintained and
Free Software:

https://github.com/lucasg/Dependencies




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

* Re: emacs won't start interactively
@ 2019-05-28  1:09 Joe Trivers via help-gnu-emacs
  2019-05-28  2:10 ` Óscar Fuentes
  2019-05-28 14:48 ` Eli Zaretskii
  0 siblings, 2 replies; 11+ messages in thread
From: Joe Trivers via help-gnu-emacs @ 2019-05-28  1:09 UTC (permalink / raw)
  To: help-gnu-emacs

[I hope "Re:" in the subject line does the Right Thing.]

From:Óscar Fuentes

> What's the exit code of emacs?
>
> emacs.exe -nw
> echo %errorlevel%

1

> If, on the command line, you set PATH to the bare minimum
> (c:\windows\system32) and then run emacs.exe, does it work?

Same result.

> You can try installing Dependencies [1] and see if there is some missing
> dll or a mismatch.

It shows a _lot_ of dependencies, 81  lines in the Module subwindow. They're all in or under C:\Windows\system32, near as I can tell. Not sure how to find incompatible ones. All are shown as Machine: AMD64. Many are api-ms-win-core-*.dll -> C:\Windows\system32\kernel32.dll or kernelbase.dll or powrprof.dll or sechost.dll or a few other ones.

I installed enough of MinGW to get gdb going, and then noticed it appears to be 32-bit only so I re-unpacked the emacs-26.2-i686 zip that I tried the first time. It, too, exits immediately when I run bin\emacs.exe or runemacs.exe. I ran emacs.exe with gdb and gave it an "r" command, hoping for a stack trace when something broke. To my astonishment, emacs popped up in a window and looked perfect.

Very interesting, I thought. I tried to run the 64-bit emacs.exe with gdb but it said it didn't recognize the format of the executable.

I then installed mingw-w64 and ran the 64-bit emacs-26.1.exe with that gdb, and it also produced a perfectly cromulent emacs window. So apparently whatever goes wrong is cured by running under gdb.

Any further thoughts about what might be happening here? And on how gdb could be making it work correctly?

The content of this message is APPLIED MATERIALS CONFIDENTIAL. If you are not the intended recipient, please notify me, delete this email and do not use or distribute this email.



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

* Re: emacs won't start interactively
  2019-05-28  1:09 Joe Trivers via help-gnu-emacs
@ 2019-05-28  2:10 ` Óscar Fuentes
  2019-05-28 14:51   ` Eli Zaretskii
  2019-05-28 14:48 ` Eli Zaretskii
  1 sibling, 1 reply; 11+ messages in thread
From: Óscar Fuentes @ 2019-05-28  2:10 UTC (permalink / raw)
  To: help-gnu-emacs

Joe Trivers via help-gnu-emacs <help-gnu-emacs@gnu.org> writes:

> I then installed mingw-w64 and ran the 64-bit emacs-26.1.exe with that
> gdb, and it also produced a perfectly cromulent emacs window. So
> apparently whatever goes wrong is cured by running under gdb.
>
> Any further thoughts about what might be happening here? And on how
> gdb could be making it work correctly?

If you execute emacs.exe instead of `gdb emacs.exe' from the same
command prompt you use for executing gdb, does emacs work? If you put at
the front of PATH the bin/ directory of mingw-w64 and then execute
emacs.exe, does it work?

If yes, your mingw-w64 install probably contains some dll that is broken
or missing from emacs/bin directory.

As for the output of Dependencies, it should mark in some prominent
color those dlls that are missing or don't contain a required symbol. It
is important that you invoke Dependencies from the same environment
(i.e. command prompt) you invoke emacs.exe.

Maybe the antivirus ate some of the dlls shipped with Emacs.

You mentioned that you installed Emacs 26.1. There are binary packages
for 26.2 (the most recent released version) on the gnu ftp server. If
all the above does not give a meaningful result, you could try that
version, just in case.

Are you using cmd.exe as your shell and terminal, or something else?

(This problem rings some bells here, but can't remember with certainty
what caused the same symptoms on some of my machines time ago.)




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

* Re: emacs won't start interactively
  2019-05-28  1:09 Joe Trivers via help-gnu-emacs
  2019-05-28  2:10 ` Óscar Fuentes
@ 2019-05-28 14:48 ` Eli Zaretskii
  1 sibling, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2019-05-28 14:48 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Tue, 28 May 2019 01:09:23 +0000
> From: Joe Trivers via help-gnu-emacs <help-gnu-emacs@gnu.org>
> 
> Any further thoughts about what might be happening here? And on how gdb could be making it work correctly?

I'd have a good look at the environment variables you have set.  Are
some of them Emacs related, perhaps?  Any suspicious ones?  Maybe post
the whole list of them here, perhaps someone will spot something.

Also, do you see anything in the Windows' Event Logger, under
Application, around the times when you start Emacs and it immediately
exits?



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

* Re: emacs won't start interactively
  2019-05-28  2:10 ` Óscar Fuentes
@ 2019-05-28 14:51   ` Eli Zaretskii
  0 siblings, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2019-05-28 14:51 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Óscar Fuentes <ofv@wanadoo.es>
> Date: Tue, 28 May 2019 04:10:56 +0200
> 
> Maybe the antivirus ate some of the dlls shipped with Emacs.

Missing DLLs shouldn't cause Emacs exit.  If the antivirus left the
file in some corrupted state, then maybe.

Btw, the only non-system DLL that "emacs -Q" loads is libXpm, so
that's the only one which could be responsible for such a fast exit.



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

* Re: emacs won't start interactively
@ 2019-05-28 17:30 Joe Trivers via help-gnu-emacs
  2019-05-28 18:55 ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Joe Trivers via help-gnu-emacs @ 2019-05-28 17:30 UTC (permalink / raw)
  To: help-gnu-emacs

From: help-gnu-emacs On Behalf Of Eli Zaretskii
Sent: 28 May, 2019 10:48 AM

>> Date: Tue, 28 May 2019 01:09:23 +0000
>> From: Joe Trivers via help-gnu-emacs <help-gnu-emacs@gnu.org>
>>
>> Any further thoughts about what might be happening here? And on how gdb could be making it work correctly?
>
> I'd have a good look at the environment variables you have set.  Are
> some of them Emacs related, perhaps?  Any suspicious ones?  Maybe post
> the whole list of them here, perhaps someone will spot something.

Nothing looks relevant, other than PATH. Is there a way in cmd.exe (like env in bash) to get such a list?

> Also, do you see anything in the Windows' Event Logger, under
> Application, around the times when you start Emacs and it immediately
> exits?

You may have something there.

Log Name: Application
Source: CbDefense
Information: The application "C:\gnu\emacs-26.1\bin\emacs-26.1.exe" attempted to inject code into the process "C:\GNU\emacs-26.1\bin\emacs-26.1.exe" by calling the function "SetWindowsHookExA". The operation was blocked and the application terminated by Confer.

CbDefense is Carbon Black Antivirus, mandated by our IT department. It also runs on the laptop where emacs 26.1 works properly. Perhaps there's a way to whitelist emacs?
Incidentally, when I typed the command into the Windows command prompt I used capital letters for "GNU".

HAH! I renamed the C:\GNU directory to C:\gnu (in lower case) and now it works properly. Maybe CbDefense lowercases one string but not the other?
And, yes, the "gnu" directory name is in lower case on the laptop where emacs has been working since last year. [facepalm]

Thanks for all your help. Who'd'a thunk it?  /Joe
The content of this message is APPLIED MATERIALS CONFIDENTIAL. If you are not the intended recipient, please notify me, delete this email and do not use or distribute this email.



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

* Re: emacs won't start interactively
  2019-05-28 17:30 Joe Trivers via help-gnu-emacs
@ 2019-05-28 18:55 ` Eli Zaretskii
  0 siblings, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2019-05-28 18:55 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Tue, 28 May 2019 17:30:11 +0000
> From: Joe Trivers via help-gnu-emacs <help-gnu-emacs@gnu.org>
> 
> > I'd have a good look at the environment variables you have set.  Are
> > some of them Emacs related, perhaps?  Any suspicious ones?  Maybe post
> > the whole list of them here, perhaps someone will spot something.
> 
> Nothing looks relevant, other than PATH. Is there a way in cmd.exe (like env in bash) to get such a list?

At the cmd prompt, type "set" and press Enter.

> > Also, do you see anything in the Windows' Event Logger, under
> > Application, around the times when you start Emacs and it immediately
> > exits?
> 
> You may have something there.
> 
> Log Name: Application
> Source: CbDefense
> Information: The application "C:\gnu\emacs-26.1\bin\emacs-26.1.exe" attempted to inject code into the process "C:\GNU\emacs-26.1\bin\emacs-26.1.exe" by calling the function "SetWindowsHookExA". The operation was blocked and the application terminated by Confer.

That's definitely your villain.

> Incidentally, when I typed the command into the Windows command prompt I used capital letters for "GNU".
> 
> HAH! I renamed the C:\GNU directory to C:\gnu (in lower case) and now it works properly. Maybe CbDefense lowercases one string but not the other?
> And, yes, the "gnu" directory name is in lower case on the laptop where emacs has been working since last year. [facepalm]

So it's a simple bug in CbDefense: it doesn't know that file names on
Windows are case-insensitive.



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

end of thread, other threads:[~2019-05-28 18:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <BN6P102MB00661ACF5A35AD540DAC0C10EE1D0@BN6P102MB0066.NAMP102.PROD.OUTLOOK.COM>
2019-05-27 16:59 ` emacs won't start interactively Eli Zaretskii
2019-05-27 17:09   ` Óscar Fuentes
2019-05-28 17:30 Joe Trivers via help-gnu-emacs
2019-05-28 18:55 ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2019-05-28  1:09 Joe Trivers via help-gnu-emacs
2019-05-28  2:10 ` Óscar Fuentes
2019-05-28 14:51   ` Eli Zaretskii
2019-05-28 14:48 ` Eli Zaretskii
2019-05-26  3:27 Joe_Trivers--- via help-gnu-emacs
2019-05-26 13:43 ` Óscar Fuentes
2019-05-26 14:41 ` Eli Zaretskii

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.