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:49:05 +0200 Message-ID: References: <83edvnv965.fsf@gnu.org> <83pmf6u76i.fsf@gnu.org> <83mtaau43p.fsf@gnu.org> <83ilkytyif.fsf@gnu.org> <877d1ewnx0.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="30980"; 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 12:57:54 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 1og266-0007rt-7D for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 05 Oct 2022 12:57:54 +0200 Original-Received: from localhost ([::1]:49584 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1og265-00028Z-96 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 05 Oct 2022 06:57:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41554) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1og1yU-00067L-3z for bug-gnu-emacs@gnu.org; Wed, 05 Oct 2022 06:50:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56948) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1og1yT-0002gU-Qo for bug-gnu-emacs@gnu.org; Wed, 05 Oct 2022 06:50:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1og1yT-000637-N6 for bug-gnu-emacs@gnu.org; Wed, 05 Oct 2022 06:50:01 -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:50: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.166496695423177 (code B ref 58042); Wed, 05 Oct 2022 10:50:01 +0000 Original-Received: (at 58042) by debbugs.gnu.org; 5 Oct 2022 10:49:14 +0000 Original-Received: from localhost ([127.0.0.1]:56026 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1og1xh-00061l-Rb for submit@debbugs.gnu.org; Wed, 05 Oct 2022 06:49:14 -0400 Original-Received: from mail-ed1-f51.google.com ([209.85.208.51]:45577) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1og1xg-00061W-85 for 58042@debbugs.gnu.org; Wed, 05 Oct 2022 06:49:12 -0400 Original-Received: by mail-ed1-f51.google.com with SMTP id m3so22391369eda.12 for <58042@debbugs.gnu.org>; Wed, 05 Oct 2022 03:49:12 -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=/IBm9+NdGTqybfj6okkPtMdn8kmF/3UOdp5qHJbgDMA=; b=TK+0uZq5pQl9cQPnX1TfDOV8ICkHd8vElojgwPybwAIemQs+BlvGqothPzo0tbx9n7 y1n34BY0e42FLRiZZla8sbFgx5zX5uqf5v/Ts6wupXcxGde9+Gu6880Goi/NimXEj11Z rhZdqpHCXtpI6QFe4ZCq3pKvlQmarM1GcZ2FDiYQP+CG9Sn9bHKcCUTl/J+fQb7lke4Q Ed5/h54IvpaqQ+Q3W66In2Ynxt8lHj0PTocrcdSsD2pV+hw1rMgZTrVt6/qavpjut+/3 /gySUGSGVMD66cdmqh/dOvdypcTSOM0PvxwGrwnYx57z3svr2vhHzV57TrRh86gvRYKY Z9bw== 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=/IBm9+NdGTqybfj6okkPtMdn8kmF/3UOdp5qHJbgDMA=; b=FkfZKiTEvMQmSewvivBCv6GdM46dxyvmoekZKxGrTx/IltJreAPX+h3Nb9TlkWyUY6 Dh0XuntIxWLqJ0/w/Syvaw5ZJSfgcaHef/KqfToRTQrvzqn18aUZWxc1lpJIrXPj76ow NkyoiK984ukGul7lVy3nMx9ghfOjKolr5Pf94x0a3KqXbCpgWeDjg1R2oskgF4+6ZhHP gNnTCllPYGN2Cv9k57QaBmojDYEAEgJmveEMUSFamJOdTXQITkTyP6LFrRZIz0PllZJS nziLu5drTjDt3T+It25GnvZah+PY9xjDa2uDY3g7l9r+u877p00Ay9P/fxI0ngpEOoWd fDhg== X-Gm-Message-State: ACrzQf1BR0NZPe7RvYmqkh3Vz98Yv4vwgSOhNCgl061O7ulIPF+22R1N i2K1tNyqlJcTivWMtqua0sc= X-Google-Smtp-Source: AMsMyM6EYax2g3or8wd0pldZfZnZ1h99hCrii3365t0cTAtrYe1LEZsVrd6IpJLdXXwU+bIQUn2okQ== X-Received: by 2002:a50:bb68:0:b0:458:abbd:faf9 with SMTP id y95-20020a50bb68000000b00458abbdfaf9mr19111584ede.177.1664966946732; Wed, 05 Oct 2022 03:49: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 18-20020a170906211200b0077a8fa8ba55sm8461726ejt.210.2022.10.05.03.49.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Oct 2022 03:49:06 -0700 (PDT) In-Reply-To: <877d1ewnx0.fsf@yahoo.com> (Po Lu's message of "Wed, 05 Oct 2022 18:43:55 +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:244512 Archived-At: Po Lu writes: > Gerd M=C3=B6llmann writes: > >>> 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. > > Today, event handling code calls Lisp all the time (through safe_call > etc.) That happens in handle_one_xevent, ns_select, et cetera. > > It shouldn't affect GC at all because input is blocked for the entire > duration of each GC, except for when finalizers are run after unmarked > objects are sweeped. > > So AFAIU it has been safe ever since read_socket_hook stopped being > called from a signal handler. > >>> 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? > > It should be safe there since we use safe_call, as the only problem > these days is that it isn't safe to longjmp out of an NS event handler. Ok, I can't say much to this. But please look at the my latest post.