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#58158: 29.0.50; [overlay] Interval tree iteration considered harmful Date: Thu, 29 Sep 2022 09:28:03 +0300 Message-ID: <83h70qhez0.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="24368"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58158@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 Thu Sep 29 08:44: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 1odnHp-000689-8c for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 29 Sep 2022 08:44:45 +0200 Original-Received: from localhost ([::1]:53026 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odnHo-0004NX-1E for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 29 Sep 2022 02:44:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51742) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odn2c-0004I4-Su for bug-gnu-emacs@gnu.org; Thu, 29 Sep 2022 02:29:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36648) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1odn2c-0005kG-Lb for bug-gnu-emacs@gnu.org; Thu, 29 Sep 2022 02:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1odn2c-0007Mh-GH for bug-gnu-emacs@gnu.org; Thu, 29 Sep 2022 02:29: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: Thu, 29 Sep 2022 06:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58158 X-GNU-PR-Package: emacs Original-Received: via spool by 58158-submit@debbugs.gnu.org id=B58158.166443289528251 (code B ref 58158); Thu, 29 Sep 2022 06:29:02 +0000 Original-Received: (at 58158) by debbugs.gnu.org; 29 Sep 2022 06:28:15 +0000 Original-Received: from localhost ([127.0.0.1]:35724 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odn1q-0007Lb-Sy for submit@debbugs.gnu.org; Thu, 29 Sep 2022 02:28:15 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:53404) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odn1p-0007LL-Bo for 58158@debbugs.gnu.org; Thu, 29 Sep 2022 02:28:13 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:52334) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odn1j-0005gE-5Y; Thu, 29 Sep 2022 02:28:07 -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=4Wa+bXDSEaSiGaW+oXSRekkO0o0o/rFF5zysqSABDcs=; b=QiinJBfIMw0tlcAKi+qY qFXoid4cOJ3lR5rYfJq/vrkEef2N2dfl4ZoifeYD0AYHys76pOUovQ7zSeMExwjlAGt67j7RXf6CW styh5ivhbb1PuMDGU6U8tsU0tNOgVFLkQWYb4w02IjvHFke8QYZ7ElMAl1TTVVF65kCO/Vhlxsf7M L8xSz6INY7Yk31R134kIT9GBUTf01MG3SbMkULUOnefBEG8sQQQ340jw4r9QlmbE6T0fbKacfWtaT E+iGLomtUet5fUjwdnl90XvxKn1pe3Bd7DAzfn5iw7a/yNT7qzF8YgC/pG3X9IoCTFM5M79ffA58F ILvpEMzGA6R1gQ==; Original-Received: from [87.69.77.57] (port=2640 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 1odn1i-0007bB-Ka; Thu, 29 Sep 2022 02:28:06 -0400 In-Reply-To: (message from Gerd =?UTF-8?Q?M=C3=B6llmann?= on Thu, 29 Sep 2022 07:29:25 +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:243873 Archived-At: > From: Gerd Möllmann > Date: Thu, 29 Sep 2022 07:29:25 +0200 > > In its current form, interval tree iteration works like this: > > 1. Call begin_iteration(T) to iterate over tree T > 2. do stuff > 3. Call end_iteration(T) > > with the following rules: > > - Begin_iteration and end_iteration must be paired. > > - There can be only one iteration per tree at a time. Nested iteration > over the same tree is not supported (abort). > > - No GC may happen in step 2. This is because mark_buffer iterates over > buffer overlays. > > I think this is an exceedingly dangerous design. Why, because of "no GC" requirement? We could ensure that by calling inhibit_garbage_collection (if the code doesn't do that already). That is not very elegant, and might even cause memory pressure in some (hopefully rare) situations, but we do have some users of this in the sources. What higher-level operations require "interval tree iteration" that you describe? Which primitives end up doing such iterations?