From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gerd =?UTF-8?Q?M=C3=B6llmann?= Newsgroups: gmane.emacs.bugs Subject: bug#58042: 29.0.50; ASAN use-after-free in re_match_2_internal Date: Wed, 05 Oct 2022 14:02:25 +0200 Message-ID: References: <83edvnv965.fsf@gnu.org> <83pmf6u76i.fsf@gnu.org> <83mtaau43p.fsf@gnu.org> <83ilkytyif.fsf@gnu.org> <87y1tuv851.fsf@yahoo.com> <87pmf6v7hy.fsf@yahoo.com> 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="29527"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin) Cc: Eli Zaretskii , 58042@debbugs.gnu.org, Alan Third To: Po Lu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 05 14:03:22 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 1og37S-0007Xz-19 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 05 Oct 2022 14:03:22 +0200 Original-Received: from localhost ([::1]:36182 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1og37Q-0003Ox-Jg for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 05 Oct 2022 08:03:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52310) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1og378-0003Ko-Jy for bug-gnu-emacs@gnu.org; Wed, 05 Oct 2022 08:03:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57056) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1og378-0007A7-8x for bug-gnu-emacs@gnu.org; Wed, 05 Oct 2022 08:03:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1og378-0001yQ-1o for bug-gnu-emacs@gnu.org; Wed, 05 Oct 2022 08:03:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 05 Oct 2022 12:03: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.16649713567552 (code B ref 58042); Wed, 05 Oct 2022 12:03:02 +0000 Original-Received: (at 58042) by debbugs.gnu.org; 5 Oct 2022 12:02:36 +0000 Original-Received: from localhost ([127.0.0.1]:56134 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1og36h-0001xk-Md for submit@debbugs.gnu.org; Wed, 05 Oct 2022 08:02:35 -0400 Original-Received: from mail-ej1-f45.google.com ([209.85.218.45]:47070) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1og36e-0001xU-Uj for 58042@debbugs.gnu.org; Wed, 05 Oct 2022 08:02:35 -0400 Original-Received: by mail-ej1-f45.google.com with SMTP id bj12so34909615ejb.13 for <58042@debbugs.gnu.org>; Wed, 05 Oct 2022 05:02:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date; bh=OGV1Ht381hXSEchaAd9+yq5PLkNC4y40ZJQSpLnVwAM=; b=QN5L11PoU5GBlUOrcuYClqXUL3KFUwE4OwLXLJH97U/9SdwAlXUNXnwoyDGR4JDR0b 9eQZnmX+nyoSCBLyqeitHy+bC4/JvI5wDH259Z1p1jsGo2bkAiq2YZsrZ0I6HurLrZJk EaZmynFa50A0k+kN+j7dujyeEZBmtdntuBCPwKZqAHy6woj2nFIphCw/5gXmmQckRo13 503E7r9kw8ns25ZRr2yqq//jIrSxBDHYK7D6cU+pPECNd2cTrA6S0nH/FhdjTUzzArkK vTededZSYzh7gKPmjqJX/4oEic3nDoOSE88LTcyO2o6H3P2wYRCCHqjCYqO9BavEEW2g Hw/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date; bh=OGV1Ht381hXSEchaAd9+yq5PLkNC4y40ZJQSpLnVwAM=; b=AsjwcRj6qLQubnbNE00Svew+mM/EAhYBEdj70FBT1uUDwzXnsagTkfKnUZzFTDCEDU tfd9rBhtx4/o/brAo1UdMDrySNRC3+WNtlxqggMkjgM5SlAytlcfLzJ7GPXK/rwwBCbA FWdIjUW6KWw1/GEPTjtUy3R6EIXpzwG/1UFQKdEu6YKB1bJloOzyZQ3pAylNCN56wOgw eMXaX0fDt8qtGubAF9RBFryb7aOQEvob8YSBgp+Pw+47GbUZsBMg4RZZzvMw7HlF4rrC ewtOqZHmaEjKvu2Xg+zxQsDm2WHrl2f0OCCXqzEaFKnoOKBZdHFeWJYw69UFxnsSZtEw Og5w== X-Gm-Message-State: ACrzQf3yOqA2dComMLmJ0NAUo+kmOgNfV7t5V1XgLv9aCgho6OoGprvP dg1RIGOyWohsJvcP0SsvCAA= X-Google-Smtp-Source: AMsMyM5Nin2DmclBxrCFpvTC0b8rFC+RM6sj7/5xiGijzvAUyzT6Dsf/oFCMsz6c8sbKFN1h++/SXw== X-Received: by 2002:a17:907:948f:b0:78b:5a89:a23e with SMTP id dm15-20020a170907948f00b0078b5a89a23emr12212232ejc.421.1664971347103; Wed, 05 Oct 2022 05:02:27 -0700 (PDT) Original-Received: from Mini.fritz.box (pd9e36cc6.dip0.t-ipconnect.de. [217.227.108.198]) by smtp.gmail.com with ESMTPSA id r9-20020a1709061ba900b0077d6f628e14sm8516344ejg.83.2022.10.05.05.02.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Oct 2022 05:02:26 -0700 (PDT) In-Reply-To: <87pmf6v7hy.fsf@yahoo.com> (Po Lu's message of "Wed, 05 Oct 2022 19:23:53 +0800") 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:244522 Archived-At: Po Lu writes: > 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! In case it matters--I didn't mention that I actually used the change below, because w->next is a Lisp_Object in master. diff --git a/src/alloc.c b/src/alloc.c index 419c5e558b..826ff1dba5 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -6625,6 +6625,9 @@ mark_window (struct Lisp_Vector *ptr) =20 mark_vectorlike (&ptr->header); =20 + if (!NILP (w->next)) + mark_object (w->next); + /* Mark glyph matrices, if any. Marking window matrices is sufficient because frame matrices use the same glyph memory. */