bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#40661: Crash in regex search during redisplay


From: Daniel Colascione
Subject: bug#40661: Crash in regex search during redisplay
Date: Fri, 17 Apr 2020 07:01:04 -0700
User-agent: AquaMail/1.23.0-1556 (build: 102300002)

On April 17, 2020 6:56:00 AM Eli Zaretskii <eliz@gnu.org> wrote:

Date: Fri, 17 Apr 2020 14:22:00 +0300
From: Eli Zaretskii <eliz@gnu.org>
Cc: 40661@debbugs.gnu.org

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.

Alternatively, we could set the buffer's inhibit_shrinking flag while
in re_match_2_internal.  Although that flag was introduced for a
different purpose: for when we have stuff inside the gap that we don't
want to lose.  The name of the flag notwithstanding, I'm not sure we
want to conflate these two purposes.  But maybe it's better than
preventing the GC entirely.

I think I'd prefer this approach to inhibiting GC entirely. I can imagine code allocating enough garbage that we really want to get rid of it, and inhibiting shrinking is more conservative.








reply via email to

[Prev in Thread] Current Thread [Next in Thread]