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#60220: 29.0.60; macOS 13.1 crash shortly after starting Emacs Date: Tue, 20 Dec 2022 19:23:00 +0200 Message-ID: <83r0wuat1n.fsf@gnu.org> References: <83y1r2axrn.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8912"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60220@debbugs.gnu.org To: Aaron Jensen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 20 19:49:37 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 1p7hgG-00027o-UC for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 20 Dec 2022 19:49:36 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p7gKV-000128-S2; Tue, 20 Dec 2022 12:23:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p7gKU-000120-G9 for bug-gnu-emacs@gnu.org; Tue, 20 Dec 2022 12:23:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p7gKT-0004Kw-VC for bug-gnu-emacs@gnu.org; Tue, 20 Dec 2022 12:23:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p7gKT-0007B2-Iz for bug-gnu-emacs@gnu.org; Tue, 20 Dec 2022 12:23:01 -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, 20 Dec 2022 17:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60220 X-GNU-PR-Package: emacs Original-Received: via spool by 60220-submit@debbugs.gnu.org id=B60220.167155697527582 (code B ref 60220); Tue, 20 Dec 2022 17:23:01 +0000 Original-Received: (at 60220) by debbugs.gnu.org; 20 Dec 2022 17:22:55 +0000 Original-Received: from localhost ([127.0.0.1]:46095 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7gKN-0007Ao-8A for submit@debbugs.gnu.org; Tue, 20 Dec 2022 12:22:55 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46438) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p7gKL-0007Ag-IO for 60220@debbugs.gnu.org; Tue, 20 Dec 2022 12:22:53 -0500 Original-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 1p7gKF-0004K7-KF; Tue, 20 Dec 2022 12:22:47 -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=ltKAEOxoZyoTpYoLG6vWB1ISvinR2Jgz838Oph/R70U=; b=DXy2kzkl8GWv Alvgmo1kFk/s9h86ptL4x1rdJnhYri8EXfbIrV/66b7TdtflS8xJw1FS39JOLz3bqvx2DvyqIjz/v ge1oQcqs4SoBD23FadAxjEdbPWHbvwX+iQnQ3N/iz4OfC1RtPfkImNESMCp2zlw7EtjzZCLX4yVm/ X431nE4tsIKGmQPXD2oQ6glDUuIFuR9+11C4D7CDXASZreiDeUOhURBiXoOYegH5/RKOb7EC1Ik7S rSTaAoTwiKEqJ7Mo6erRQU+x5V7h0zglHzvqbwRLQyynZWBLJP6tkkCQ7rI5p14vfAbScqknUsZxK 9fWMUUkGb0V0Jcr+eyas6g==; Original-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 1p7gKE-0005Vn-Lg; Tue, 20 Dec 2022 12:22:46 -0500 In-Reply-To: (message from Aaron Jensen on Tue, 20 Dec 2022 10:59:20 -0500) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:251540 Archived-At: > From: Aaron Jensen > Date: Tue, 20 Dec 2022 10:59:20 -0500 > Cc: 60220@debbugs.gnu.org > > On Tue, Dec 20, 2022 at 10:40 AM Eli Zaretskii wrote: > > > > AFAIU, it says that Emacs was _loading_ rng-loc. That doesn't mean > > the problem is in rng-loc's code. The fatal signal comes from the > > maxOS implementation of dlopen, so I suspect that the way we restart > > Emacs messes up some OS data structures regarding loaded shared > > libraries or something. > > > > Note that the previous crash you posted also crashes inside dlopen. > > > > So I think it's safe to say that restarting Emacs makes loading of > > *.eln files (and maybe share libraries in general) fragile and tending > > to crash, for some reason. Maybe we should explicitly unload all the > > *.eln files when we restart? > > Interesting. If I restart while launched from lldb, I get the below. > It happens right away and it doesn't actually restart. This is not the > behavior I see if I launch it normally or in xcode. I should note that > occasionally when I restart Emacs it just quits and does not restart. > I have to restart it manually. Perhaps this is all connected to the > issue you're suggesting. > > (lldb) process launch > Process 19414 launched: 'src/emacs' (arm64) > Process 19414 stopped > * thread #8, stop reason = exec > frame #0: 0x0000000100b2c950 dyld`_dyld_start > dyld`: > -> 0x100b2c950 <+0>: mov x0, sp > 0x100b2c954 <+4>: and sp, x0, #0xfffffffffffffff0 > 0x100b2c958 <+8>: mov x29, #0x0 > 0x100b2c95c <+12>: mov x30, #0x0 > Target 0: (emacs) stopped. > (lldb) thread list > Process 19414 stopped > * thread #8: tid = 0x3026c, 0x0000000100b2c950 dyld`_dyld_start, stop > reason = exec > (lldb) thread backtrace > * thread #8, stop reason = exec > * frame #0: 0x0000000100b2c950 dyld`_dyld_start > (lldb) continue > Process 19414 resuming > Process 19414 exited with status = 14 (0x0000000e) Terminated due to signal 14 What is "signal 14" on macOS? Anyway, look at the code: we restart by calling execvp. You or someone who knowns macOS internals should take a look at what that means for shared libraries which were loaded by the program that calls execvp -- what happens with those libraries in the execvp'ed process. I'm guessing that they are not being unloaded and re-loaded by the new process, or something to that effect. Or maybe the way we load the *.eln files causes this, triggered by 'execvp'? Can you try running for a while Emacs built without native compilation and restarting it? That could tell us whether the *.eln files are the problem.