From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.bugs Subject: bug#57880: 28.1; Emacs crashes with native compilation on when some antivirus program is running on MS-Windows Date: Wed, 21 Sep 2022 19:26:08 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13380"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 57880@debbugs.gnu.org To: Ioannis Kappas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 21 21:27:15 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ob5NL-0003HQ-Eo for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 21 Sep 2022 21:27:15 +0200 Original-Received: from localhost ([::1]:43074 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ob5NK-0000Cj-Ap for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 21 Sep 2022 15:27:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48902) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ob5N8-0000Ac-Oe for bug-gnu-emacs@gnu.org; Wed, 21 Sep 2022 15:27:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36188) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ob5N8-0006so-8m for bug-gnu-emacs@gnu.org; Wed, 21 Sep 2022 15:27:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ob5N7-0002he-Rl for bug-gnu-emacs@gnu.org; Wed, 21 Sep 2022 15:27:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 21 Sep 2022 19:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57880 X-GNU-PR-Package: emacs Original-Received: via spool by 57880-submit@debbugs.gnu.org id=B57880.166378837110331 (code B ref 57880); Wed, 21 Sep 2022 19:27:01 +0000 Original-Received: (at 57880) by debbugs.gnu.org; 21 Sep 2022 19:26:11 +0000 Original-Received: from localhost ([127.0.0.1]:35266 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ob5MI-0002gZ-OX for submit@debbugs.gnu.org; Wed, 21 Sep 2022 15:26:11 -0400 Original-Received: from mx.sdf.org ([205.166.94.24]:64684) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ob5MH-0002gR-9k for 57880@debbugs.gnu.org; Wed, 21 Sep 2022 15:26:10 -0400 Original-Received: from ma.sdf.org (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 28LJQ8Xc019133 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Wed, 21 Sep 2022 19:26:08 GMT In-Reply-To: (Ioannis Kappas's message of "Tue, 20 Sep 2022 17:43:10 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:243376 Archived-At: Ioannis Kappas writes: > Hi Andrea, > On Mon, Sep 19, 2022 at 9:14 AM Andrea Corallo wrote: > >> 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'). > > It is because `make_subr', or any of other relevant fns, is not given a > chance to execute. The eln file is loaded fine, but the search for the > COMP_UNIT_SYM'bol in the eln is unsuccessful (due to AV interference), > the file is considered invalid, and the only path left to take is to unload it. > > >> Also I've a question (no windows expert here), can GetProcAddress return >> NULL? > > Yes, as per https://learn.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-getprocaddress: > > Return value > > If the function succeeds, the return value is the address of the > exported function or variable. > > If the function fails, the return value is NULL. To get extended > error information, call GetLastError. Okay, I think then is a good idea to guard against the NULL pointer potentially returned, OTOH we do it already in the rest of the code. I'm only not sure if we should signal an error or not here. Andrea