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:24:12 +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; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39675"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Po Lu , 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:26:36 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 1og1bo-000AD4-B6 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 05 Oct 2022 12:26:36 +0200 Original-Received: from localhost ([::1]:55302 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1og1bl-0001f1-8M for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 05 Oct 2022 06:26:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36386) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1og1aJ-0001eT-22 for bug-gnu-emacs@gnu.org; Wed, 05 Oct 2022 06:25:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56898) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1og1aI-0004Bv-7G for bug-gnu-emacs@gnu.org; Wed, 05 Oct 2022 06:25:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1og1aI-00057z-0N for bug-gnu-emacs@gnu.org; Wed, 05 Oct 2022 06:25: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:25:01 +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.166496546119643 (code B ref 58042); Wed, 05 Oct 2022 10:25:01 +0000 Original-Received: (at 58042) by debbugs.gnu.org; 5 Oct 2022 10:24:21 +0000 Original-Received: from localhost ([127.0.0.1]:55976 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1og1Zd-00056k-Fv for submit@debbugs.gnu.org; Wed, 05 Oct 2022 06:24:21 -0400 Original-Received: from mail-ed1-f46.google.com ([209.85.208.46]:36764) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1og1Zb-00056W-Vm for 58042@debbugs.gnu.org; Wed, 05 Oct 2022 06:24:21 -0400 Original-Received: by mail-ed1-f46.google.com with SMTP id e18so22323820edj.3 for <58042@debbugs.gnu.org>; Wed, 05 Oct 2022 03:24:19 -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=iHFXVet22DDqqk5ctk/TWMOIcLdLPPpRRYWdwOKNENo=; b=YtNQKRJdYVDSOuuzK6wvSld6/x+P9yaHfY8mB/LEjGQkrU2Wv+a/nBoC+Mn4tXKwJM DG/gi6IXlg0ckTC0zoCF4/zYqKt5uLNmqAWkFx8vfJkWEy4FFf7w9MPhW5CNNIt+grpd KAcLhmCiWcJmHUan2LtEa7cIie3pOVnTg1UPBGMakXn+m7j/TenP+OH8XE9HRsbX+1xQ mAQFDKjptrC4wsUAWUuzflbGp/0SWIWlfk1S/vQGWqoI1tSntAOJiDnU7jKhn7IEgb4S gp1XmxEr3XHC3RIktQITtz2lK8L79eMFupbACPf8k2F6rxzlDue+2Vh/dvjL+NaTGk+Y jUqA== 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=iHFXVet22DDqqk5ctk/TWMOIcLdLPPpRRYWdwOKNENo=; b=FvvTviu6/XCwh5LdnRZx9d2gHwIZV6SlnAe4/BlGjK+i8h1JnNEml2xV3IGctoq+ym dWbO5GDfJ6O/Q2HOfBYQmmS9gYS2RnoCURt+5kdt6XhV+jGe4/LIIVXFPRNnKMdXKbEM Q12AykDmH6qmPQ1H7XGOLSneNzeXiK2CeS8+Z/QfBz5g2ZVxBdQv7Peg/nxr+EQ3tcfI BVFg1qgv7LsYISM0f8wIU2AdfLBuLZ+jcMJ5bOljp0KmmTYGnzyuZN9bwT8cPDm+uHh3 JIx3/euYSjPwzP5ZFwYLtB92mHKVIQH8y2SrBIVBsmpXuYtY9lNjjX3BrfWijhd18ZaQ yxBw== X-Gm-Message-State: ACrzQf1mvcPY5CpsJApAvz1SphlT9QQPRDZPNxMAfzdIC/JeMETnoFaY 3pKIwTULuihkYA1u6FIem/c= X-Google-Smtp-Source: AMsMyM7v9L4eu68e4J5ZPJO76tvbf7JmWh8dksteVy9+VZKsVBHScKJfCBH8Rl6NNiYgsNW4wJ7ZKw== X-Received: by 2002:aa7:c60a:0:b0:458:d707:117 with SMTP id h10-20020aa7c60a000000b00458d7070117mr16300411edq.258.1664965454143; Wed, 05 Oct 2022 03:24:14 -0700 (PDT) Original-Received: from Mini.fritz.box (pd9e36cc6.dip0.t-ipconnect.de. [217.227.108.198]) by smtp.gmail.com with ESMTPSA id r2-20020a17090609c200b00782ee6b34f2sm8399559eje.183.2022.10.05.03.24.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Oct 2022 03:24:13 -0700 (PDT) In-Reply-To: ("Gerd =?UTF-8?Q?M=C3=B6llmann?="'s message of "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:244504 Archived-At: Gerd M=C3=B6llmann writes: > Eli Zaretskii writes: > >> So I guess we should do this dance around calls to maybe_quit in >> regex-emacs.c: >> >> specpdl_ref gc_count =3D 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? And a similar question to Po Lu because of f81065a91be5a54b78e202df6918aff443588ae1 Author: Po Lu AuthorDate: Mon May 30 16:03:11 2022 +0800 Commit: Po Lu CommitDate: Mon May 30 16:03:11 2022 +0800 which added a call to redisplay to - (NSDragOperation) draggingUpdated: (id ) sender. Is that safe here?