From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#71929: 30.0.60; crash in mark_image_cache Date: Tue, 09 Jul 2024 22:03:34 +0800 Message-ID: <874j8y1x3d.fsf@yahoo.com> References: <87tth1rkfy.fsf@melete.silentflame.com> <87plrprkb2.fsf@melete.silentflame.com> <87frsl3l0p.fsf@yahoo.com> <87plrpvm2y.fsf@melete.silentflame.com> <86a5it3cj2.fsf@gnu.org> <875xth3aym.fsf@yahoo.com> <87ed851gwv.fsf@melete.silentflame.com> <871q452u1b.fsf@yahoo.com> <87frsi226v.fsf@yahoo.com> Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40420"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 71929@debbugs.gnu.org, Eli Zaretskii To: Sean Whitton Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 09 16:05:11 2024 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 1sRBSx-000AED-6M for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 09 Jul 2024 16:05:11 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sRBSl-0008Ia-TG; Tue, 09 Jul 2024 10:04:59 -0400 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 1sRBSk-0008GK-1P for bug-gnu-emacs@gnu.org; Tue, 09 Jul 2024 10:04:58 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sRBSj-0005qP-9K for bug-gnu-emacs@gnu.org; Tue, 09 Jul 2024 10:04:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sRBSo-0000vP-JA for bug-gnu-emacs@gnu.org; Tue, 09 Jul 2024 10:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Jul 2024 14:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71929 X-GNU-PR-Package: emacs Original-Received: via spool by 71929-submit@debbugs.gnu.org id=B71929.17205338433474 (code B ref 71929); Tue, 09 Jul 2024 14:05:02 +0000 Original-Received: (at 71929) by debbugs.gnu.org; 9 Jul 2024 14:04:03 +0000 Original-Received: from localhost ([127.0.0.1]:53640 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sRBRq-0000tx-Fs for submit@debbugs.gnu.org; Tue, 09 Jul 2024 10:04:03 -0400 Original-Received: from sonic308-56.consmr.mail.ne1.yahoo.com ([66.163.187.31]:34169) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sRBRp-0000tS-4X for 71929@debbugs.gnu.org; Tue, 09 Jul 2024 10:04:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1720533828; bh=48ChM5R1XdITiBfQauKRIYJRgrRcQW3XMdIvZ/tlAsI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=I2gq/dR94o4Hl2713weMLZN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3T88KF1T3gVMn.yfk6nhJFMbQU9XKxBLpd5fw.ELGanQf4doT wwBSk76Esq4AMcCNWFw4HSshKEt4LAwyvahJ910Dh6bRiZp2cFtrQJ6MVDQYiFAP5LqzPiZGyjxo fH8jXpjKMBPziAh7MBJ.uDb7lCquKydLoln7Oe.M.eb7J_egXasuT3voYd9PrwrDX.N.ffenNzxQ 638PwPMZ0bTOadREw2kkG9o2XOn1MVhqJduXMqMQkjbexvvTtQG8xCoRj6pSMVm01YmD4dsSciOB ggm5B9ZWqHnKrZ8rLN.9RH66YaC4NAUE0uShTfkea4Z2PxIqSA0XGHK1vPF5z0dM_RLhyL2EJ.E7 U8IeSBAFatfqmFRyVZVCobD6qihFfxRlpH99WNCgv2OPLMRLAgjWZCIIeMG3sck.YrHpe7S2Fb5b FL4vTqClsXB41usplu2faNQ3zzYdK39FlMtDlorIa2pS4Qei8J3X6PhY5jOuiYKcYMj1tfsivjG. 0vwwLS83ko7KfFv7sNHlUAVAySj43kQJZi6kRSUhOr7brdm4rnmfYvyUH1R9l9XD3U.o3.f6O2JY b778tW0lXTp37EQM8TqnDhycVdHKk9Gv9KETB_MLFN X-Sonic-MF: X-Sonic-ID: e9445430-2a98-43c2-9e92-20afc9c76d93 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic308.consmr.mail.ne1.yahoo.com with HTTP; Tue, 9 Jul 2024 14:03:48 +0000 Original-Received: by hermes--production-sg3-7b469d9f6-6hvhq (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID b9c3c324bc6dcea26c01c82cb14cc2dc; Tue, 09 Jul 2024 14:03:43 +0000 (UTC) In-Reply-To: (Sean Whitton's message of "Tue, 9 Jul 2024 21:44:20 +0800") X-Mailer: WebService/1.1.22464 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo 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:288638 Archived-At: Sean Whitton writes: > On Tue, Jul 09, 2024 at 08:13:28PM +0800, Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote: >> Sean Whitton writes: >> >> > On Sun, Jul 07, 2024 at 09:47:28PM +0800, Po Lu wrote: >> > >> >> I must ask you to bear with me again, as another detail was not >> >> correctly accounted for in the last patch. Please retry with this: >> > >> > This just crashed. Apparent trigger was 'emacsclient -t', this time. >> > >> > verify_image_cache_refcount is not in the backtrace. >> > >> > I should be able to keep it open in a stable build of Emacs for at least 24h >> > if you'd like to ask for more. >> > >> > Thread 1 "emacs" received signal SIGSEGV, Segmentation fault. >> > 0x00005555557a21cd in mark_image_cache (c=0x55555672cc50) at image.c:3776 >> > 3776 if (c->images[i]) >> >> And this is a segmentation fault, not a trap. Can you establish when >> the frame in question was created, how and where it received its current >> image cache, and whether this frame exists in Vframe_list? > > I'm afraid I'm not familiar with any of these data structures. I don't know > what these image caches are. > > In the mark_frame stack frame I did "p f" to obtain the address > 0x555559f61330. I then did the "while $cons" thing you posted in another > message, and searched its output for this address, and it is not present. > > So perhaps this means the frame is not present in Vframe_list. OK, I believe I understand the source of these crashes. A frame whose image cache is shared among several frames is destroyed, but its `image_cache' field is never cleared after it is destroyed, as its cache continues to be referenced, and, if references to the dead frame remain, GC attempts to mark the said image cache although its validity is no longer guaranteed. In earlier Emacs versions, this problem would have appeared if references to dead frames were preserved beyond the destruction of a display structure. This has been corrected on the emacs-30 branch, and therefore if the crashes do not resurface in a few days, I will close this ticket. Thanks.