bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#27527: 25.2; start-process crash on Windows with 64bit .NET executab


From: Saulius Menkevičius
Subject: bug#27527: 25.2; start-process crash on Windows with 64bit .NET executable
Date: Thu, 29 Jun 2017 12:41:55 +0300

Hello,

The issue was encountered when debugging a problem with omnisharp-emacs
package where starting a server process (written for and running in a  .NET/CLR 
VM)
crashes emacs with a segfault.

Recompiling with -g -O0 has revealed a problem in implementation of
w32_executable_type in src/w32proc.c where the code is attempting to list
DLL imports in a binary but the import table points to NULL. This code works for
.NET binaries compiled for x86 so the problem is specific to 64 bit Windows / 
.NET DLLs.

The callstack of a crash is below and I have a patch attached that fixes the 
problem. 
The patch applies cleanly to both master and emacs-25 branches.

I am omitting any standard report-emacs-bug information from below as I
am submitting this report from a different machine than the one that experiences
the problem.

Hopefully that is not a big issue.

======= 8< ===========
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb) bt
#0  0x000007fefd9b31f3 in KERNELBASE!DebugBreak () from 
/c/Windows/system32/KERNELBASE.dll
#1  0x000000040023c953 in emacs_abort () at ../../emacs/src/w32fns.c:10923
#2  0x00000004000fe2ec in terminate_due_to_signal (sig=11, backtrace_limit=40) 
at ../../emacs/src/emacs.c:394
#3  0x0000000400123f15 in handle_fatal_signal (sig=11) at 
../../emacs/src/sysdep.c:1714
#4  0x0000000400123ee5 in deliver_thread_signal (sig=11, handler=0x400123efd 
<handle_fatal_signal>) at ../../emacs/src/sysdep.c:1688
#5  0x0000000400123f51 in deliver_fatal_thread_signal (sig=11) at 
../../emacs/src/sysdep.c:1726
#6  0x00000004002a5ea8 in _gnu_exception_handler (exception_data=0x82aff0) at 
C:/repo/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/crt_handler.c:223
#7  0x0000000077bf7958 in ntdll!__C_specific_handler () from 
/c/Windows/SYSTEM32/ntdll.dll
#8  0x0000000077c0812d in ntdll!RtlDecodePointer () from 
/c/Windows/SYSTEM32/ntdll.dll
#9  0x0000000077bf855f in ntdll!RtlUnwindEx () from 
/c/Windows/SYSTEM32/ntdll.dll
#10 0x0000000077c2bcb8 in ntdll!KiUserExceptionDispatcher () from 
/c/Windows/SYSTEM32/ntdll.dll
#11 0x0000000400275bc0 in w32_executable_type (filename=0x82bfc0 
"c:\\csharp\\omnisharp\\omnisharp.exe", is_dos_app=0x82c134, 
is_cygnus_app=0x82c130, is_msys_app=0x82c12c, is_gui_app=0x82c128) at 
../../emacs/src/w32proc.c:1626
#12 0x0000000400276148 in sys_spawnve (mode=1, cmdname=0x82bfc0 
"c:\\csharp\\omnisharp\\omnisharp.exe", argv=0x82c590, envp=0x82c250) at 
../../emacs/src/w32proc.c:1802
#13 0x000000040020bf9e in child_setup (in=3, out=6, err=6, new_argv=0x82c590, 
set_pgrp=true, current_dir=...) at ../../emacs/src/callproc.c:1329
#14 0x00000004001fea90 in create_process (process=..., new_argv=0x82c590, 
current_dir=...) at ../../emacs/src/process.c:2182
#15 0x00000004001fe685 in Fmake_process (nargs=6, args=0x82c958) at 
../../emacs/src/process.c:1904
#16 0x00000004001ac435 in funcall_subr (subr=0x4005df370 <Smake_process>, 
numargs=6, args=0x82c958) at ../../emacs/src/eval.c:2802
#17 0x00000004001ac156 in Ffuncall (nargs=7, args=0x82c950) at 
../../emacs/src/eval.c:2747
#18 0x00000004001ab60b in Fapply (nargs=2, args=0x82cbf0) at 
../../emacs/src/eval.c:2378
#19 0x00000004001ac435 in funcall_subr (subr=0x4005dc8d0 <Sapply>, numargs=2, 
args=0x82cbf0) at ../../emacs/src/eval.c:2802
#20 0x00000004001ac156 in Ffuncall (nargs=3, args=0x82cbe8) at 
../../emacs/src/eval.c:2747
#21 0x00000004001f7012 in exec_byte_code (bytestr=..., vector=..., 
maxdepth=..., args_template=..., nargs=3, args=0x82d2c8) at 
../../emacs/src/bytecode.c:641
#22 0x00000004001acb81 in funcall_lambda (fun=..., nargs=3, 
arg_vector=0x82d2b0) at ../../emacs/src/eval.c:2948
#23 0x00000004001ac8d0 in apply_lambda (fun=..., args=..., count=14) at 
../../emacs/src/eval.c:2884
#24 0x00000004001aaf60 in eval_sub (form=...) at ../../emacs/src/eval.c:2268
#25 0x00000004001aa3a5 in Feval (form=..., lexical=...) at 
../../emacs/src/eval.c:2045
#26 0x00000004001ac525 in funcall_subr (subr=0x4005dc8a0 <Seval>, numargs=2, 
args=0x82d710) at ../../emacs/src/eval.c:2824
#27 0x00000004001ac156 in Ffuncall (nargs=3, args=0x82d708) at 
../../emacs/src/eval.c:2747
#28 0x00000004001f7012 in exec_byte_code (bytestr=..., vector=..., 
maxdepth=..., args_template=..., nargs=1, args=0x82de70) at 
../../emacs/src/bytecode.c:641
#29 0x00000004001acb81 in funcall_lambda (fun=..., nargs=1, 
arg_vector=0x82de68) at ../../emacs/src/eval.c:2948
#30 0x00000004001ac19a in Ffuncall (nargs=2, args=0x82de60) at 
../../emacs/src/eval.c:2749
#31 0x00000004001f7012 in exec_byte_code (bytestr=..., vector=..., 
maxdepth=..., args_template=..., nargs=1, args=0x82e768) at 
../../emacs/src/bytecode.c:641
#32 0x00000004001acb81 in funcall_lambda (fun=..., nargs=1, 
arg_vector=0x82e760) at ../../emacs/src/eval.c:2948
#33 0x00000004001ac19a in Ffuncall (nargs=2, args=0x82e758) at 
../../emacs/src/eval.c:2749
#34 0x00000004001a3c25 in Ffuncall_interactively (nargs=2, args=0x82e758) at 
../../emacs/src/callint.c:252
#35 0x00000004001ac435 in funcall_subr (subr=0x4005dc2c8 
<Sfuncall_interactively>, numargs=2, args=0x82e758) at 
../../emacs/src/eval.c:2802
#36 0x00000004001ac156 in Ffuncall (nargs=3, args=0x82e750) at 
../../emacs/src/eval.c:2747
#37 0x00000004001a63fb in Fcall_interactively (function=..., record_flag=..., 
keys=...) at ../../emacs/src/callint.c:844
#38 0x00000004001ac551 in funcall_subr (subr=0x4005dc2f8 <Scall_interactively>, 
numargs=3, args=0x82ec70) at ../../emacs/src/eval.c:2827
#39 0x00000004001ac156 in Ffuncall (nargs=4, args=0x82ec68) at 
../../emacs/src/eval.c:2747
#40 0x00000004001f7012 in exec_byte_code (bytestr=..., vector=..., 
maxdepth=..., args_template=..., nargs=1, args=0x82f450) at 
../../emacs/src/bytecode.c:641
#41 0x00000004001acb81 in funcall_lambda (fun=..., nargs=1, 
arg_vector=0x82f448) at ../../emacs/src/eval.c:2948
#42 0x00000004001ac19a in Ffuncall (nargs=2, args=0x82f440) at 
../../emacs/src/eval.c:2749
#43 0x00000004001abbcd in call1 (fn=..., arg1=...) at 
../../emacs/src/eval.c:2609
#44 0x0000000400103dd5 in command_loop_1 () at ../../emacs/src/keyboard.c:1486
#45 0x00000004001a8c50 in internal_condition_case (bfun=0x4001034d3 
<command_loop_1>, handlers=..., hfun=0x400102ad0 <cmd_error>) at 
../../emacs/src/eval.c:1326
#46 0x000000040010314b in command_loop_2 (ignore=...) at 
../../emacs/src/keyboard.c:1114
#47 0x00000004001a850e in internal_catch (tag=..., func=0x400103119 
<command_loop_2>, arg=...) at ../../emacs/src/eval.c:1091
#48 0x000000040010309e in command_loop () at ../../emacs/src/keyboard.c:1093
#49 0x0000000000000000 in ?? ()
======= 8< =========

Attachment: windows-x64-dotnet-exe-crash-fix.patch
Description: Binary data


Thank you,

BR,
-Saulius Menkevicius

reply via email to

[Prev in Thread] Current Thread [Next in Thread]