I use Ubuntu 15.04.
I can reproduce this both in Emacs 24.4
which is installed by "apt-get install emacs24"
and in Emacs 24.5 which I built from the source.
The corrupted buffer looks like this.
https://gist.github.com/stakemori/8c3e1f6e3f73f5db3a7a
The output of M-x report-emacs-bug in Emacs 24.4 is as follows:
From: sho <sho@K430-Ubuntu.i-did-not-set--mail-host-address--so-tickle-me>
Subject: 24.4; revert-buffer
--text follows this line--
In GNU Emacs 24.4.1 (x86_64-pc-linux-gnu, GTK+ Version 3.14.9)
of 2015-03-21 on kissel, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.11701000
System Description: Ubuntu 15.04
Configured using:
`configure --build x86_64-linux-gnu --prefix=/usr
--sharedstatedir=/var/lib --libexecdir=/usr/lib
--localstatedir=/var/lib --infodir=/usr/share/info
--mandir=/usr/share/man --with-pop=yes
--enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.4/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.4/site-lisp:/usr/share/emacs/site-lisp
--build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib
--libexecdir=/usr/lib --localstatedir=/var/lib
--infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes
--enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.4/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.4/site-lisp:/usr/share/emacs/site-lisp
--with-x=yes --with-x-toolkit=gtk3 --with-toolkit-scroll-bars
'CFLAGS=-g -O2 -fstack-protector-strong -Wformat
-Werror=format-security -Wall' CPPFLAGS=-D_FORTIFY_SOURCE=2
'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro''
Important settings:
value of $LANG: ja_JP.UTF-8
value of $XMODIFIERS: @im=fcitx
locale-coding-system: utf-8-unix
Major mode: Python
Minor modes in effect:
tooltip-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
line-number-mode: t
transient-mark-mode: t
Recent input:
C-y M-x e v a l 0 <backspace> - b u <tab> <return>
M-x r e p o r t - e m a c s <tab> <return>
Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Mark set
Can't guess python-indent-offset, using defaults: 4 [2 times]
or: Assertion failed: (string= (buffer-string) file-content2)
Load-path shadows:
None found.
Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
help-fns mail-prsvr mail-utils python easymenu json comint ring
ansi-color cl-macs gv cl-loaddefs cl-lib time-date japan-util tooltip
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment
lisp-mode prog-mode register page menu-bar rfn-eshadow timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese hebrew greek romanian slovak czech european ethiopic
indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple
abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
dbusbind gfilenotify dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)
Memory information:
((conses 16 82225 4373)
(symbols 48 18572 0)
(miscs 40 40 99)
(strings 32 12434 4244)
(string-bytes 1 367042)
(vectors 16 11207)
(vector-slots 8 474430 27975)
(floats 8 64 67)
(intervals 56 262 1)
(buffers 960 13)
(heap 1024 25157 1072))
> Date: Thu, 10 Sep 2015 22:33:08 +0900
> From: Sho Takemori <stakemorii@gmail.com>
>
> Here is a reproducible recipe.
>
> https://gist.github.com/stakemori/ccf0e4cfae2fcfafbf0a
>
> I thought this is a bug of emacs-jedi
> (https://github.com/tkf/emacs-jedi/issues/234).
> But I can reproduce it with "emacs -Q". (I use Emacs 24.5).
>
> If I replace (buffer-string) in the body of my/add-to-after-change-functions
> by (buffer-substring-no-properties (point-min) (point-max)),
> then the same error occurs.
>
> I think this has nothing to do with python-mode. It also occurs in text-mode.
FWIW, I don't see any corruption when I load this file.