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 12:14:04 +0200 Message-ID: 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 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23760"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Alan Third , 58042@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 05 12:15:14 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 1og1Qn-0005u0-L8 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 05 Oct 2022 12:15:13 +0200 Original-Received: from localhost ([::1]:45170 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1og1Qm-0006vR-4P for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 05 Oct 2022 06:15:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42942) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1og1Qc-0006vH-W8 for bug-gnu-emacs@gnu.org; Wed, 05 Oct 2022 06:15:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56867) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1og1Qc-0000oQ-Mb for bug-gnu-emacs@gnu.org; Wed, 05 Oct 2022 06:15:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1og1Qc-0004qv-BK for bug-gnu-emacs@gnu.org; Wed, 05 Oct 2022 06:15: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 10:15: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.166496485518583 (code B ref 58042); Wed, 05 Oct 2022 10:15:02 +0000 Original-Received: (at 58042) by debbugs.gnu.org; 5 Oct 2022 10:14:15 +0000 Original-Received: from localhost ([127.0.0.1]:55945 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1og1Pr-0004pf-98 for submit@debbugs.gnu.org; Wed, 05 Oct 2022 06:14:15 -0400 Original-Received: from mail-ej1-f54.google.com ([209.85.218.54]:45806) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1og1Po-0004pQ-Pm for 58042@debbugs.gnu.org; Wed, 05 Oct 2022 06:14:13 -0400 Original-Received: by mail-ej1-f54.google.com with SMTP id z23so17659868ejw.12 for <58042@debbugs.gnu.org>; Wed, 05 Oct 2022 03:14:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date; bh=ydEloL6XigaYyhk6YIuzlvI2iEXaBEjXg7qV/JL2nuk=; b=jCSbZhwkTO6vDkNxQS5UAwEqdp7B964UZYJid4pLrA4a5Q9nAmQDc+xa8ah/MMu8Pl 32TUYrkDz5Ipg5GsT3v+3Cb/Xx4du10AFBHCueh4c35EWiiLS5PqGwu0gwhvh/6jwWBp oEVhpD5yYbfqwznCLNw/3uzqi43oh/jgz/fhfc02oU1RHbIFuismnLIy8Vhw6IauhGlV Qm36KyV69nuxBUz9EVxREMs8B2yzHtcCJIm3jidymG6C/G7AFZ3mYLySrX77m0+KTcxJ jp3tz0iuQoEP5ByqKm0OLUlMPY1ji7ompURq7amcbaD3MaSKGWvljltOC0sqnVNxB+PG bbkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=ydEloL6XigaYyhk6YIuzlvI2iEXaBEjXg7qV/JL2nuk=; b=A4+rsO080dFSJ9B6IpCLHdl9VSjko4KM2ODOq4MJBcDmyeMgGVvKfIKxQ47fHuEO9Y FhrZYgLCzwH3ZOufu93Ee0amDOLxQ6W2iX4Js8yS46e0eYUuXRjmVDh0+hAu04nmT/wS Jkyo0FitNp20VIuEgQrY3S4Mc1xTTW9Po2y7TYYw2+z2x/X5Fo83teoSxrJzwyRBFfVh ricXaBmy4Lre57drqSEHZv+YBJRJmsZtgNgRLuMWwQlk0h+I4CA/w3myzPKJsyJrdbPJ z3+1UvnlBWKmWnthjiVPYPVZOYM1vQFb/IkV3bwlvNj8OMxTowo83veF5uYMLTlpaM/A o8xQ== X-Gm-Message-State: ACrzQf1PX0gPVwupqyKYSoKJ0fBnrYY8ocZdSRvIs5QpgKC3ueQEB/rg 95iBjV/st1Q9FdLufjAB9xQ= X-Google-Smtp-Source: AMsMyM4AhkpthsJ2D8k+QJPeA6pqpU0AOdZJMczMjP+U3Lbx3MaTpL9Y1QcP4jb4CWvfTCrMfZVmrw== X-Received: by 2002:a17:907:80a:b0:783:2585:5d73 with SMTP id wv10-20020a170907080a00b0078325855d73mr23068373ejb.642.1664964846625; Wed, 05 Oct 2022 03:14:06 -0700 (PDT) Original-Received: from Mini.fritz.box (pd9e36cc6.dip0.t-ipconnect.de. [217.227.108.198]) by smtp.gmail.com with ESMTPSA id t26-20020a170906179a00b0078082f95e5csm8228526eje.204.2022.10.05.03.14.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Oct 2022 03:14:05 -0700 (PDT) In-Reply-To: <83ilkytyif.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 05 Oct 2022 12:23:20 +0300") 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:244503 Archived-At: 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. Or maybe we should add your fix, too?