Subject: bug#22739: 25.0.50; Hangs on revertig buffer

From: Óscar Fuentes <[email-masked]>
Date: Sun, 06 Mar 2016 02:28:29 +0100

It happened again, but this time the file was corrupt and contained 230
KB of garbage (all nulls except for the last few characters, which are
ASCII.)

The infloop was on bidi functions and it was necessary to SIGKILL the
process. SIGINT didn't work.

It is repeatable with emacs -Q.

In GNU/Linux you can create a file full of nulls with

$ truncate -s 100000 kk
$ emacs -Q kk

It seems that it is some type of quadratic (or worse) time complexity
with long lines, because with smaller sizes (100, 1000, ...) Emacs comes
back.

So it is the old problem with very long lines. We should try to bail out
when processing this type of lines takes too much time. From certain
point, simply refusing to display the line (or the entire file) is
preferable to freezing Emacs.