Subject: bug#57880: 28.1; Emacs crashes with native compilation on when some antivirus program is running on MS-Windows

From: Andrea Corallo <[email-masked]>
Date: Mon, 19 Sep 2022 08:13:41 +0000

Ioannis Kappas <[email-masked]> writes:

> Hi,
>
> there appears to be an issue with native compilation and some
> antivirus programs on MS-Windows that could cause Emacs to crash.
>
> This can happen when the antivirus program rewires GetProcAddress
> system fn to return NULL on a call to get the address of an exported
> variable/function, of which native compilation makes use of to
> identify features of the compiled code.
>
> I can't think of any straightforward instructions to reproduce the
> issue without such antivirus programs running, but the crash happens
> when an .el file has been compiled and the native code is partially
> loaded and then there is an attempt to unload it with the
> unload_comp_unit fn below

Hi Ioannis,

I'm not sure I understand why the issue is only in 'unload_comp_unit'
and not in all the other places where we use and rely on 'dynlib_sym'
(ex in 'make_subr').

Also I've a question (no windows expert here), can GetProcAddress return
NULL?

Thanks

  Andrea