From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#40661: Crash in regex search during redisplay Date: Fri, 17 Apr 2020 18:50:27 +0300 Message-ID: <83tv1iaz7g.fsf@gnu.org> References: <83ftd3e92z.fsf@gnu.org> <83d087e6gj.fsf@gnu.org> <421071D0-6D75-4442-AC4B-D091B573B49C@dancol.org> <838siucq7b.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="15713"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rcopley@gmail.com, 40661@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Apr 17 17:51:16 2020 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 1jPTGs-0003w4-J1 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 17 Apr 2020 17:51:14 +0200 Original-Received: from localhost ([::1]:48814 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jPTGr-0001QI-J5 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 17 Apr 2020 11:51:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55697) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jPTGi-0001Nh-Tx for bug-gnu-emacs@gnu.org; Fri, 17 Apr 2020 11:51:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jPTGh-0001Pj-Sr for bug-gnu-emacs@gnu.org; Fri, 17 Apr 2020 11:51:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58215) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jPTGh-0001PZ-Pg for bug-gnu-emacs@gnu.org; Fri, 17 Apr 2020 11:51:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jPTGh-0001S5-O3 for bug-gnu-emacs@gnu.org; Fri, 17 Apr 2020 11:51:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 17 Apr 2020 15:51:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40661 X-GNU-PR-Package: emacs Original-Received: via spool by 40661-submit@debbugs.gnu.org id=B40661.15871386465522 (code B ref 40661); Fri, 17 Apr 2020 15:51:03 +0000 Original-Received: (at 40661) by debbugs.gnu.org; 17 Apr 2020 15:50:46 +0000 Original-Received: from localhost ([127.0.0.1]:41523 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jPTGP-0001Qz-SM for submit@debbugs.gnu.org; Fri, 17 Apr 2020 11:50:46 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:40496) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jPTGO-0001Qo-PA for 40661@debbugs.gnu.org; Fri, 17 Apr 2020 11:50:45 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:38924) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jPTGJ-0001CN-H8; Fri, 17 Apr 2020 11:50:39 -0400 Original-Received: from [176.228.60.248] (port=1121 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jPTGI-0004Hu-Gq; Fri, 17 Apr 2020 11:50:39 -0400 In-Reply-To: (message from Stefan Monnier on Fri, 17 Apr 2020 11:28:49 -0400) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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:178525 Archived-At: > From: Stefan Monnier > Cc: Richard Copley , dancol@dancol.org, > 40661@debbugs.gnu.org > Date: Fri, 17 Apr 2020 11:28:49 -0400 > > > Obviously, we cannot allow GC to run while regex routines do their > > work, because they are passed C pointers to buffer text. The question > > is, where to disable GC? We could do it inside > > update_syntax_table_forward, but UPDATE_SYNTAX_TABLE_FORWARD is called > > from many places that evidently have no problems with GC. So my > > suggestion would be to disable GC inside re_match_2_internal instead. > > > > Comments? > > Looks fine to me. So you prefer disabling GC to setting the inhibit_shrinking flag? I tend to agree with Daniel here, FWIW. > I think a better fix is to move the execution of compact_buffer: > there's no reason it has to be done during GC, we just need to do it > "every once in a while" and the GC was a convenient point for that. > But we could avoid several such problems if we were to run such > background tasks elsewhere. It could still be linked to GC, e.g. we > could start a timer during the GC so its run at the next > opportunity. That's a project for another pandemic ;-) I want a simple enough solution for now that we could install on the release branch.