From: Eli Zaretskii <eliz@gnu.org>
To: Ken Raeburn <raeburn@permabit.com>
Cc: 23397@debbugs.gnu.org
Subject: bug#23397: 25.0.92; assertion failure auto-reverting a file being overwritten
Date: Mon, 02 May 2016 19:47:57 +0300 [thread overview]
Message-ID: <83vb2wl83m.fsf@gnu.org> (raw)
In-Reply-To: <6epot9crti.fsf@just-testing.permabit.com> (message from Ken Raeburn on Thu, 28 Apr 2016 18:05:29 -0400)
> From: Ken Raeburn <raeburn@permabit.com>
> Date: Thu, 28 Apr 2016 18:05:29 -0400
>
> I'm running the emacs-25 branch as of revision a1f221b, but with commit
> d82f24b reverted (attempting to debug #23013), and built with
> MARKER_DEBUG enabled (as Eli pointed out, probably not relevant to
> #23013) along with assertions.
>
> I was using "git" to update a source tree while about twenty files from
> it were loaded into Emacs buffers. Auto-revert was triggered; during the
> process, Finsert_file_contents was loading a Perl file when it invoked
> BYTE_TO_CHAR:
>
> /* Don't try to reuse the same piece of text twice. */
> overlap = (same_at_start - BEGV_BYTE
> - (same_at_end
> + (! NILP (end) ? end_offset : st.st_size) - ZV_BYTE));
> if (overlap > 0)
> same_at_end += overlap;
> same_at_end_charpos = BYTE_TO_CHAR (same_at_end);
>
> ...with same_at_end well out of range (Z_BYTE=12451, same_at_end=24673).
> The reverting appears to have happened while the file was in the process
> of being updated, as st.st_size is zero.
So you are saying that the file's contents was updated between the
time we called 'fstat' at the beginning of the function and the time
we used st.st_size in the above snippet?
If so, perhaps we should call 'fstat' again each time we want to use
st.st_size, and retry from the beginning if we find a mismatch?
> I haven't managed to reproduce this so far.
You could artificially modify the value of st.st_size in the debugger,
and then see what happens.
Thanks.
next prev parent reply other threads:[~2016-05-02 16:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-28 22:05 bug#23397: 25.0.92; assertion failure auto-reverting a file being overwritten Ken Raeburn
2016-05-02 16:47 ` Eli Zaretskii [this message]
2016-05-02 20:43 ` Ken Raeburn
2016-05-03 15:15 ` Eli Zaretskii
2016-05-03 21:04 ` Ken Raeburn
2018-06-16 21:45 ` Noam Postavsky
2018-06-17 5:36 ` Eli Zaretskii
2020-09-05 14:03 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83vb2wl83m.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=23397@debbugs.gnu.org \
--cc=raeburn@permabit.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.