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#56108: 29.0.50; ASAN use-after-free in re_match_2_internal Date: Mon, 20 Jun 2022 22:09:59 +0300 Message-ID: <83mte7kv7c.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9387"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 56108@debbugs.gnu.org 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 Mon Jun 20 21:48:43 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 1o3NO6-0002B9-TL for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 20 Jun 2022 21:48:43 +0200 Original-Received: from localhost ([::1]:59710 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3NO5-0008E4-TX for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 20 Jun 2022 15:48:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58280) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3Mne-00021h-FY for bug-gnu-emacs@gnu.org; Mon, 20 Jun 2022 15:11:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36317) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o3Mne-0005YW-6A for bug-gnu-emacs@gnu.org; Mon, 20 Jun 2022 15:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o3Mnd-0003uX-VM for bug-gnu-emacs@gnu.org; Mon, 20 Jun 2022 15:11:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 20 Jun 2022 19:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56108 X-GNU-PR-Package: emacs Original-Received: via spool by 56108-submit@debbugs.gnu.org id=B56108.165575222614989 (code B ref 56108); Mon, 20 Jun 2022 19:11:01 +0000 Original-Received: (at 56108) by debbugs.gnu.org; 20 Jun 2022 19:10:26 +0000 Original-Received: from localhost ([127.0.0.1]:58447 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o3Mn3-0003th-Rt for submit@debbugs.gnu.org; Mon, 20 Jun 2022 15:10:26 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:44980) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o3Mn0-0003tT-PV for 56108@debbugs.gnu.org; Mon, 20 Jun 2022 15:10:24 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:57580) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3Mmv-0005Of-Cq; Mon, 20 Jun 2022 15:10:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=brSJ2qjjJHi9lvKuaRlySZPhF7NuPCCPnYUkhm++3Yc=; b=FbPoVR5fsS8mjbVjHAJO Sa5GZZlcGHnDu4hUCrNf+URqQRfTvOs8ACPrm5tGjRmzQTGST/x0USQBd8roPZ5OC1jXAl8On329t +DouhLXaudHCVtwv6llgPahqOdywV1d5JVFe+VMAbYYa9JaCGn7UBqGVsDOVj/ipWmH3QI8WnYPCq 1+ZBnCOV79YmVivuuyN0NAJcFDWcRwgcfYJBf9hPKX6Rd12XQuaI/zO4OampriCs0OJg3zqn2z7bd FbTlrn1izlYh2qT58KVxFa4KUuF1R6Z7Ub9bgzmWABWcRHgIgIQH4X/5v+WWwkcijSF6K4e9NeNKz +5gaM8BiXaN96A==; Original-Received: from [87.69.77.57] (port=1665 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 1o3Mmq-0006x0-RI; Mon, 20 Jun 2022 15:10:16 -0400 In-Reply-To: (message from Gerd =?UTF-8?Q?M=C3=B6llmann?= on Mon, 20 Jun 2022 16:07:55 +0200) 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:234916 Archived-At: > From: Gerd Möllmann > Date: Mon, 20 Jun 2022 16:07:55 +0200 > > FWIW, here is another non-reproducible crash with ASAN. > > In short, shrink_regexp_cache realloc'd something leading to a malloc + > free, and something is still holding a pointer the old memory. Or so it > looks to me. I don't understand why some callers of compile_pattern mark the cache entry as busy, but some others don't. If a cache entry that is in use is not marked as busy, then any GC can decide to shrink the cache by freeing that entry.