emacs-devel
[Top][All Lists]
Advanced

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

Re: End of file while generating loaddefs.el


From: Eli Zaretskii
Subject: Re: End of file while generating loaddefs.el
Date: Sat, 21 Nov 2015 13:57:16 +0200

> Date: Sat, 21 Nov 2015 12:23:52 +0100
> From: martin rudalics <address@hidden>
> CC: address@hidden
> 
> Do you still have the snippet that caused problems in your case?

Yes, I do.

> How could null bytes possibly get into that file

I don't know.  Some bug, obviously, but that's all I can say.  I also
know it happened 7 days ago, because that's the time stamp of the
file.

> and why did they cause an end of file exception during parsing?

That's easy.  This is the guts of autoload-read-section-header:

      (while (looking-at generate-autoload-section-continuation)
        (forward-line 1))
      (setq string (buffer-substring beginning (point)))
      (with-current-buffer (get-buffer-create " *autoload*")
        (erase-buffer)
        (insert string)
        (goto-char (point-min))
        (while (search-forward generate-autoload-section-continuation nil t)
          (replace-match " "))
        (goto-char (point-min))
        (read (current-buffer))))))

The null bytes cause the first while loop to stop prematurely, and
then buffer-substring copies only part of a sexp into a temporary
buffer.  We then try to read an incomplete sexp from that buffer and
hit the end of the buffer before the sexp ends.

> And why does no one else have such problems?

I don't know, because I don't know what bug caused those null bytes to
appear in the first place.



reply via email to

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