GNU bug report logs - #62216
Odd file corruption in clojure mode and emacs 30 HEAD

Previous Next

Package: emacs;

Reported by: Jonathon McKitrick <jcm <at> SDF.ORG>

Date: Thu, 16 Mar 2023 04:27:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Gerd Möllmann <gerd.moellmann <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: luangruo <at> yahoo.com, jcm <at> SDF.ORG, eggert <at> cs.ucla.edu, 62216 <at> debbugs.gnu.org
Subject: bug#62216: Odd file corruption in clojure mode and emacs 30 HEAD
Date: Wed, 30 Aug 2023 14:07:35 +0200
On 30.08.23 14:00, Eli Zaretskii wrote:
>> From: Gerd Möllmann <gerd.moellmann <at> gmail.com>
>> Cc: Jonathon McKitrick <jcm <at> SDF.ORG>,  Eli Zaretskii <eliz <at> gnu.org>,  Paul
>>   Eggert <eggert <at> cs.ucla.edu>,  62216 <at> debbugs.gnu.org
>> Date: Wed, 30 Aug 2023 10:59:08 +0200
>>
>> Po Lu <luangruo <at> yahoo.com> writes:
>>
>>> Jonathon McKitrick <jcm <at> SDF.ORG> writes:
>>>
>>>> What's the best mechanism to log these values in emacs?
>>>
>>> In this case, printf.
>>
>> When I add this assumption:
>>
>> modified   src/fileio.c
>> @@ -4805,8 +4805,11 @@ DEFUN ("insert-file-contents", Finsert_file_contents, Sinsert_file_contents,
>>   
>>   	/* 'try' is reserved in some compilers (Microsoft C).  */
>>   	ptrdiff_t trytry = min (gap_size, READ_BUF_SIZE);
>> +	ptrdiff_t trytry_old = min (total - inserted, READ_BUF_SIZE);
>>   	if (!NILP (end))
>>   	  trytry = min (trytry, total - inserted);
>> +	if (trytry != trytry_old)
>> +	  abort ();
>>   
>>   	if (!seekable && NILP (end))
>>   	  {
>>
>> and make bootstrap, temacs aborts.
>>
>> Can someone tell if this assumption should hold?
> 
> You expect READ_BUF_SIZE to never be greater than gap_size?

Don't know.  This is how I understood Jonathan's nail saying works with 
this old code, doesn't work with this new code.




This bug report was last modified 1 year and 293 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.