From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#53497: 29.0.50; native-compile after restarting Emacs Date: Tue, 25 Jan 2022 15:31:46 +0200 Message-ID: <83fspchrgd.fsf@gnu.org> References: <86lez5zb7o.fsf@gnu.org> <87zgnl1l4o.fsf@gnus.org> <86h79tzait.fsf@gnu.org> <83zgnljop0.fsf@gnu.org> <864k5tz4ac.fsf@gnu.org> <83tudtjnqm.fsf@gnu.org> <86zgnl45sq.fsf@gnu.org> <83o841jlhz.fsf@gnu.org> <83mtjljl8s.fsf@gnu.org> <83lez5jjcf.fsf@gnu.org> <867dap834p.fsf@gnu.org> <835yq9j6jn.fsf@gnu.org> <861r0wjcz4.fsf@gnu.org> <83k0eohu0l.fsf@gnu.org> <86czkgm13p.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18616"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, 53497@debbugs.gnu.org, akrl@sdf.org To: Arash Esbati Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 25 15:28:45 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 1nCMoP-0004eo-A2 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 25 Jan 2022 15:28:45 +0100 Original-Received: from localhost ([::1]:34120 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nCMoO-0003gq-9O for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 25 Jan 2022 09:28:44 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46464) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCLwn-0008UU-9A for bug-gnu-emacs@gnu.org; Tue, 25 Jan 2022 08:33:21 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54526) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nCLwU-0007LN-Hq for bug-gnu-emacs@gnu.org; Tue, 25 Jan 2022 08:33:07 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nCLwU-00037o-Fy for bug-gnu-emacs@gnu.org; Tue, 25 Jan 2022 08:33:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Jan 2022 13:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53497 X-GNU-PR-Package: emacs Original-Received: via spool by 53497-submit@debbugs.gnu.org id=B53497.164311754811030 (code B ref 53497); Tue, 25 Jan 2022 13:33:02 +0000 Original-Received: (at 53497) by debbugs.gnu.org; 25 Jan 2022 13:32:28 +0000 Original-Received: from localhost ([127.0.0.1]:47429 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nCLvw-0002rQ-24 for submit@debbugs.gnu.org; Tue, 25 Jan 2022 08:32:28 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:45532) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nCLvu-0002mB-1n for 53497@debbugs.gnu.org; Tue, 25 Jan 2022 08:32:26 -0500 Original-Received: from [2001:470:142:3::e] (port=34672 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCLvn-0007HB-B5; Tue, 25 Jan 2022 08:32:20 -0500 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=ZkAaGkaVidirm0T2B4TsTSVAoOS/Ze9nvY++Wmxe44w=; b=j+RJDYLSFyOY qIR7Ta2QJIamPWLtO+5L3FBL+aeTLJGmoazGhHNAIOp34dTGtKLubjDY4ZIGIzw5f1FvXF7Kiqnqv DmTA9q5y7qAaK7Jkgf5OIPAqjHFSQZgtJMNJNnQLhsWKFvuG0AMRlvDF6vbRiTR8e7xyvN2+GLo51 9VXqRPHv0dD4WLLYzb5DMg5vl0GgldIhqd92x2Yzxi96Muj6OLT2HDaXJGHbGEeN8liGO8HNd56KK 4s9l4yNabBniquOvs4notTR29ama1sST8KhWH1ELw4IAXiSboiRbU4unZpJt49FMeKg6ZdemnX0G3 o1h7puHpHXOWs/JoMCIq4g==; Original-Received: from [87.69.77.57] (port=4935 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 1nCLvQ-0002O0-PG; Tue, 25 Jan 2022 08:32:10 -0500 In-Reply-To: <86czkgm13p.fsf@gnu.org> (message from Arash Esbati on Tue, 25 Jan 2022 13:49:46 +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:225175 Archived-At: > From: Arash Esbati > Cc: akrl@sdf.org, larsi@gnus.org, 53497@debbugs.gnu.org > Date: Tue, 25 Jan 2022 13:49:46 +0100 > > Eli Zaretskii writes: > > > You mean, the breakpoint in maybe_defer_native_compilation never > > breaks? That in itself is probably a sign of some problem. > > This is what I do and see: > > -> gdb ./emacs RET > GNU gdb (GDB) 11.1 > Copyright (C) 2021 Free Software Foundation, Inc. > [...] > Reading symbols from ./emacs... > (gdb) break maybe_defer_native_compilation RET > Breakpoint 1 at 0x400241af0: file comp.c, line 5104. > (gdb) run -Q RET > Starting program: Z:\pathto\bin\emacs.exe -Q > [New Thread 9392.0x3f84] > [New Thread 9392.0x5758] > [New Thread 9392.0x1d48] > [New Thread 9392.0x53e8] > [New Thread 9392.0x51b0] > > Thread 1 hit Breakpoint 1, maybe_defer_native_compilation (function_name=0xffff81f161684338, definition=0x1e782a44035) at comp.c:5104 > 5104 if (!load_gccjit_if_necessary (false)) > (gdb) > > 'Thread 1 hit Breakpoint 1' starts when I try to 'C-x C-f' a .tex file > in Emacs. And then I can use n, s within the debugger. But I don't get > any error and such. Does this make sense to you? I'm not really > familiar with GDB. Step through the code of maybe_defer_native_compilation with the 'n' command, and see if it calls native--compile-async in this fragment: /* This is so deferred compilation is able to compile comp dependencies breaking circularity. */ if (!NILP (Ffeaturep (Qcomp, Qnil))) { /* Comp already loaded. */ if (!NILP (delayed_sources)) { CALLN (Ffuncall, intern_c_string ("native--compile-async"), delayed_sources, Qnil, Qlate); delayed_sources = Qnil; } Fputhash (function_name, definition, Vcomp_deferred_pending_h); CALLN (Ffuncall, intern_c_string ("native--compile-async"), src, Qnil, Qlate); } If the code exits the function before getting to this place, try to figure out why. It could fail to load libgccjit DLL, here: if (!load_gccjit_if_necessary (false)) return; Or it could exit due to one of the following conditions: if (!native_comp_deferred_compilation || noninteractive || !NILP (Vpurify_flag) || !COMPILEDP (definition) || !STRINGP (Vload_true_file_name) || !suffix_p (Vload_true_file_name, ".elc") || !NILP (Fgethash (Vload_true_file_name, V_comp_no_native_file_h, Qnil))) return; Or it could exit because it doesn't find the Lisp source file: Lisp_Object src = concat2 (CALL1I (file-name-sans-extension, Vload_true_file_name), build_pure_c_string (".el")); if (NILP (Ffile_exists_p (src))) { src = concat2 (src, build_pure_c_string (".gz")); if (NILP (Ffile_exists_p (src))) return; } Does one of these early returns indeed happen? If not, i.e. if the code indeed calls native--compile-async, then you should see a subprocess being started: native--compile-async calls comp-run-async-workers, which calls make-process. The code is in comp.el. If the subprocess is started, then JIT native-compilation does work, and the question is what happens with the produced *.eln files.