# emacs 24.3 on Windows 7 does not close properly

I'm running Emacs 24.3 on a Windows 7 machine. No matter how I close the editor, whether Ctrl+X, Ctrl+C, or the menu, Emacs always crashes and I get the error “GNU Emacs: The extensible self-documenting text editor has stopped working” (illustrated below). Does anyone else get a similar error? Does anyone have an idea what might be causing this? FWIW, I had a similar error come up while using Emacs 23 as well. I was under the impression this would go away in Emacs 24. Looks like not. I have attached a screenshot, which links to a full-size version of itself .

I'm also including the complete fault message here, to further assist the trouble shooting:

Problem signature:
Problem Event Name:   APPCRASH
Application Name: emacs.exe
Application Version:  24.3.0.0
Application Timestamp:    51461ed8
Fault Module Name:    libgcc_s_dw2-1.dll
Fault Module Version: 0.0.0.0
Exception Code:   40000015
Exception Offset: 00016646
OS Version:   6.1.7601.2.1.0.768.3
Locale ID:    2057

-
Could you include the rest of the error message? It seems to be a problem with libgcc. Does the error message give you a "Faulting module path"? –  terdon Apr 1 '13 at 19:40
@terdon, Here's the rest of the message: Problem signature: Problem Event Name: APPCRASH Application Name: emacs.exe Application Version: 24.3.0.0 Application Timestamp: 51461ed8 Fault Module Name: libgcc_s_dw2-1.dll Fault Module Version: 0.0.0.0 Fault Module Timestamp: 4bc96cad Exception Code: 40000015 Exception Offset: 00016646 OS Version: 6.1.7601.2.1.0.768.3 Locale ID: 2057 Additional Information 1: 40aa Additional Information 2: 40aadffc5490879468da6327c52e8317 Additional Information 3: 30a6 Additional Information 4: 30a67832b564ca36083716f18a2a95ef  –  Surio Apr 2 '13 at 3:21
@terdon, as you can see above there was no "faulting module path" error in the error message. But I have attached the complete error message in the main question -- it is more clearly formatted and readable there than here. Sorry about it. –  Surio Apr 2 '13 at 3:28
Maybe you have the same problem as this guy: lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00194.html –  jjlin Apr 3 '13 at 5:32
@jjlin, Thanks for commenting. I used dependency walker, and was surprised to find that there was absolutely no mention of libgcc_s_dw2-1.dll. But, there are 16 libgcc_s_dw2-1.dll files in total on my machine related to various FOSS modules. I tried pasting these dlls from 3-4 different applications, one at a time, into \bin\emacs.exe dir, but I still get the same error. I stopped this exercise at this point as it is actually not going anywhere. Simply put, dependency walker does not show libgcc_s_dw2-1.dll! Whoa! –  Surio Apr 3 '13 at 14:17

I was having this problem.

I solved it for my setup by passing the --no-splash option to emacs on start up.

I don't get a splash screen now, but I don't crash on exit either.

-
Like I mentioned to another one earlier, thanks for taking an interest and replying. What is interesting, is that when I moved from Win 7 Home Premium 32 bits to Win 7 Home Premium 64 bits, this crash went away! [Touch wood!] I hope this is the last I see of this error. –  Surio Oct 2 '13 at 12:57

I just had this problem while setting up a new Windows 7 laptop. Checking the Windows event viewer revealed that the version of Emacs libgcc_s_dw2-1.dll was linking to was the culprit. A quick scan of my C drive with Everything resulted in no fewer than seven versions of the library scattered among various versions of MinGW that I had install alongside other apps, RStudio, OSGeo4W, CodeBlocks, etc. A couple of which had injected themselves into my system path variable.

The solution for me was to ensure Emacs found a compatible libgcc_s_dw2-1.dll or none at all by setting the PATH variable before starting Emacs. From a command line type set path= to clear the path variable before starting emacs with c:\<pathtoemacsbin>\runemacs.exe, assuming you will not need path access to other files. Alternatively, a recent version of MinGW32 should be compatible. Just make sure it is available on the search path, set path=c:\MinGW32\bin.

-

AFAIK, libgcc_s_dw2-1.dll is statically linked so it is irrelevant the origin of the file.

I have experienced the same crashes and I can confirm two things:

• No crashes in emacs 24.3 built with gcc v3.x.x

• No crashes in emacs 24.3 built with gcc v4.5 sjlj

http://sourceforge.net/mailarchive/message.php?msg_id=27481215

might confirm the last point.

HTH

-
Interesting point! From the emacs startup page "This is GNU Emacs 24.3.1 (i386-mingw-nt6.1.7601) of 2013-03-18 on MARVIN". No mention of version. –  Surio Apr 5 '13 at 12:26

You don't say whether the crashes happen when you start without an init file (~/.emacs), i.e., using emacs -Q. If so, you might consider filing a bug report with a reproducible recipe. If not, bisect your init file recursively until you find the culprit code.

emacs -Q is the place to start: (a) when reporting a problem and (b) when debugging.

-
thanks for taking an interest and replying. What is interesting, is that when I moved from Win 7 Home Premium 32 bits to Win 7 Home Premium 64 bits, this crash went away! [Touch wood!] I hope this is the last I see of this error. –  Surio Sep 12 '13 at 8:49