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#58042: 29.0.50; ASAN use-after-free in re_match_2_internal Date: Wed, 05 Oct 2022 19:23:53 +0800 Message-ID: <87pmf6v7hy.fsf@yahoo.com> References: <83edvnv965.fsf@gnu.org> <83pmf6u76i.fsf@gnu.org> <83mtaau43p.fsf@gnu.org> <83ilkytyif.fsf@gnu.org> <87y1tuv851.fsf@yahoo.com> Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12164"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) Cc: Eli Zaretskii , 58042@debbugs.gnu.org, Alan Third To: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 05 13:27:09 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 1og2YP-0002yr-HI for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 05 Oct 2022 13:27:09 +0200 Original-Received: from localhost ([::1]:50374 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1og2YN-00006m-Ll for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 05 Oct 2022 07:27:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38068) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1og2WM-0007UR-WA for bug-gnu-emacs@gnu.org; Wed, 05 Oct 2022 07:25:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57021) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1og2WM-0003lz-MY for bug-gnu-emacs@gnu.org; Wed, 05 Oct 2022 07:25:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1og2WM-00079K-Gx for bug-gnu-emacs@gnu.org; Wed, 05 Oct 2022 07:25: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: Wed, 05 Oct 2022 11:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58042 X-GNU-PR-Package: emacs Original-Received: via spool by 58042-submit@debbugs.gnu.org id=B58042.166496905227402 (code B ref 58042); Wed, 05 Oct 2022 11:25:02 +0000 Original-Received: (at 58042) by debbugs.gnu.org; 5 Oct 2022 11:24:12 +0000 Original-Received: from localhost ([127.0.0.1]:56099 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1og2VY-00077u-0S for submit@debbugs.gnu.org; Wed, 05 Oct 2022 07:24:12 -0400 Original-Received: from sonic306-20.consmr.mail.ne1.yahoo.com ([66.163.189.82]:34039) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1og2VW-00077g-9H for 58042@debbugs.gnu.org; Wed, 05 Oct 2022 07:24:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1664969044; bh=f6OpFyagHXMnnKYMaQDSjEfbn7Ex1bFOG4BU1TrMZb4=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=FHX7luzfSPE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KjbB7tM9JsopiU.Z8J9D584ndpo1gFVOB3g8GaIQ0bjbhwOrhB6iYWtwCOfQDCfMP6j ZV2EZUGo6BHkm6XIXGFXoF3Zejj3mki5d5Ifo4zSWpL32wxh95TxhBB1qIkxx5leuP_bEf6Fg4Tt ONRL63W2Rk_WPjTxt9o3s2RJFKDjQffybJCrtVdASK7Xp9UvwnkT8OrRQFUKGFmYN92OzELtXBuv YmQk2z2stfo7n8.IKUP6gSSsNKfm6MHf8oEZ95HEb7TO_OGYAESOeV7m68y2capGXuJV7ae_b0bX nFERVIEUDdfua5HDr47y8eRfgL_fYoxkJuvnvJqhotBINruku.5Xfn_yQOX9bLuSLQSkKuGb5No5 KcsuDAy2jN3swhnbe1DxbfzqX2BGkjh7R40t3vLNNe3CZ1wph2nNu_gULKk4egg.AZcyfX5l6iMC cndGsXLeFTR1qFKitgt95rUC1cpYMLaYkl5Ou0dqeRyOFaGvAxcIwWZtFu1xEP9LHYy6ENEi4jbm MmFfMxwNcka5K8NlHEfHwRjM4gCpGu5nOvubxJg7domBzWm882Va7hk1JvjscjmrwFxFST5Lm.iw 4g2h0p9pDsCzpz_Yr8ndDJhjN8lLTR5FAfSZNlOlCJ X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.ne1.yahoo.com with HTTP; Wed, 5 Oct 2022 11:24:04 +0000 Original-Received: by hermes--production-sg3-cf9dc7f8d-f6dcn (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 666d807ab56ec92c7b2e9efb31e5951b; Wed, 05 Oct 2022 11:23:58 +0000 (UTC) In-Reply-To: ("Gerd =?UTF-8?Q?M=C3=B6llmann?="'s message of "Wed, 05 Oct 2022 13:15:49 +0200") X-Mailer: WebService/1.1.20702 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" Xref: news.gmane.io gmane.emacs.bugs:244519 Archived-At: Gerd M=C3=B6llmann writes: > Po Lu writes: > >> I'm going to guess that window_sub_list is returning a window that was >> not marked during GC. It's a problem that also exists with my >> incremental garbage collector. Does this help? >> >> diff --git a/src/alloc.c b/src/alloc.c >> index 419c5e558b..522925d248 100644 >> --- a/src/alloc.c >> +++ b/src/alloc.c >> @@ -6634,6 +6634,9 @@ mark_window (struct Lisp_Vector *ptr) >> mark_glyph_matrix (w->desired_matrix); >> } >>=20=20 >> + if (w->next) >> + mark_window (w->next); >> + >> /* Filter out killed buffers from both buffer lists >> in attempt to help GC to reclaim killed buffers faster. >> We can do it elsewhere for live windows, but this is the > > Indeed, that seems to work! Right. I've not had the time to investigate why unmarked windows remain in the window tree, so I have the equivalent of that in my incremental garbage collector. I think there is an implicit assumption being made (for example, about a list where all live windows are put) somewhere that is being broken, but I haven't found where.