From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#23397: 25.0.92; assertion failure auto-reverting a file being overwritten Date: Sat, 05 Sep 2020 16:03:54 +0200 Message-ID: <87k0x848xh.fsf@gnus.org> References: <6epot9crti.fsf@just-testing.permabit.com> <83vb2wl83m.fsf@gnu.org> <6efuu0chsv.fsf@just-testing.permabit.com> <87zhzutngf.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28637"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Ken Raeburn , 23397@debbugs.gnu.org To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 05 16:05:12 2020 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 1kEYoY-0007Ju-Jh for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 05 Sep 2020 16:05:10 +0200 Original-Received: from localhost ([::1]:45224 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kEYoX-0003Ds-JV for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 05 Sep 2020 10:05:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58390) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kEYoQ-0003DT-Lu for bug-gnu-emacs@gnu.org; Sat, 05 Sep 2020 10:05:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60402) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kEYoQ-0001b9-CL for bug-gnu-emacs@gnu.org; Sat, 05 Sep 2020 10:05:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kEYoQ-0004N0-8F for bug-gnu-emacs@gnu.org; Sat, 05 Sep 2020 10:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 05 Sep 2020 14:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23397 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 23397-submit@debbugs.gnu.org id=B23397.159931464516727 (code B ref 23397); Sat, 05 Sep 2020 14:05:02 +0000 Original-Received: (at 23397) by debbugs.gnu.org; 5 Sep 2020 14:04:05 +0000 Original-Received: from localhost ([127.0.0.1]:43715 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kEYnV-0004Lj-D8 for submit@debbugs.gnu.org; Sat, 05 Sep 2020 10:04:05 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:34164) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kEYnU-0004LD-6Q for 23397@debbugs.gnu.org; Sat, 05 Sep 2020 10:04:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=SrYK3FfoFuJyz4/CMR5NuqMchtMULJ5o/cc9Brcs6pY=; b=YK1zgcc+mKdD+ZFP265MAJYD0g uzUUfQp5QQ9Bc/KII2SHRtfI/934YXhNHTZ7QRg5LOhUs6pVFmWCVBKJFZbiQhRxB5hNRTmaSBjp0 ZsZIIhDspvKQ94qAyFrZdJaAd0XY8ruF363KtOVdmRBSU6TaUBj75xRym7vH/Cuprjts=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kEYnL-0004VR-Hy; Sat, 05 Sep 2020 16:03:58 +0200 X-Now-Playing: RATN's _J_: "=?UTF-8?Q?=E3=82=8F=E3=81=9F=E3=81=97=E3=81=AB=E3=82=8F=E3=81=8B=E3=82=8B=E3=81=93=E3=81=A8?=" In-Reply-To: <87zhzutngf.fsf@gmail.com> (Noam Postavsky's message of "Sat, 16 Jun 2018 17:45:36 -0400") 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" Xref: news.gmane.io gmane.emacs.bugs:187243 Archived-At: Noam Postavsky writes: > This seems to fix the scenario you gave in #17. I don't quite > understand what the overlap expression is trying to compute though. [...] > + off_t file_end_pos = st.st_size; [etc] Eli Zaretskii writes: >> I don't quite understand what the overlap expression is trying to >> compute though. > > It prevents us from re-using the same portion of buffer text for > matching both at start and at end of the file. This could happen, > e.g., with buffers whose contents is the same character, and a file > whose contents is mostly the same, but larger, and with a few > different characters in the middle. Then the "same_at_end" loop could > inadvertently match a part of the buffer that was already matched by > the "same_at_start" loop. > > The overlap expression computes the portion of the buffer that was > matched by both "same_at_start" and "same_at_end" loops. This was two years ago, but the patch doesn't seem to be applied? It was a rather obscure timing-related (but serious) bug. Noam, did Eli's explanation help? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no