emacs-devel
[Top][All Lists]
Advanced

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

Re: address@hidden (Pavel Janík)] Re: crash in emacs-21.1


From: Gerd Moellmann
Subject: Re: address@hidden (Pavel Janík)] Re: crash in emacs-21.1
Date: 30 Oct 2001 17:33:37 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1.50

address@hidden (Gerd Moellmann) writes:

> Kenichi Handa <address@hidden> writes:
> 
> > Thank you!  With this, I found a bug in read1 (in lread.c).
> > It was me who introduced this bug.  :-(
> 
> The only way not to make mistakes is to do nothing at all :-).
> 
> [...]
> 
> > Is this information enough?  Gerd, could you install a
> > proper fix?
> > 
> I think this copes with the buffer reallocation, but the reallocation
> isn't triggered with the elc files, and the result is identical to
> what it was before (same backtrace etc.).  Could you please check
> if I've made a stupid mistake here?

I guess I have it.  It just occurred to me that for the worst case of
having to add LEADING_CODE_8_BIT_CONTROL for every byte in its source
string, str_as_multibyte needs a buffer that's somwhere twice as large
as the input string.  The function c-guess-basic-syntax has a large
byte-code string of ~24K and that fits this observation nicely.

When I make read_buffer at least 2 * nbytes large, things go well.
I'll install that; issue settled.

It might be better to rewrite str_as_multibyte and maybe other similar
functions in the future, or let them at least check for buffer
overruns.



reply via email to

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