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#58042: 29.0.50; ASAN use-after-free in re_match_2_internal Date: Wed, 05 Oct 2022 15:59:33 +0300 Message-ID: <83edvmtoi2.fsf@gnu.org> References: <83edvnv965.fsf@gnu.org> <83pmf6u76i.fsf@gnu.org> <83mtaau43p.fsf@gnu.org> <83ilkytyif.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1163"; mail-complaints-to="usenet@ciao.gmane.io" Cc: alan@idiocy.org, 58042@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 Wed Oct 05 15:02:45 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 1og42t-00007Y-FE for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 05 Oct 2022 15:02:43 +0200 Original-Received: from localhost ([::1]:37212 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1og42s-0001h8-CR for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 05 Oct 2022 09:02:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40478) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1og40J-0001fm-Fb for bug-gnu-emacs@gnu.org; Wed, 05 Oct 2022 09:00:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57129) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1og40J-0005hL-3G for bug-gnu-emacs@gnu.org; Wed, 05 Oct 2022 09:00:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1og40I-0003Pf-JR for bug-gnu-emacs@gnu.org; Wed, 05 Oct 2022 09:00:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 05 Oct 2022 13:00: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.166497478713069 (code B ref 58042); Wed, 05 Oct 2022 13:00:02 +0000 Original-Received: (at 58042) by debbugs.gnu.org; 5 Oct 2022 12:59:47 +0000 Original-Received: from localhost ([127.0.0.1]:56207 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1og403-0003Oj-GR for submit@debbugs.gnu.org; Wed, 05 Oct 2022 08:59:47 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:55334) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1og3zy-0003OT-Es for 58042@debbugs.gnu.org; Wed, 05 Oct 2022 08:59:46 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:54974) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1og3zs-0005dC-7T; Wed, 05 Oct 2022 08:59:36 -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=NHNypw5u8jRKkvEFzXgOZnmhpGLvNscuv5P4r4k78+0=; b=BGNLKyFcK8KT+SlOHes8 c/GQf0uNfQFk7u0CZaartWFlHazvKZjBDdHXkb/g1vzaTqALiB95JPWhBYz7uVTbbvjw0pTSLe/Lo RoGtgpDOKplK9HwlenNCORkvdGTflkVVEwR/F4kdwF+inJvjglBnFB4V8eoVxry3tVEJxwsfLPR7C 5f472+Fvope2ACq5qjwKddyIoeYtlZZcTeq+taJ5dyyzJHyGxsLAu+lO3ACFp+9hG1X7ZG1MWHw5M FPmemDbCc2oMdK9m1J9nixD6ztRGblN3dNG1oENV6kNvn9efXL/GeQ8ngubR/DL1PrVJs/292hQYw mLJSE9eYOopmaw==; Original-Received: from [87.69.77.57] (port=1347 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 1og3zr-00055S-Mf; Wed, 05 Oct 2022 08:59:36 -0400 In-Reply-To: (message from Gerd =?UTF-8?Q?M=C3=B6llmann?= on Wed, 05 Oct 2022 12:14:04 +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:244529 Archived-At: > From: Gerd Möllmann > Cc: 58042@debbugs.gnu.org, Alan Third > Date: Wed, 05 Oct 2022 12:14:04 +0200 > > Eli Zaretskii writes: > > > So I guess we should do this dance around calls to maybe_quit in > > regex-emacs.c: > > > > specpdl_ref gc_count = inhibit_garbage_collection (); > > maybe_quit (); > > unbind_to (gc_count, Qnil); > > > > Or maybe even better, do this inside probably_quit (because who knows > > how many other callers of maybe_quit could be hit by this unexpected > > GC)? > > > > Can you try this? > > Isn't the -[EmacsView layoutSublayersOfLayer:] the problem? AFAICT from > a web search, this is an event handler method that is also called from > by the framework? > > In the olden days, it was a serious error to call into Lisp from an > event handler. All bets were off when that happened, not only related > to GC. I believe that hasn't changed much. > > That code was introduced by Alan around this time. > > 1ba02d85a964e1b2c6a9735cd3decdc524e06dc1 > Author: Alan Third > AuthorDate: Sat Jun 12 10:25:47 2021 +0100 > Commit: Alan Third > CommitDate: Sat Jul 31 11:13:05 2021 +0100 > > Maybe Allen can say something, I've CC'd him. AFAIR, this was the best way Alan could fix display problems on macOS. He tried several other approaches, and all of them were worse.