From unknown Thu Aug 14 18:39:42 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#57880 <57880@debbugs.gnu.org> To: bug#57880 <57880@debbugs.gnu.org> Subject: Status: 28.1; Emacs crashes with native compilation on when some antivirus program is running on MS-Windows Reply-To: bug#57880 <57880@debbugs.gnu.org> Date: Fri, 15 Aug 2025 01:39:42 +0000 retitle 57880 28.1; Emacs crashes with native compilation on when some anti= virus program is running on MS-Windows reassign 57880 emacs submitter 57880 Ioannis Kappas severity 57880 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 17 07:14:56 2022 Received: (at submit) by debbugs.gnu.org; 17 Sep 2022 11:14:56 +0000 Received: from localhost ([127.0.0.1]:45249 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZVmi-0005do-9d for submit@debbugs.gnu.org; Sat, 17 Sep 2022 07:14:56 -0400 Received: from lists.gnu.org ([209.51.188.17]:58250) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZVmg-0005dg-26 for submit@debbugs.gnu.org; Sat, 17 Sep 2022 07:14:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44050) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZVmf-0001ZC-S0 for bug-gnu-emacs@gnu.org; Sat, 17 Sep 2022 07:14:53 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:36719) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oZVmd-00057K-R1 for bug-gnu-emacs@gnu.org; Sat, 17 Sep 2022 07:14:53 -0400 Received: by mail-wr1-x435.google.com with SMTP id h8so32916621wrf.3 for ; Sat, 17 Sep 2022 04:14:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date; bh=+lD7gCODj6rQrMXTbb4jWn0bEQ0AL7K5L9/90ogW+nM=; b=ahjswAG07TGpUA2/YrktI7JM8/DrfnssM9JuwHTIciXwcOqGKZQVKEVLKh5A97zAzq Gg8h8UpyiSZsmggpvWXixzp/4sOp6Xu5Nuj96TM44u3ocFnhR+gGW8yXPDLyKkkdPmRz EbrmWotgvQ5cxVCFhwc8oecAk+jfmzaR0ktAd2ezhTiHWgpK+h2gKYbz7evcETnHS2GI 7pfJHoru7FmfZMZ9yid/3Yvc44ux0EbCTQSeWJt7f30RlRsbf1P0hqRziiT/B5LZhpzD V1r44qDZbZ5yHQkFpM7UspMvZiwN7c7AaiND4CoGNZLoMp+pSqFoRzxhtmDKGxo5jCtt 10YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date; bh=+lD7gCODj6rQrMXTbb4jWn0bEQ0AL7K5L9/90ogW+nM=; b=xZbAIC3pJ/p4XWyRrjlB8vf6+vddhNh4GB/UQ2Ypz2YeeFBIyy0YpEwBc59H6f0KC9 KxbJ23bQVhiwaYsXgXokQy285Yh8vlcXqJAaYoskbF3IRM/orgQ1Pg8V/UoK6w7QrAia /R1JiIPRD6Mi+rL5B5S2A3JcLCssQi+LkUs565airzM6hAI7hXviptWaCj5YLYPIpSrt /5HpE+G8dXbg+hHrOUZWFwfE0otlOx4PoeJDr2RFJoUD/rpet5MPUzFFRUi/lnoP+DJk lW4moi75kJgvwkSh4xgTh8mdyaDEPDiOgqZQuA5sC+rQO3UOtOnyUrChWPu5DIxulnJz J7fA== X-Gm-Message-State: ACrzQf23HDhxfwg6prlyPeHqK5gWJxsrHrByn/tWqEzVCLjkC2lpbuvU WIvslbvPnWJ2uddn5RJAwKp7eeJn28T7jxcqveqNJ1Hnwt8= X-Google-Smtp-Source: AMsMyM5eANrc7GfpjyegwTP5QRNg8BefJBOxZPSzk56sTibXmCuKXcqsE2NIejt/7WTdaHl0/cEPN32CMHTep8NRFkI= X-Received: by 2002:adf:d1c6:0:b0:228:dff6:77b8 with SMTP id b6-20020adfd1c6000000b00228dff677b8mr5582354wrd.115.1663413287723; Sat, 17 Sep 2022 04:14:47 -0700 (PDT) MIME-Version: 1.0 From: Ioannis Kappas Date: Sat, 17 Sep 2022 12:14:36 +0100 Message-ID: Subject: 28.1; Emacs crashes with native compilation on when some antivirus program is running on MS-Windows To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=ioannis.kappas@gmail.com; helo=mail-wr1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) 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 src/comp.c: void unload_comp_unit (struct Lisp_Native_Comp_Unit *cu) { if (cu->handle == NULL) return; Lisp_Object *saved_cu = dynlib_sym (cu->handle, COMP_UNIT_SYM); Lisp_Object this_cu; XSETNATIVE_COMP_UNIT (this_cu, cu); if (EQ (this_cu, *saved_cu)) *saved_cu = Qnil; dynlib_close (cu->handle); } saved_cu is returned as NULL and the program crashes without an indication what has might have gone wrong. I suppose a partial fix to avoid the crash (which seems good to have regardless of antivirus interference), would be to check for NULL pointer void unload_comp_unit (struct Lisp_Native_Comp_Unit *cu) { if (cu->handle == NULL) return; Lisp_Object *saved_cu = dynlib_sym (cu->handle, COMP_UNIT_SYM); if (saved_cu) { Lisp_Object this_cu; XSETNATIVE_COMP_UNIT (this_cu, cu); if (EQ (this_cu, *saved_cu)) *saved_cu = Qnil; } dynlib_close (cu->handle); } Not sure if there is much we can do to circumvent the antivirus restrictions? This at least also affects dynamically loaded modules from loading (but Emacs doesn't crash here, just displays the misleading "module is not GPL compatible" warning), since it employs the same technique to check if modules are GPL compatible DEFUN ("module-load", Fmodule_load, Smodule_load, 1, 1, 0, doc: /* Load module FILE. */) (Lisp_Object file) { dynlib_handle_ptr handle; emacs_init_function module_init; void *gpl_sym; CHECK_STRING (file); handle = dynlib_open (SSDATA (file)); if (!handle) xsignal2 (Qmodule_open_failed, file, build_string (dynlib_error ())); gpl_sym = dynlib_sym (handle, "plugin_is_GPL_compatible"); if (!gpl_sym) xsignal1 (Qmodule_not_gpl_compatible, file); // ... } In some situations (or perhaps in most?), the antivirus only applies these restrictions to dll/eln files loaded from certain directories, such as the user home directory starting at c:\Users. In that case, it is possible to use the XDG_CONFIG_HOME path to set the user directory (where the .eln files are generated at) to another, unrestricted, location: > mkdir c:\xdg-config\emacs > set XDG_CONFIG_HOME=c:\xdg-config > emacs and then check that the above has taken effect with C-h v user-emacs-directory. (For XDG_CONFIG_HOME to work properly, ~/.emacs.d should not exist, see https://www.gnu.org/software/emacs/manual/html_node/emacs/Find-Init.html ) Thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 19 04:14:29 2022 Received: (at 57880) by debbugs.gnu.org; 19 Sep 2022 08:14:29 +0000 Received: from localhost ([127.0.0.1]:52265 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oaBvB-00085f-5a for submit@debbugs.gnu.org; Mon, 19 Sep 2022 04:14:29 -0400 Received: from mx.sdf.org ([205.166.94.24]:58194) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oaBv5-00085R-QK for 57880@debbugs.gnu.org; Mon, 19 Sep 2022 04:14:27 -0400 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 28J8Df5d029443 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Mon, 19 Sep 2022 08:14:21 GMT From: Andrea Corallo To: Ioannis Kappas Subject: Re: bug#57880: 28.1; Emacs crashes with native compilation on when some antivirus program is running on MS-Windows In-Reply-To: (Ioannis Kappas's message of "Sat, 17 Sep 2022 12:14:36 +0100") References: Date: Mon, 19 Sep 2022 08:13:41 +0000 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 57880 Cc: 57880@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Ioannis Kappas 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 From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 20 12:43:25 2022 Received: (at 57880) by debbugs.gnu.org; 20 Sep 2022 16:43:25 +0000 Received: from localhost ([127.0.0.1]:59483 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oagLE-0001qf-Q3 for submit@debbugs.gnu.org; Tue, 20 Sep 2022 12:43:25 -0400 Received: from mail-wr1-f44.google.com ([209.85.221.44]:36823) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oagLD-0001qU-SL for 57880@debbugs.gnu.org; Tue, 20 Sep 2022 12:43:24 -0400 Received: by mail-wr1-f44.google.com with SMTP id y5so5296130wrh.3 for <57880@debbugs.gnu.org>; Tue, 20 Sep 2022 09:43:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=Mda3YpdCtz0y7vcUo2p+CJKWbg/DQ3inG3b/SFsnaKM=; b=ZyWVdm6YS9+NY9FX0pOwx09DrwFRf1n+Ub2/DSN+aTa78HS7LvIwM+GtzhBaZdr1/j 2jEedffX5yb+DfLMCb80RKeK53TIJDRExOGIa1mVgjKG7KFZLu5CFP4BPU7tmitGtQcb UUDJrAzECukBJ3rTp8ZIWeMON2WXFbELzrqgpjaK4vKuoZzF+ErmyuqccCRwoE2k3r2U WfM/Ub9+e8ruKgHzkwc5NA45MlA34ye2fTKRRDLvsIwsyB7LQK1IORIeh9r+X6hA0Ngj hb8O8rr4KsB85p9ylzxJXhrQE/gc9KP1YGWJ2muU5qrRTyFaO0sh8OrBG95GmACNyZxW TOYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=Mda3YpdCtz0y7vcUo2p+CJKWbg/DQ3inG3b/SFsnaKM=; b=r6192qc/mpLKkPCqSMq39Zwe9Qzd6GKdPqncQuccjkr3OXbOPz4mwsRI0ESa8U/J7S YaTu3Ykl/ZJmc5l9yVHKCNkUw/LYUadDi4yxf23JHjrF2GdlSjr/keqlW2HwoUK2k8FU HiJguVvrypqqLq41wY4LvBl4Q5EeKeTAo+N8UxD7uzI5wp0iFy75pw5pmQzJpDKIrkyt nnTZbhxf+P7HT11WGsnGPpolLmlHvSKPEEMsDZZnVQt4uEtH1hTTZjtwNHbdqaHsytRK pMVZ//doR2GDPKloHLNMIPBJStF8pK38aB2B7nJjibYhyBuUpOJW/OJGPKLkXNC+8ekH lrSA== X-Gm-Message-State: ACrzQf0mg/u3A+UInkpbD107AozCZ108rIDR5DJTt6on33dwiYcPccV0 1AzLH6P8NUB6eSoTFlVGrqGnpOlwMQZpA99w57Kz0CQ+nwnSzA== X-Google-Smtp-Source: AMsMyM42d76etKtUchYqDZsJ+4/acMTSBGnMYe0IqEGKB29z0xb8IDs2865QfhpeMw0ZyqfMDgucRwoszHyCMfsmMOw= X-Received: by 2002:adf:eb50:0:b0:21e:3d13:3a91 with SMTP id u16-20020adfeb50000000b0021e3d133a91mr14161227wrn.484.1663692198106; Tue, 20 Sep 2022 09:43:18 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Ioannis Kappas Date: Tue, 20 Sep 2022 17:43:10 +0100 Message-ID: Subject: Re: bug#57880: 28.1; Emacs crashes with native compilation on when some antivirus program is running on MS-Windows To: Andrea Corallo Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 57880 Cc: 57880@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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. I've also noticed another more surgical way to redirect the .eln cache elsewhere, though is only available on the 29 branch: ;; in early-init.el (when (> emacs-major-version 28) (startup-redirect-eln-cache "/to/a/safe/haven")) Thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 21 07:06:26 2022 Received: (at 57880) by debbugs.gnu.org; 21 Sep 2022 11:06:27 +0000 Received: from localhost ([127.0.0.1]:60845 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oaxYg-0005kQ-MJ for submit@debbugs.gnu.org; Wed, 21 Sep 2022 07:06:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48160) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oaxYc-0005kA-5D for 57880@debbugs.gnu.org; Wed, 21 Sep 2022 07:06:24 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48360) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaxYV-0000kP-CX; Wed, 21 Sep 2022 07:06:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=70wNezovzD7SWfZqIh7NY0PSSci+L0k2hkUF77r2/fY=; b=jdyKmdv+16aH ZG6Esv1Ed6KI00FLaojdOqK5fF+6UF1ChoM8y37EgP3EN2vQfUgHyT/54HjRPUa5bNcAviKmLKHDo w+ysPMeJCyea8oFI4QWAc2Q1EXabxTpF8tsveZWyo9IotbX/l5AyBL+lGK2WdtvYkIPm/zrKtlsA+ WwoYXmtV0BFJebtjcjUzO7jzOPgd3ReVDFLty96Hklb/DKCAwbYuB2NCazGBKY3TMZW+urB4hIvNN D8dURS15GWH3HfaWQAUYrsa9C3xIj4ZAzaKkGP1ZqX46RFWyObTMBZaV1KEOBFvjbu5xYdD4lU6ZO hzXGsbB4sW1/XSPcBYzv9A==; Received: from [87.69.77.57] (port=1635 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaxYH-0000zP-9q; Wed, 21 Sep 2022 07:06:13 -0400 Date: Wed, 21 Sep 2022 14:06:09 +0300 Message-Id: <83o7v9ugv2.fsf@gnu.org> From: Eli Zaretskii To: Ioannis Kappas In-Reply-To: (message from Ioannis Kappas on Tue, 20 Sep 2022 17:43:10 +0100) Subject: Re: bug#57880: 28.1; Emacs crashes with native compilation on when some antivirus program is running on MS-Windows References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57880 Cc: 57880@debbugs.gnu.org, akrl@sdf.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 57880@debbugs.gnu.org > From: Ioannis Kappas > Date: Tue, 20 Sep 2022 17:43:10 +0100 > > 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. What would be the purpose of using Emacs with native-compilation on such a system? Users who must cope with such antivirus programs will need to use Emacs without native-compilation. I see no good reason to prevent Emacs from crashing, since those *.eln files cannot be used anyway, and we will just have a slowed-down Emacs without native-compilation. Right? Or did I miss something? From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 21 13:19:30 2022 Received: (at 57880) by debbugs.gnu.org; 21 Sep 2022 17:19:30 +0000 Received: from localhost ([127.0.0.1]:35157 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ob3Ni-0007xs-II for submit@debbugs.gnu.org; Wed, 21 Sep 2022 13:19:30 -0400 Received: from mail-wm1-f46.google.com ([209.85.128.46]:54029) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ob3Ng-0007xe-Gf for 57880@debbugs.gnu.org; Wed, 21 Sep 2022 13:19:28 -0400 Received: by mail-wm1-f46.google.com with SMTP id e18so4958295wmq.3 for <57880@debbugs.gnu.org>; Wed, 21 Sep 2022 10:19:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=HCTV1KrPJkyd7eHs8Hg4ZFiSxv0Ycvor/pWWOeG0RoY=; b=RZv4eKxzfCaEvJ0/ak0gwRYOxSB73k7WnAsYQsO9/j+cBJ1AM5DLZJcMZ+TD8pm48J 5mP+j1IgJa2Mjv8TIc23vvmpA6f4J/PfR1L25FMW4RzU7+nVuaPUtt0NTf0zI/9SNMIq Xk0HGHLuls/rOk1yZ1ypFcWUvrwZYT4H1Li+clidNiAIlwY/RvGsngvthbmFvHAtzPMo j9uGCwt8v5TXTuQanFh+iSsKWMgJkdzruqHE6WSdHW4hqGeSpqY8WnYnP/VEm0QSwl/U ZCzKCwLlhYmVa/LJLS5/Tf1vVZD5JzL1aSNZGs04hsqtW7Mh52mA73cBqwEOtpS+Hnrw Wvsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=HCTV1KrPJkyd7eHs8Hg4ZFiSxv0Ycvor/pWWOeG0RoY=; b=2kIqOczPwgzZLfHKSdUBbXuArB/iOejQAV3CnW7oj+X7wta3wy4LZcyZfNXVOGYscZ HWp0POk+v+0Wl9PGECO8/5TxQmOVtPt4AfkiJX514AxpvoJjZrNrtXntsSRfampc6lcL 5AqKBDEPbSCIujTQASF2im7OZkgr6qajTgpEljrQQaWhK4o813b2ohKA50EeW1epJ9fW ykFP8alwoSYH9ns8PyObnv/ns/U2uWFoEIr8LD7n4Sw8rTaMuy9dJIIDj4ozhj9FqdPt JkaH7sCFXTgmdrPKMLuNfJgVSlPuKfBZ0eNy8/Q+ppRy0p7g9c8/8gEiZHgYesbdf0HX yQxQ== X-Gm-Message-State: ACrzQf0b/axPgX5o3t5JDVBPHJ68fTCesdDUt3iej294uQCATGKiYNaO EaKRddAfUizaT9wxefuPSZ3SGwa7tPKEC1ETdYc= X-Google-Smtp-Source: AMsMyM7kTq83RfRPJivDXQqF2kgVhw6fxKz/k0ufJVrfTt3A+UGMJdKZ7XjTRadUGuCfzLoDf8DG5LGrQTnbxwOBXGg= X-Received: by 2002:a05:600c:b42:b0:3b4:7580:a995 with SMTP id k2-20020a05600c0b4200b003b47580a995mr6824642wmr.30.1663780762418; Wed, 21 Sep 2022 10:19:22 -0700 (PDT) MIME-Version: 1.0 References: <83o7v9ugv2.fsf@gnu.org> In-Reply-To: <83o7v9ugv2.fsf@gnu.org> From: Ioannis Kappas Date: Wed, 21 Sep 2022 18:19:11 +0100 Message-ID: Subject: Re: bug#57880: 28.1; Emacs crashes with native compilation on when some antivirus program is running on MS-Windows To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 57880 Cc: 57880@debbugs.gnu.org, akrl@sdf.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Eli, On Wed, Sep 21, 2022 at 12:06 PM Eli Zaretskii wrote: > What would be the purpose of using Emacs with native-compilation on > such a system? Users who must cope with such antivirus programs will > need to use Emacs without native-compilation. I see no good reason to > prevent Emacs from crashing, since those *.eln files cannot be used > anyway, and we will just have a slowed-down Emacs without > native-compilation. Right? Or did I miss something? A user who experience this issue for the first time and had Emacs crash, would have no indication whatsoever what hit them, i.e. they wouldn't know how to react. Thus my suggestion for checking for the NULL pointer in unload comp, so that they at least see the error message about the .eln files being inconsistent and research ways to go around it. And I can see two ways going forward: 1. Take a step back and switch off native compilation (but how to do this other than recompiling Emacs?) 2. Stil use native compilation but change the destination .eln directory to a safer path, so that they can still rip the benefit. I'd expect the AV only have a limited set of dirs preventing GetProcAddress of operating, otherwise nothing would work. Thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 21 15:26:11 2022 Received: (at 57880) by debbugs.gnu.org; 21 Sep 2022 19:26:11 +0000 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 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 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 From: Andrea Corallo To: Ioannis Kappas Subject: Re: bug#57880: 28.1; Emacs crashes with native compilation on when some antivirus program is running on MS-Windows In-Reply-To: (Ioannis Kappas's message of "Tue, 20 Sep 2022 17:43:10 +0100") References: Date: Wed, 21 Sep 2022 19:26:08 +0000 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 57880 Cc: 57880@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 22 02:36:13 2022 Received: (at 57880) by debbugs.gnu.org; 22 Sep 2022 06:36:13 +0000 Received: from localhost ([127.0.0.1]:35967 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obFoj-0007g2-9f for submit@debbugs.gnu.org; Thu, 22 Sep 2022 02:36:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37444) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obFog-0007fo-QX for 57880@debbugs.gnu.org; Thu, 22 Sep 2022 02:36:11 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:52904) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obFoa-0001sa-Uw; Thu, 22 Sep 2022 02:36:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=fgiqPPaGUBp5QiCAY1K2x8V13HKC3E9kig8nO7s4qf8=; b=eUiu90J7hlyC Q+2ovrCpGh1UOP9proG4t9z0UfD1nvkueETsGEQRDLEDCebTkepie+n0e+rALnPWJZsZlK5EpHoja 3bZnH+yTEqIPTD4c1pHYGD4OPAIXQC5Vra4o0As1sJoLoQOs9+KQVnldfw1Xb3CjXe5z1/sVtiFHe l8wq24l7pZiuu3NEQSaZAC5glcHgbyHTgFf6d0HCBzHQFet9LJPiJElMVzr9QRSyJj+IaXGSZvVT2 ptlqW2zECTMA+xfZQKpxGe1h91Lf/Bc6EHShcnVOW87v4ar0wb9lB2rx2+uYzUHtYoWOfDlbx37kA 1FnCW6hH838G1Mf4ySPpGQ==; Received: from [87.69.77.57] (port=1968 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obFoZ-00028e-81; Thu, 22 Sep 2022 02:36:04 -0400 Date: Thu, 22 Sep 2022 09:36:14 +0300 Message-Id: <83czbnud9d.fsf@gnu.org> From: Eli Zaretskii To: Ioannis Kappas In-Reply-To: (message from Ioannis Kappas on Wed, 21 Sep 2022 18:19:11 +0100) Subject: Re: bug#57880: 28.1; Emacs crashes with native compilation on when some antivirus program is running on MS-Windows References: <83o7v9ugv2.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57880 Cc: 57880@debbugs.gnu.org, akrl@sdf.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Ioannis Kappas > Date: Wed, 21 Sep 2022 18:19:11 +0100 > Cc: akrl@sdf.org, 57880@debbugs.gnu.org > > On Wed, Sep 21, 2022 at 12:06 PM Eli Zaretskii wrote: > > > What would be the purpose of using Emacs with native-compilation on > > such a system? Users who must cope with such antivirus programs will > > need to use Emacs without native-compilation. I see no good reason to > > prevent Emacs from crashing, since those *.eln files cannot be used > > anyway, and we will just have a slowed-down Emacs without > > native-compilation. Right? Or did I miss something? > > A user who experience this issue for the first time and had Emacs crash, > would have no indication whatsoever what hit them, i.e. they wouldn't > know how to > react. Thus my suggestion for checking for the NULL pointer in > unload comp, so that they at least see the error message about > the .eln files being inconsistent and research ways to go around it. How can an average user go about researching this? They'd need a debugger, a binary with debug info, and probably also a way of compiling Emacs. That doesn't sound like a typical Windows user to me. When Emacs crashes, they will report a bug, or ask on some forum. We can have this issue and its solutions described in PROBLEMS, so we could point them to that place. We could even mention this in the README that accompanies the Windows binaries (if we believe users actually read that). One way or another, if this issue happens frequently, the information will spread widely enough for people to be able to find it by a simple Internet search. Btw, which antivirus software have this "feature"? If it's widely used, perhaps the "official" Emacs binaries should not be distributed with native-compilation enabled at all? > And I can see two ways going forward: > 1. Take a step back and switch off native compilation (but how to do this > other than recompiling Emacs?) > 2. Stil use native compilation but change the destination .eln directory > to a safer path, so that they can still rip the benefit. I'd expect the AV > only have a limited set of dirs preventing GetProcAddress of > operating, otherwise nothing would work. Why does the directory where the *.eln files live matter? Doesn't the antivirus software check any loading of any DLL from anywhere on the system? In any case, the *.eln files have at least two places on any system, and only one of them can be changed, the other one is fixed by the build. From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 22 02:38:29 2022 Received: (at 57880) by debbugs.gnu.org; 22 Sep 2022 06:38:29 +0000 Received: from localhost ([127.0.0.1]:35977 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obFqv-0007jq-7p for submit@debbugs.gnu.org; Thu, 22 Sep 2022 02:38:29 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44722) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obFqt-0007jY-Mt for 57880@debbugs.gnu.org; Thu, 22 Sep 2022 02:38:28 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:54014) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obFqo-0002DW-1D; Thu, 22 Sep 2022 02:38:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=7lJu5WzFj74VfRnkdzSXRHYwN29EV7W0bTZgZyd7tqk=; b=Vy3WiumtzTpR W0aQY/FZObXnAnoBWILzqrOVhj8LNWGe5QehtC7eUQdCwGb8d7Owmg+IlRL3scH9iJyViiRU89H+1 xBjRtlr2eRiIRqpOFTcfSg9p7ZxRA2c+D7PLUqiUEw69S99raIv9nx/3Xztz7hJkaUDGXFAD44hSG zo/kjHL/cPmmHWwKnMnxDVNu2Zc0BdznExZl64VNS6ENO+k7jrqTMc5glnpfiMzeI2/ES2fvYa9LI HLeHkLE2/K4HGeFS4AH+8sAaCE/LJavJN2tcrRRpsMIqqKljZqCwyFjPw/Uc5DBuQ6YQDJGbGHqy7 mM8huqI6yKsahrs+662vLw==; Received: from [87.69.77.57] (port=2109 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obFqn-0002R1-AX; Thu, 22 Sep 2022 02:38:21 -0400 Date: Thu, 22 Sep 2022 09:38:31 +0300 Message-Id: <83bkr7ud5k.fsf@gnu.org> From: Eli Zaretskii To: Andrea Corallo In-Reply-To: (message from Andrea Corallo on Wed, 21 Sep 2022 19:26:08 +0000) Subject: Re: bug#57880: 28.1; Emacs crashes with native compilation on when some antivirus program is running on MS-Windows References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57880 Cc: ioannis.kappas@gmail.com, 57880@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 57880@debbugs.gnu.org > From: Andrea Corallo > Date: Wed, 21 Sep 2022 19:26:08 +0000 > > 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. No, we shouldn't, IMO. We should just behave as if the *.eln files were unavailable, perhaps with some message logged in *Messages*. Signaling an error would be shooting the user in his/her foot, because loading of *.eln files is attempted as part of routine operation, so signaling an error will prevent the user from being able to invoke many commands. From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 22 02:55:21 2022 Received: (at 57880) by debbugs.gnu.org; 22 Sep 2022 06:55:22 +0000 Received: from localhost ([127.0.0.1]:36024 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obG7F-0008Cg-Il for submit@debbugs.gnu.org; Thu, 22 Sep 2022 02:55:21 -0400 Received: from mail-wm1-f50.google.com ([209.85.128.50]:37405) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obG7E-0008CR-9r for 57880@debbugs.gnu.org; Thu, 22 Sep 2022 02:55:20 -0400 Received: by mail-wm1-f50.google.com with SMTP id z13-20020a7bc7cd000000b003b5054c6f9bso165712wmk.2 for <57880@debbugs.gnu.org>; Wed, 21 Sep 2022 23:55:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=C3SZrahwpK+9XyveDULwpIbfgwhJbNj8PG6fgMkLKSs=; b=XxIDEi5di2q2SaHi6JhVq7UkLEgCA9honHc1xkMkDtsrF5HB68uDvhAUqETuyBEPLC bS1QJLxNmSF7kExH5SOgUy8XxiF0aQ+PHPbJfpj9CS0TUZc7438FRaahmVz6l1tbVBFA X8XE4206Hzv6msrpqsI3dudyVbWTJdIJDaxlZQW2pivOUrMdOH+ffP4rsW+U1VDmwmT+ Ab8sLQ/ssLtWMCrZH3x1+0/sqiAXb18uIUGwDt1mql+kabR4qcRJTJWES6WIAvepcE8m bpcFtTSg3qRUJKPFA8eMs0HeeRHbPLUojFuChLldDFleDc+nXCyvjJtqV5C6Pli2ogxi KkLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=C3SZrahwpK+9XyveDULwpIbfgwhJbNj8PG6fgMkLKSs=; b=CW7Ju4JBOGqWOyvbXFIpX5zSkrUxQtuX3OWUq/XQ0Qw+6UHTaaV3HhySsIjE0wi8eo x5ouEzWG2tuoq/jQoFc/Y/OVPJEmorlvjcjgr7Ilj9rNTGrNeuFcnDimY4VWH5VPSpKr f9gBgJIvrgsCsN4Rqrs/OOYXePnEBstoGyRoAtYSqrDzW362oV1mnpoziZO8BOUdC/H6 i6bwzGHIZvi4iCDooK2JPIoqRuan1RYjof8/1XXh+bt4gNpVZvuoSFXwK2gK/AWdf/BW W+DKXAyvTbaci09RU3qMJMg6GOvMg2+hdd3FXDiDEhZYJM6/0PeLjw9rnKwqxnnobEsS OXUA== X-Gm-Message-State: ACrzQf247WOVMI/lYqymWIA9E70cKXqXiWBC5a0gkmdkpY7NpI84hv4H xS0Udwfjqhl4oL/Ef8vz8JVismiD6BVOT5B1eg8= X-Google-Smtp-Source: AMsMyM7RwJ693YlMl9UPI8OfMDLk5QLLtqXAlVx7kO2ta4Gs2rF/MUKMtp2RVSIE7aNmNtfpkDR9NKoY1THh9XPnMBk= X-Received: by 2002:a05:600c:3c8e:b0:3b4:d224:addf with SMTP id bg14-20020a05600c3c8e00b003b4d224addfmr8279559wmb.132.1663829714040; Wed, 21 Sep 2022 23:55:14 -0700 (PDT) MIME-Version: 1.0 References: <83o7v9ugv2.fsf@gnu.org> <83czbnud9d.fsf@gnu.org> In-Reply-To: <83czbnud9d.fsf@gnu.org> From: Ioannis Kappas Date: Thu, 22 Sep 2022 07:55:03 +0100 Message-ID: Subject: Re: bug#57880: 28.1; Emacs crashes with native compilation on when some antivirus program is running on MS-Windows To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 57880 Cc: 57880@debbugs.gnu.org, akrl@sdf.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Eli On Thu, Sep 22, 2022 at 7:36 AM Eli Zaretskii wrote: > How can an average user go about researching this? They'd need a > debugger, a binary with debug info, and probably also a way of > compiling Emacs. That doesn't sound like a typical Windows user to > me. There will get a lot of "eln file inconsistent with current runtime" messages in Emacs warnings buffer, the users will search on the Internet, and they eventually notice this discussion, mentioning the possible workarounds. > When Emacs crashes, they will report a bug, or ask on some forum. We > can have this issue and its solutions described in PROBLEMS, so we > could point them to that place. If Emacs just crashes with not the slightest indication what has gone wrong, they have to go through a bug report, of which the average user won't do. > We could even mention this in the > README that accompanies the Windows binaries (if we believe users > actually read that). One way or another, if this issue happens > frequently, the information will spread widely enough for people to be > able to find it by a simple Internet search. There is always the possibility this issue happens frequently but there are no reports, users then just move one with other tooling, which means the user base is reduced. > Btw, which antivirus software have this "feature"? If it's widely > used, perhaps the "official" Emacs binaries should not be distributed > with native-compilation enabled at all? Or could there be an early init option to bypass the native compilation. This way the users can test the issue with is native comp. > > And I can see two ways going forward: > > 1. Take a step back and switch off native compilation (but how to do this > > other than recompiling Emacs?) > > 2. Stil use native compilation but change the destination .eln directory > > to a safer path, so that they can still rip the benefit. I'd expect the AV > > only have a limited set of dirs preventing GetProcAddress of > > operating, otherwise nothing would work. > > Why does the directory where the *.eln files live matter? Doesn't the > antivirus software check any loading of any DLL from anywhere on the > system? Perhaps it only matters for the User directory. AVs want to put more stricter control on the binaries the user downloads and installs themselves. > In any case, the *.eln files have at least two places on any system, > and only one of them can be changed, the other one is fixed by the > build. Those precompiled with Emacs are fine in this use case since they are not stored in the Users directory, it's only newly compiled files that exhibit this issue because they store the .eln files in the user dir by default. Thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 22 04:09:23 2022 Received: (at 57880) by debbugs.gnu.org; 22 Sep 2022 08:09:24 +0000 Received: from localhost ([127.0.0.1]:36161 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obHGt-0003sg-Mw for submit@debbugs.gnu.org; Thu, 22 Sep 2022 04:09:23 -0400 Received: from mx.sdf.org ([205.166.94.24]:65163) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obHGr-0003sV-4g for 57880@debbugs.gnu.org; Thu, 22 Sep 2022 04:09:22 -0400 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 28M89JTJ017812 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Thu, 22 Sep 2022 08:09:19 GMT From: Andrea Corallo To: Eli Zaretskii Subject: Re: bug#57880: 28.1; Emacs crashes with native compilation on when some antivirus program is running on MS-Windows In-Reply-To: <83bkr7ud5k.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 22 Sep 2022 09:38:31 +0300") References: <83bkr7ud5k.fsf@gnu.org> Date: Thu, 22 Sep 2022 08:09:19 +0000 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 57880 Cc: ioannis.kappas@gmail.com, 57880@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> Cc: 57880@debbugs.gnu.org >> From: Andrea Corallo >> Date: Wed, 21 Sep 2022 19:26:08 +0000 >> >> 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. > > No, we shouldn't, IMO. We should just behave as if the *.eln files > were unavailable, perhaps with some message logged in *Messages*. > Signaling an error would be shooting the user in his/her foot, because > loading of *.eln files is attempted as part of routine operation, so > signaling an error will prevent the user from being able to invoke > many commands. Agree. Andrea From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 22 04:26:17 2022 Received: (at 57880) by debbugs.gnu.org; 22 Sep 2022 08:26:17 +0000 Received: from localhost ([127.0.0.1]:36228 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obHXF-0006XM-HJ for submit@debbugs.gnu.org; Thu, 22 Sep 2022 04:26:17 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43530) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obHXD-0006X1-VG for 57880@debbugs.gnu.org; Thu, 22 Sep 2022 04:26:16 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:33554) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHX7-0000UR-Oi; Thu, 22 Sep 2022 04:26:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=yr5LJomSGBQL1SAiSzcE4KpFuOuzHqD8kDgeai9FSW8=; b=S/ns0uyMnFv/ fVKacqB0BkQkh8zacBQM8n/01R267Lv7GJyAp6FWDBGOgdIssblZmZJDXcU5Xz8RswigEnl7QtG4D 5yKD3lx8eWIp7lnqlcu907aHGV6ZHOLMJz/O6/29CqCoiIJSFz0KHnJxnia2ac2ydye5z0r7/qEYs 5rOhdru346WlBBvX7p6GAtY+BbgJOC2lI3b8m4UydPxhDO8D2jVFs1y3cEeyf/GgAseFU3IVlX6en SKCnQ6D1dNNrM6EVixd4PrWFLPZWaRIYvn92JIwcF6BRYZ28YbFfuDyI/Q9IN1OX21ZmC+j9ItsbI 4hYvFjMGJSntwWzCiVtBdw==; Received: from [87.69.77.57] (port=4811 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obHX6-0008Jr-G1; Thu, 22 Sep 2022 04:26:09 -0400 Date: Thu, 22 Sep 2022 11:26:19 +0300 Message-Id: <83tu4zstlg.fsf@gnu.org> From: Eli Zaretskii To: Ioannis Kappas In-Reply-To: (message from Ioannis Kappas on Thu, 22 Sep 2022 07:55:03 +0100) Subject: Re: bug#57880: 28.1; Emacs crashes with native compilation on when some antivirus program is running on MS-Windows References: <83o7v9ugv2.fsf@gnu.org> <83czbnud9d.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57880 Cc: 57880@debbugs.gnu.org, akrl@sdf.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Ioannis Kappas > Date: Thu, 22 Sep 2022 07:55:03 +0100 > Cc: akrl@sdf.org, 57880@debbugs.gnu.org > > Or could there be an early init option to bypass the native compilation. This > way the users can test the issue with is native comp. There is one already. > > Why does the directory where the *.eln files live matter? Doesn't the > > antivirus software check any loading of any DLL from anywhere on the > > system? > > Perhaps it only matters for the User directory. AVs want to put more > stricter control > on the binaries the user downloads and installs themselves. Is that known, or is this just a guess? Also, I asked which AV software has this problem. Do you happen to know? Anyway, programs are not normally installed under C:\Users, they are installed under C:\Program Files. > > In any case, the *.eln files have at least two places on any system, > > and only one of them can be changed, the other one is fixed by the > > build. > > Those precompiled with Emacs are fine in this use case since they are > not stored in the Users directory, it's only newly compiled files that > exhibit this issue because they store the .eln files in the user dir by > default. This means that the problem will only affect people who have libgccjit and GCC/Binutils installed, because otherwise Emacs will be unable to compile new *.eln files. Right? From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 22 16:46:35 2022 Received: (at 57880) by debbugs.gnu.org; 22 Sep 2022 20:46:35 +0000 Received: from localhost ([127.0.0.1]:38681 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obT5e-000144-Uy for submit@debbugs.gnu.org; Thu, 22 Sep 2022 16:46:35 -0400 Received: from mail-wr1-f53.google.com ([209.85.221.53]:44656) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obT5a-00013m-PP for 57880@debbugs.gnu.org; Thu, 22 Sep 2022 16:46:34 -0400 Received: by mail-wr1-f53.google.com with SMTP id c11so17340524wrp.11 for <57880@debbugs.gnu.org>; Thu, 22 Sep 2022 13:46:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=MOqKcMpi2atTjBsID2VunjonDfZutTGZLTIs7dQsO3Y=; b=bZP68bm59LJar2zBWzZiN482J0F8COSOH6vRyuJKrU5EL/+QdYlZtdW817RockQHN+ c9l/EueFrqEYiNi5YpDGqcdNZTJsqof7sZwYcrQ00AsECsRdDB/ZePFHDlGCFw7ojOfD PF8UaXzSD/i2vxJ9O254fBO51WpjpWj5txL7VKwLmUa84MCqK5ml69ACplzt5voKFlIf kw6PgEgPnmFiTRo46uHT57p4z06+IbOfLBWYEmc30yAWFTMc3oeyDjXp+ulunN36tVLq WJ+k064rP3zyKO00wuFmYkgCSUUiBrgn0rF5inON686nWebr7heRwQOZWNjU/mUqMBR4 R70w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=MOqKcMpi2atTjBsID2VunjonDfZutTGZLTIs7dQsO3Y=; b=nvEywz7EAMGE9/aVNqWcZ/iIs2LDNvqGPG+RCri2Rtfr4FW+Mbvp+eGMyCFNKe64dy mojPnOZ/DutA6zgTHbeJ5UDgp3RuANLoMpfI7sro/IUjAuHD+V0rZ+k85GzSKkoYHaEi tE1/7WvOP7GwEihxTceG+Y0RIn+BbQqHDlZlpHJbZcKDprG76jtSI+7pHmlVcPoAIOa+ qakNE9Vg1bE6NmzmxRXhTUQsHSQ77FbA3ryz7odwdkoRutFbFQCOPFVqPmm+0CZHKJPF ICcYavJud88dc8MqwtpQXGGKEZ8G7VAnf51ODoGIRZ3MuXZTnPaDDU307JeOPLwo+jPn kS7w== X-Gm-Message-State: ACrzQf31VCskLxWG+nRCvnoCikR6CpbnOJHjBNgLPqlmlsY47KYt1K1W GE+lC2qDZ5XxaCB5DsDB9SQr75ZSQUXc6gsvQBQ= X-Google-Smtp-Source: AMsMyM7nFxdYZim/NnLs8e/o+6Utm1Xjh7g6xFFdsMmY18hCNjC1cuXcmF/yTEUpgBkXp+SGvdfvz6qO805foLX14oU= X-Received: by 2002:a5d:6301:0:b0:226:d87b:b55c with SMTP id i1-20020a5d6301000000b00226d87bb55cmr2993484wru.560.1663879584622; Thu, 22 Sep 2022 13:46:24 -0700 (PDT) MIME-Version: 1.0 References: <83o7v9ugv2.fsf@gnu.org> <83czbnud9d.fsf@gnu.org> <83tu4zstlg.fsf@gnu.org> In-Reply-To: <83tu4zstlg.fsf@gnu.org> From: Ioannis Kappas Date: Thu, 22 Sep 2022 21:46:14 +0100 Message-ID: Subject: Re: bug#57880: 28.1; Emacs crashes with native compilation on when some antivirus program is running on MS-Windows To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 57880 Cc: 57880@debbugs.gnu.org, akrl@sdf.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Eli, On Thu, Sep 22, 2022 at 9:26 AM Eli Zaretskii wrote: > > Or could there be an early init option to bypass the native compilation. This > > way the users can test the issue with is native comp. > > There is one already. Are you referring to an option for building form source? I couldn't find an option to turn off native compile for the precompiled windows binaries (such as those retrieved from the official ftp site or from msys2 pacman) that can configured to disable native comp. > > > Why does the directory where the *.eln files live matter? Doesn't the > > > antivirus software check any loading of any DLL from anywhere on the > > > system? > > > > Perhaps it only matters for the User directory. AVs want to put more > > stricter control > > on the binaries the user downloads and installs themselves. > > Is that known, or is this just a guess? This is an educated guess. The only facts are that (1) Emacs crashes the moment it tries to read .eln files from the c:/Users/* directory, (2) throws an "emacs module is not GPL compatible" error when loading native modules from the same dir. (3) and these are all side effect of trying to use GetProcAddress on a dll/eln file residing in the C:/Users/* dir. Both (1) and (2) work otherwise. > Also, I asked which AV software has this problem. Do you happen to > know? Here is an old article that I found published by the AV maker in question, referring to how most of windows viruses use GetProcAddress https://community.broadcom.com/symantecenterprise/viewdocument/fighting-epo-viruses """... . Most Windows viruses use the GetProcAddress API to obtain needed API addresses for their future execution ... """ and I believe this the reasons why they try to restrict its use in the User's directory, where it is unusual for mainstream programs to be installed, as per your comment below. > > Anyway, programs are not normally installed under C:\Users, they are > installed under C:\Program Files. Correct, and I believe the AV exploits this, so that it puts stricter controls on the Users dir. > > Those precompiled with Emacs are fine in this use case since they are > > not stored in the Users directory, it's only newly compiled files that > > exhibit this issue because they store the .eln files in the user dir by > > default. > > This means that the problem will only affect people who have libgccjit > and GCC/Binutils installed, because otherwise Emacs will be unable to > compile new *.eln files. Right? Yes, since I understand Emacs won't be able to generate any new .eln files without access to libgccjit. Thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 23 01:53:11 2022 Received: (at 57880) by debbugs.gnu.org; 23 Sep 2022 05:53:12 +0000 Received: from localhost ([127.0.0.1]:39111 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obbcd-0006aJ-Cj for submit@debbugs.gnu.org; Fri, 23 Sep 2022 01:53:11 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48154) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obbca-0006a5-Du for 57880@debbugs.gnu.org; Fri, 23 Sep 2022 01:53:10 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48042) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obbcU-00057H-Ja; Fri, 23 Sep 2022 01:53:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=j2pVEAXbEj2XlgYLavSuUN8sO52CY+gYxxupMABmwZY=; b=iK404NUMS8Qu u6h7gjwAs3yM4xaSr4/Th0JNfTMad4zMm6mqgvR4c/yFQbxVH5BwoPVocNWFVrLcco/XXCyBOIH15 TVh8Y/FIj+HnuKRKadkGh+iVmv6Dpo8nFO09l3ppPBHQl2BHnPmPsKR+FqYgR0652ScEXxnZxWJ2V am/xmUn/AuDbDyyaxxUu3EUH7VG6rjCLy8cTHsr6U65GDGKlM5MYe4LB4LzfmVCF0VT9xbPzj+akS 7wQA7KHrKdFgBEUwGGANYeNrTIGjQLQO46OFIQkBMw9AivZBruTyhMQUejHdeD9yQycM1MepfrSP1 AVj9baJH0UcZn2rOmcMOQA==; Received: from [87.69.77.57] (port=4123 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obbcT-0002lO-0c; Fri, 23 Sep 2022 01:53:02 -0400 Date: Fri, 23 Sep 2022 08:53:12 +0300 Message-Id: <83k05ur60n.fsf@gnu.org> From: Eli Zaretskii To: Ioannis Kappas In-Reply-To: (message from Ioannis Kappas on Thu, 22 Sep 2022 21:46:14 +0100) Subject: Re: bug#57880: 28.1; Emacs crashes with native compilation on when some antivirus program is running on MS-Windows References: <83o7v9ugv2.fsf@gnu.org> <83czbnud9d.fsf@gnu.org> <83tu4zstlg.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57880 Cc: 57880@debbugs.gnu.org, akrl@sdf.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Ioannis Kappas > Date: Thu, 22 Sep 2022 21:46:14 +0100 > Cc: akrl@sdf.org, 57880@debbugs.gnu.org > > > > Or could there be an early init option to bypass the native compilation. This > > > way the users can test the issue with is native comp. > > > > There is one already. > > Are you referring to an option for building form source? I couldn't > find an option > to turn off native compile for the precompiled windows binaries (such as those > retrieved from the official ftp site or from msys2 pacman) that can configured > to disable native comp. It's native-comp-deferred-compilation: set it to nil. For a good measure, also set comp-enable-subr-trampolines to nil. Emacs does this automatically at startup if libgccjit cannot be loaded. > > > Perhaps it only matters for the User directory. AVs want to put more > > > stricter control > > > on the binaries the user downloads and installs themselves. > > > > Is that known, or is this just a guess? > > This is an educated guess. The only facts are that > (1) Emacs crashes the moment it tries to read .eln files from the > c:/Users/* directory, > (2) throws an "emacs module is not GPL compatible" error when > loading native modules from the same dir. > (3) and these are all side effect of trying to use GetProcAddress on a > dll/eln file residing in the C:/Users/* dir. Both (1) and (2) work otherwise. So you are saying that if someone installs Emacs under C:/Users, that Emacs will not work, regardless of the native-compilation, because it will be unable to load the DLLs which come in the Emacs binary distribution, for example the image libraries? Then it is strange that we haven't heard about such a major issue with Emacs on Windows until now. > > Also, I asked which AV software has this problem. Do you happen to > > know? > > Here is an old article that I found published by the AV maker in question, > referring to how most of windows viruses use GetProcAddress > > https://community.broadcom.com/symantecenterprise/viewdocument/fighting-epo-viruses > > """... . Most Windows viruses use the GetProcAddress API to obtain > needed API addresses for their future execution ... """ > > and I believe this the reasons why they try to restrict its use in the User's > directory, where it is unusual for mainstream programs to be installed, > as per your comment below. Thanks, but that doesn't really answer my question, which was about the specific brands of AV software _known_ to do this. You seem to saying that the answer is 'all of them", but I'm asking what are the brands with which this was actually seen. > > > Those precompiled with Emacs are fine in this use case since they are > > > not stored in the Users directory, it's only newly compiled files that > > > exhibit this issue because they store the .eln files in the user dir by > > > default. > > > > This means that the problem will only affect people who have libgccjit > > and GCC/Binutils installed, because otherwise Emacs will be unable to > > compile new *.eln files. Right? > > Yes, since I understand Emacs won't be able to generate any new .eln files > without access to libgccjit. So then we can tell such people (which are relatively rare) to have their home directory outside of the C:/Users tree. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 23 12:43:21 2022 Received: (at 57880) by debbugs.gnu.org; 23 Sep 2022 16:43:21 +0000 Received: from localhost ([127.0.0.1]:41631 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obllo-0003H0-Or for submit@debbugs.gnu.org; Fri, 23 Sep 2022 12:43:21 -0400 Received: from mail-wm1-f46.google.com ([209.85.128.46]:35418) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1obllm-0003Gm-JZ for 57880@debbugs.gnu.org; Fri, 23 Sep 2022 12:43:19 -0400 Received: by mail-wm1-f46.google.com with SMTP id r133-20020a1c448b000000b003b494ffc00bso3690884wma.0 for <57880@debbugs.gnu.org>; Fri, 23 Sep 2022 09:43:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=hZMaD8I9aDk0zLz0IWIqoklQvpbrP+A74pixqWGJGI0=; b=X4vZZwUS0aPEQZhDrX1sM8f1dHqtQVcm1om2zetbBXnEXceUAebMJfWkfdjpxPD06D csfjfK9SIsHYRg+yTlZbOTNNIEYYsZluKl3fbaTbwZJzGj+XZX8siTVteg0QwuBzEimW ma8o9/vCc8OSiztVQj2jvmP2zOCy48BF24CzQU3f2TPiLqo7QjhOQyTNg98xCsI3cUgG vhJ1C4n3axvwqtohJYg3u3UdO+W3Im94AlCqoPWHQz44IC0Q1s7mv2RMXIc5AJbGB5HF xx0TlEvNG5ohWhzPQyUAqv1WGyfmQQizyT6NEDhp9MD6x5+yWooKYruvP9jrLWctRhF1 ye6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=hZMaD8I9aDk0zLz0IWIqoklQvpbrP+A74pixqWGJGI0=; b=T0f5nKeQTNKQ9G561K6VAuoSqdtaRAiUIRCZd2YNNdm/rekQQ1iAs4EaJkpzRNT6Jl mmGW+ZIbhBtsz6Bc7T9m9Hdl4NyBm7jrUlvReJhT5PS9iygL4mQyWo0ajd6Zy16KVXpO zGPzOkSlrjLkWTHV8fJCu61zy3oF3VVO5Bi3t7YQuuE2dDV6GPqJa5z6pos26CEAPOIb FYdJDA8TKieRHGVXaLPFdf0R2+qzFeikI014QRN3fDYZErYlmoCUgInMrTLuVOZqY7Vy 8nDEISc2hPM8mjjV10XOr2C0tEingTDeCJOfrKIPFPcTALBjD70SiKFuIl9MBlv8/tJj 6l+g== X-Gm-Message-State: ACrzQf1LOK9HE42V5EsTJdw7Wx7F9PgMTVD3P9zOWO4odt0s0mUGdp4B J1aH4Dw3r0iBW4cTLvu/1pHsZ+Cy6e/GnRxqD40= X-Google-Smtp-Source: AMsMyM6wODUWpG/iZFzo5PgXpgJGEcOioYCsGmGzcq1AKDWiE9TrXAS7yQnYTwx1pg3quvbCFxycjwH2BFKYIkqmfKw= X-Received: by 2002:a05:600c:3c8e:b0:3b4:d224:addf with SMTP id bg14-20020a05600c3c8e00b003b4d224addfmr13683944wmb.132.1663951392426; Fri, 23 Sep 2022 09:43:12 -0700 (PDT) MIME-Version: 1.0 References: <83o7v9ugv2.fsf@gnu.org> <83czbnud9d.fsf@gnu.org> <83tu4zstlg.fsf@gnu.org> <83k05ur60n.fsf@gnu.org> In-Reply-To: <83k05ur60n.fsf@gnu.org> From: Ioannis Kappas Date: Fri, 23 Sep 2022 17:43:01 +0100 Message-ID: Subject: Re: bug#57880: 28.1; Emacs crashes with native compilation on when some antivirus program is running on MS-Windows To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 57880 Cc: 57880@debbugs.gnu.org, akrl@sdf.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Eli, On Fri, Sep 23, 2022 at 6:53 AM Eli Zaretskii wrote: > > > From: Ioannis Kappas > > Date: Thu, 22 Sep 2022 21:46:14 +0100 > > Cc: akrl@sdf.org, 57880@debbugs.gnu.org > > > > > > Or could there be an early init option to bypass the native compilation. This > > > > way the users can test the issue with is native comp. > > > > > > There is one already. > > > > Are you referring to an option for building form source? I couldn't > > find an option > > to turn off native compile for the precompiled windows binaries (such as those > > retrieved from the official ftp site or from msys2 pacman) that can configured > > to disable native comp. > > It's native-comp-deferred-compilation: set it to nil. For a good > measure, also set comp-enable-subr-trampolines to nil. Emacs does > this automatically at startup if libgccjit cannot be loaded. Thanks, it's good to know, I could find any straight references about it on the web. > So you are saying that if someone installs Emacs under C:/Users, that > Emacs will not work, regardless of the native-compilation, because it > will be unable to load the DLLs which come in the Emacs binary > distribution, for example the image libraries? Then it is strange > that we haven't heard about such a major issue with Emacs on Windows > until now. Correct. I can't comment on how widespread that is. I personally stayed with the 27 branch until I discovered the surprising cause of the failure. I would not have reported it with just a simple hexadecimals backtrace, without a single clue what might have been going wrong. > Thanks, but that doesn't really answer my question, which was about > the specific brands of AV software _known_ to do this. You seem to > saying that the answer is 'all of them", but I'm asking what are the > brands with which this was actually seen. Sorry for being a mystic here. It is the AV made by the company who authored the article. > > > > > Those precompiled with Emacs are fine in this use case since they are > > > > not stored in the Users directory, it's only newly compiled files that > > > > exhibit this issue because they store the .eln files in the user dir by > > > > default. > > > > > > This means that the problem will only affect people who have libgccjit > > > and GCC/Binutils installed, because otherwise Emacs will be unable to > > > compile new *.eln files. Right? > > > > Yes, since I understand Emacs won't be able to generate any new .eln files > > without access to libgccjit. > > So then we can tell such people (which are relatively rare) to have > their home directory outside of the C:/Users tree. Or let them know of the alternatives, such as the use of startup-redirect-eln-cache so that they can direct the new .eln files somewhere else? I don't think people would want their .emacs.d to be located outside of the personal user folder. (I am not sure if we are referring to the same subject :) Thanks! From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 07 17:13:52 2023 Received: (at 57880) by debbugs.gnu.org; 7 Jun 2023 21:13:52 +0000 Received: from localhost ([127.0.0.1]:54925 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q70TY-0005l7-6Z for submit@debbugs.gnu.org; Wed, 07 Jun 2023 17:13:52 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60220) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q70TV-0005kp-B5 for 57880@debbugs.gnu.org; Wed, 07 Jun 2023 17:13:50 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q70TP-00056B-Dg; Wed, 07 Jun 2023 17:13:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=GChcumo4Vekglz1IpVO3W+PtXieZ60r12b+zWYd52Rs=; b=Ssfjtdg0Nt9xJ003klnD EuZO9sAczUfpWGf0NoGLBxMsKJh5NLKtSHJT3W6HZSs2RUgIK2BYIQ4dhUBdPHYRLh5yyr8A5G3Dz jQWVXfccu14gZz3mrMtUBxVjikbieiUuHEMVxlFcyaQPo4JsUETjXOdhtyBw4KsNyHeQBeIVnvo9z need+llCAolGaQA20bDhFyrBoGdGfWZHXaW2WNdqRDKyUHkS11tlDXtgPDeqH0SmjT4TKxEknSDp8 UbamdF/m/bj4cUBxPOMH2Y+EQA5WX1inIpmH1qFRaiaH3vnm6t84hJrt+twr12DyvkaBHvsaDLPM/ C1dVQAzSACZYbg==; Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1q70TO-0001Au-Ei; Wed, 07 Jun 2023 17:13:42 -0400 From: Andrea Corallo To: Ioannis Kappas Subject: Re: bug#57880: 28.1; Emacs crashes with native compilation on when some antivirus program is running on MS-Windows In-Reply-To: (Ioannis Kappas's message of "Fri, 23 Sep 2022 17:43:01 +0100") References: <83o7v9ugv2.fsf@gnu.org> <83czbnud9d.fsf@gnu.org> <83tu4zstlg.fsf@gnu.org> <83k05ur60n.fsf@gnu.org> Date: Wed, 07 Jun 2023 17:13:42 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57880 Cc: Eli Zaretskii , akrl@sdf.org, 57880@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Ioannis Kappas writes: > Hi Eli, > > On Fri, Sep 23, 2022 at 6:53 AM Eli Zaretskii wrote: >> >> > From: Ioannis Kappas >> > Date: Thu, 22 Sep 2022 21:46:14 +0100 >> > Cc: akrl@sdf.org, 57880@debbugs.gnu.org >> > >> > > > Or could there be an early init option to bypass the native compilation. This >> > > > way the users can test the issue with is native comp. >> > > >> > > There is one already. >> > >> > Are you referring to an option for building form source? I couldn't >> > find an option >> > to turn off native compile for the precompiled windows binaries (such as those >> > retrieved from the official ftp site or from msys2 pacman) that can configured >> > to disable native comp. >> >> It's native-comp-deferred-compilation: set it to nil. For a good >> measure, also set comp-enable-subr-trampolines to nil. Emacs does >> this automatically at startup if libgccjit cannot be loaded. > > Thanks, it's good to know, I could find any straight references about it > on the web. > >> So you are saying that if someone installs Emacs under C:/Users, that >> Emacs will not work, regardless of the native-compilation, because it >> will be unable to load the DLLs which come in the Emacs binary >> distribution, for example the image libraries? Then it is strange >> that we haven't heard about such a major issue with Emacs on Windows >> until now. > > Correct. I can't comment on how widespread that is. I personally stayed with > the 27 branch until I discovered the surprising cause of the failure. > I would not have reported it with just a simple hexadecimals backtrace, > without a single clue what might have been going wrong. > >> Thanks, but that doesn't really answer my question, which was about >> the specific brands of AV software _known_ to do this. You seem to >> saying that the answer is 'all of them", but I'm asking what are the >> brands with which this was actually seen. > > Sorry for being a mystic here. It is the AV made by the company who authored > the article. > >> >> > > > Those precompiled with Emacs are fine in this use case since they are >> > > > not stored in the Users directory, it's only newly compiled files that >> > > > exhibit this issue because they store the .eln files in the user dir by >> > > > default. >> > > >> > > This means that the problem will only affect people who have libgccjit >> > > and GCC/Binutils installed, because otherwise Emacs will be unable to >> > > compile new *.eln files. Right? >> > >> > Yes, since I understand Emacs won't be able to generate any new .eln files >> > without access to libgccjit. >> >> So then we can tell such people (which are relatively rare) to have >> their home directory outside of the C:/Users tree. > > Or let them know of the alternatives, such as the use of > startup-redirect-eln-cache > so that they can direct the new .eln files somewhere else? I don't think people > would want their .emacs.d to be located outside of the personal user > folder. (I am not sure if we are referring to the same subject :) > > Thanks! Hello all, I'm not sure, is there any action we should take for this bug or should we close it? Thanks! Andrea From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 08 01:32:00 2023 Received: (at 57880-done) by debbugs.gnu.org; 8 Jun 2023 05:32:00 +0000 Received: from localhost ([127.0.0.1]:55440 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q78Fc-00017f-7G for submit@debbugs.gnu.org; Thu, 08 Jun 2023 01:32:00 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50726) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q78FX-00017M-CI for 57880-done@debbugs.gnu.org; Thu, 08 Jun 2023 01:31:58 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q78FR-0005V0-9p; Thu, 08 Jun 2023 01:31:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=c1yg3QPFZJzv+FS4/Qt7bYVfCqqxMiObJ3RA1SFPDLc=; b=dzkRfJOHx5a2 71zCMDiU2oF68jygjM7V/WVqBf4nA7oXjGjlsQbPMky7+q+xfaxLMybbK8EqdeUdcknE2WIKLVkDy yHhyWKJl1p21o2MyF522zcHsdvqPQ3DnU9KjaLB5MHhRPGQST0kX6Mt0f7nxxMfVqPOK1YASlAla0 3HytESNQN+qvpdUFI09fRxsOJMKLW6xMLRH8xWzoDGuFYucymexJuIVRGHvFEamRhbbzPpXy5O9lY LrgqbTjzE/ai2gOeqzsD51bAKJIdcWFFMmxf2Bs6/mos6zoLEqMp8W8FQU60kE55U7GU1uCfN7MBB PjqLIQV6MRM8bTrCcbFxjA==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q78FP-0002bQ-LX; Thu, 08 Jun 2023 01:31:48 -0400 Date: Thu, 08 Jun 2023 08:31:51 +0300 Message-Id: <83o7lq34fs.fsf@gnu.org> From: Eli Zaretskii To: Andrea Corallo In-Reply-To: (message from Andrea Corallo on Wed, 07 Jun 2023 17:13:42 -0400) Subject: Re: bug#57880: 28.1; Emacs crashes with native compilation on when some antivirus program is running on MS-Windows References: <83o7v9ugv2.fsf@gnu.org> <83czbnud9d.fsf@gnu.org> <83tu4zstlg.fsf@gnu.org> <83k05ur60n.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57880-done Cc: 57880-done@debbugs.gnu.org, ioannis.kappas@gmail.com, akrl@sdf.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Andrea Corallo > Cc: Eli Zaretskii , 57880@debbugs.gnu.org, akrl@sdf.org > Date: Wed, 07 Jun 2023 17:13:42 -0400 > > I'm not sure, is there any action we should take for this bug or should > we close it? I've now added an entry about this to etc/PROBLEMS, and I'm therefore closing this bug. From unknown Thu Aug 14 18:39:42 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 06 Jul 2023 11:24:09 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator