Subject: bug#34277: Error after dump complete when build on Windows 10

From: "Shuguang Sun" <[email-masked]>
Date: Sat, 2 Feb 2019 20:44:02 +0800

# gcc --version
gcc.exe (Rev1, Built by MSYS2 project) 8.2.1 20181214

Here is the GDB information
```
(gdb) run  -batch --no-site-file --no-site-lisp --eval "(setq load-prefer-newer t)" -f batch-byte-compile emacs-lisp/macroexp.el
Starting program: C:\gitemacs\emacs\src\bootstrap-emacs.exe -batch --no-site-file --no-site-lisp --eval "(setq load-prefer-newer t)" -f batch-byte-compile emacs-lisp/macroexp.el
[New Thread 123272.0x517c]
warning: FTH: (123272): *** Fault tolerant heap shim applied to current process. This is usually due to previous crashes. ***
[New Thread 123272.0x23114]
[New Thread 123272.0x14c54]
[New Thread 123272.0x50b0]
[Thread 123272.0x14c54 exited with code 0]
[Thread 123272.0x23114 exited with code 0]
[Thread 123272.0x50b0 exited with code 0]

Thread 1 received signal SIGSEGV, Segmentation fault.
0x00007ffaa8859f60 in ntdll!RtlAllocateHeap ()
   from C:\WINDOWS\SYSTEM32\ntdll.dll
(gdb) thread 1
[Switching to thread 1 (Thread 123272.0x517c)]
#0  0x00007ffaa8859f60 in ntdll!RtlAllocateHeap ()
   from C:\WINDOWS\SYSTEM32\ntdll.dll
(gdb) backtrace
#0  0x00007ffaa8859f60 in ntdll!RtlAllocateHeap ()
   from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ffa64506ef8 in NotifyShims ()
   from C:\WINDOWS\AppPatch\AppPatch64\AcLayers.dll
#2  0x00000004001b72d7 in malloc_before_dump (size=<optimized out>)
    at w32heap.c:376
#3  0x0000000400100961 in lmalloc (size=56) at alloc.c:1486
#4  xmalloc (size=size@entry=56) at alloc.c:892
#5  0x00000004001ab4ec in GetCachedVolumeInformation (
    root_dir=<optimized out>) at w32.c:3303
#6  get_volume_info (
    name=name@entry=0xbff890 "C:\\gitemacs\\emacs\\src\\bootstrap-emacs.pdmp", pPath=pPath@entry=0xbff0f8) at w32.c:3353
#7  0x00000004001ad5af in is_fat_volume (pPath=0xbff0f8,
    name=0xbff890 "C:\\gitemacs\\emacs\\src\\bootstrap-emacs.pdmp")
    at w32.c:3369
#8  map_w32_filename (
    name=name@entry=0xbff890 "C:\\gitemacs\\emacs\\src\\bootstrap-emacs.pdmp", pPath=pPath@entry=0x0) at w32.c:3396
#9  0x00000004001ae5bc in sys_open (
    path=path@entry=0xbff890 "C:\\gitemacs\\emacs\\src\\bootstrap-emacs.pdmp", oflag=oflag@entry=32896, mode=mode@entry=0) at w32.c:4461
#10 0x00000004000c138a in emacs_open (
    file=file@entry=0xbff890 "C:\\gitemacs\\emacs\\src\\bootstrap-emacs.pdmp", oflags=32896, oflags@entry=0, mode=mode@entry=0) at sysdep.c:2472
#11 0x000000040010a2e6 in pdumper_load (
    dump_filename=0xbff890 "C:\\gitemacs\\emacs\\src\\bootstrap-emacs.pdmp")
    at pdumper.c:5410
#12 0x00000004000a3e7c in load_pdump (argc=argc@entry=9,
    argv=argv@entry=0x25510) at emacs.c:757
#13 0x00000004001ed88b in main (argc=9, argv=0x25510) at emacs.c:950
(gdb)

```