From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#62216: Odd file corruption in clojure mode and emacs 30 HEAD Date: Thu, 31 Aug 2023 18:54:23 +0300 Message-ID: <83o7incimo.fsf@gnu.org> References: <83jztpwx92.fsf@gnu.org> <875y58bv5w.fsf@yahoo.com> <83a5u8hh8k.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40453"; mail-complaints-to="usenet@ciao.gmane.io" Cc: gerd.moellmann@gmail.com, luangruo@yahoo.com, eggert@cs.ucla.edu, 62216@debbugs.gnu.org To: Jonathon McKitrick Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 31 17:55:05 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qbk0e-000ACM-SK for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 31 Aug 2023 17:55:05 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qbk0W-0008H5-Mg; Thu, 31 Aug 2023 11:54:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qbk0U-0008GT-Bb for bug-gnu-emacs@gnu.org; Thu, 31 Aug 2023 11:54:54 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qbk0U-00075R-1W for bug-gnu-emacs@gnu.org; Thu, 31 Aug 2023 11:54:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qbk0c-0001fj-7a for bug-gnu-emacs@gnu.org; Thu, 31 Aug 2023 11:55:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 31 Aug 2023 15:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62216 X-GNU-PR-Package: emacs Original-Received: via spool by 62216-submit@debbugs.gnu.org id=B62216.16934973006403 (code B ref 62216); Thu, 31 Aug 2023 15:55:02 +0000 Original-Received: (at 62216) by debbugs.gnu.org; 31 Aug 2023 15:55:00 +0000 Original-Received: from localhost ([127.0.0.1]:56839 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbk0a-0001fC-3F for submit@debbugs.gnu.org; Thu, 31 Aug 2023 11:55:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50906) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbk0X-0001f0-Ng for 62216@debbugs.gnu.org; Thu, 31 Aug 2023 11:54:59 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qbk0J-00074R-3O; Thu, 31 Aug 2023 11:54:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=bpNXb78P4RCcxAfv1MRtLjIaLKaEiinBd3hYZBO4rh4=; b=VKeH1+6jsJHx7SO0KxUG 8nHm8tkpf7xg30UxeahdeyqP/oXYpl+BjsNyBIn8kViGUqS6MoMMAB/1lI0ZQwuPJZe6XQach7NGP IOrSEktGsVUkm32OJ0WFEyNPvryLPOCySTQJT5o4UhWNxqdldZJY4hzvcxTboRryCrSPWZ/kCjr1j bipBX88hbxCi9we3juyODC43sfeVgNLZHfnbyeH4dy+rtm61hw5My5dHCqWiR6mLZ6a17XskSG2oc EyY6u0tdGc8mh996+J6vabY83Pgl8IWeBIxOScMoEH4h00rg+sHMApS6foYP96eZVXC76xIxwf+SX W8L9ispg/8L/IQ==; In-Reply-To: (message from Jonathon McKitrick on Thu, 31 Aug 2023 14:46:01 +0000) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:268829 Archived-At: > Date: Thu, 31 Aug 2023 14:46:01 +0000 > From: Jonathon McKitrick > Cc: Eli Zaretskii , luangruo@yahoo.com, eggert@cs.ucla.edu, > 62216@debbugs.gnu.org > > On Wed, Aug 30, 2023 at 02:07:35PM +0200, Gerd Mllmann wrote: > : On 30.08.23 14:00, Eli Zaretskii wrote: > : > > From: Gerd Möllmann > : > > Cc: Jonathon McKitrick , Eli Zaretskii , Paul > : > > Eggert , 62216@debbugs.gnu.org > : > > Date: Wed, 30 Aug 2023 10:59:08 +0200 > : > > > : > > Po Lu writes: > : > > > : > > > Jonathon McKitrick 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. > > I'm willing to log some meaningful stats if that would help. Last time I logged these values, I was inundated with info, but if I could > narrow it down to the most useful cases, I could log the relevant bits and report back. you mean, the fix I installed on master yesterday didn't fix your problem? It did fix Gerd's problem.