all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Saulius Menkevičius" <saulius.menkevicius@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 27527@debbugs.gnu.org
Subject: bug#27527: 25.2; start-process crash on Windows with 64bit .NET executable
Date: Thu, 29 Jun 2017 19:10:00 +0300	[thread overview]
Message-ID: <07461974-D22F-411B-BC5D-E76602671255@gmail.com> (raw)
In-Reply-To: <83mv8qrhvu.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 19 bytes --]

Sure,

Here it is:

[-- Attachment #2: windows-x64-dotnet-exe-crash-fix-b.patch --]
[-- Type: application/octet-stream, Size: 818 bytes --]

diff --git a/src/w32proc.c b/src/w32proc.c
index 200c2b2ba4..2d303e9139 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -1618,6 +1618,10 @@ w32_executable_type (char * filename,
               /* Look for Cygwin DLL in the DLL import list. */
               IMAGE_DATA_DIRECTORY import_dir =
                 data_dir[IMAGE_DIRECTORY_ENTRY_IMPORT];
+
+	      /* Import directory can be missing on .NET dlls */
+	      if (import_dir.VirtualAddress != 0)
+                {
                   IMAGE_IMPORT_DESCRIPTOR * imports =
                     RVA_TO_PTR (import_dir.VirtualAddress,
                                 rva_to_section (import_dir.VirtualAddress,
@@ -1653,6 +1657,7 @@ w32_executable_type (char * filename,
                 }
             }
   	}
+    }
 
 unwind:
   close_file_data (&executable);

[-- Attachment #3: Type: text/plain, Size: 1114 bytes --]



> Am 29.06.2017 um 17:24 schrieb Eli Zaretskii <eliz@gnu.org>:
> 
>> From: Saulius Menkevičius <saulius.menkevicius@gmail.com>
>> Date: Thu, 29 Jun 2017 12:41:55 +0300
>> 
>> 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.
> 
> Thanks.
> 
> Can you send the diffs generated with the -b switch?  I think all you
> did was to condition the use of the import directory on its being
> non-NULL, but it's hard to tell judging just by the diffs you posted.


  reply	other threads:[~2017-06-29 16:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-29  9:41 bug#27527: 25.2; start-process crash on Windows with 64bit .NET executable Saulius Menkevičius
2017-06-29 14:24 ` Eli Zaretskii
2017-06-29 16:10   ` Saulius Menkevičius [this message]
2017-07-09 18:19     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=07461974-D22F-411B-BC5D-E76602671255@gmail.com \
    --to=saulius.menkevicius@gmail.com \
    --cc=27527@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.