Discussion:
Text corruption
(too old to reply)
a***@gmail.com
2012-12-14 10:44:32 UTC
Permalink
First, I don't mean display corruption that goes away by refreshing the screen ---I mean actual text corruption in Emacs/AUCTeX documents.

I was using a snapshot Emacs [24.2.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.4.2) of 2012-10-21], compiled by me, when I saw how Emacs was inserting \$ in the middle of an environment when I did a change at the beginning of said environment. Unfortunately, this wasn't reproducible, as it didn't happen in other environment or when restarting Emacs.

Not being a programmer myself (compiling Emacs and AUCTeX is far from rocket-science), I decided Emacs snapshot was too advanced for me, so I compiled the stable version [24.2.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.4.2) of 2012-12-01] when the new AUCTeX came out (11.87).

I hadn't noticed any problem until yesterday, when a word had an «e» instead of an «a». I looked into a backup of the document, made just a few hours ago, and the word was right. I'm 100% sure it wasn't something I did by accident ---it was a word at the end of the document, in a section I hadn't touch at all.

And this isn't the first time I get an «a» changed by en «e», but this time I can say without doubt that it wasn't something I did.

Also, it reminds me of something that happened several times some years ago in the terminal (bash) when updating TeXLive with tlmgr ---suddenly it stopped with a message like «.../letex/... not found», I always checked the name of the directory, and always it was fine: /latex/. But, as I said, this was years ago ---I haven't have any problems with tlmgr in the terminal in a long time.

I'm using Ubuntu 12.04.1, kernel 3.2.0-34, with the standard Unity interface. I use UTF-8 for everything, and in every document I put

%%% Local Variables:
%%% coding: utf-8
%%% mode: latex
%%% TeX-master: "<master-doc-title>"
%%% End:

Also, C-h C shows

Coding system for saving this buffer:
U -- utf-8-unix (alias: mule-utf-8-unix)

Default coding system (for new files):
U -- utf-8-unix (alias: mule-utf-8-unix)

etc.


Could this be an Emacs/AUCTeX bug? A Gnome/Unity bug?

Of course I could work with TeXworks or TeXmaker, but the more I use Emacs/AUCTeX, the more attached to them I get ---I really, really wouldn't want to use anything else.

Desperate as I am, I would appreciate any help.


Thank you

Axel
Michael Heerdegen
2012-12-17 18:44:27 UTC
Permalink
Post by a***@gmail.com
First, I don't mean display corruption that goes away by refreshing
the screen ---I mean actual text corruption in Emacs/AUCTeX documents.
I was using a snapshot Emacs [24.2.50.1 (x86_64-unknown-linux-gnu,
GTK+ Version 3.4.2) of 2012-10-21], compiled by me, when I saw how
Emacs was inserting \$ in the middle of an environment when I did a
change at the beginning of said environment. Unfortunately, this
wasn't reproducible, as it didn't happen in other environment or when
restarting Emacs.
I have no idea what the problem is. Maybe using a dribble file (M-x
open-dribble-file) may help you to reconstruct what is going on.


Regards,

Michael.
Axel E. Retif
2012-12-18 18:45:39 UTC
Permalink
Michael,

On Dec 17, 12:44 pm, Michael Heerdegen <***@web.de>
wrote:

[...]
I have no idea what the problem is.  Maybe using a dribble file (M-x
open-dribble-file) may help you to reconstruct what is going on.
Thank you very much! I didn't know about dribble files. I've already
read something about the use of them, and I think that could be really
helpful.

Thanks again!


Best

Axel
Lowell Gilbert
2012-12-18 21:33:55 UTC
Permalink
Post by a***@gmail.com
I was using a snapshot Emacs [24.2.50.1 (x86_64-unknown-linux-gnu,
GTK+ Version 3.4.2) of 2012-10-21], compiled by me, when I saw how
Emacs was inserting \$ in the middle of an environment when I did a
change at the beginning of said environment. Unfortunately, this
wasn't reproducible, as it didn't happen in other environment or when
restarting Emacs.
I hadn't noticed any problem until yesterday, when a word had an «e»
instead of an «a». I looked into a backup of the document, made just a
few hours ago, and the word was right. I'm 100% sure it wasn't
something I did by accident ---it was a word at the end of the
document, in a section I hadn't touch at all.
Unfortunately, I would guess that these problems are not
related. [The reason I say "unfortunately" is that it means solving
one won't wolve the other.]

You might be right about the AUCTeX issue possibly being a
bleeding-edge issue. It may even be a new "feature" that will show
up in a release emacs eventually. Given that you couldn't reproduce
it, we can only guess, but given the amount of special treatment
that AUCTeX gives to '$' characters (even over and above what TeX
does), emacs was probably doing something it thought was useful.

The «a» to «e» issue smells like a memory problem. There's exactly
one bit difference between the two characters. If you have ECC
memory, ignore me; otherwise I'll be surprised if a memory test on
your computer doesn't turn up problems.

Also, you've had some excellent advice in another post. In addition
to dribble files, you might want to keep your files under version
control to better track (even unwanted) changes.

Good luck.
--
Lowell Gilbert, embedded/networking software engineer
http://be-well.ilk.org/~lowell/
Axel E. Retif
2012-12-19 06:26:52 UTC
Permalink
Lowell,

On Dec 18, 3:33 pm, Lowell Gilbert <***@be-well.ilk.org> wrote:

[...]
Post by Lowell Gilbert
You might be right about the AUCTeX issue possibly being a
bleeding-edge issue. It may even be a new "feature" that will show
up in a release emacs eventually. Given that you couldn't reproduce
it, we can only guess, but given the amount of special treatment
that AUCTeX gives to '$' characters (even over and above what TeX
does), emacs was probably doing something it thought was useful.
Unfortunately, I made a (memory) mistake in my report ---checking my
notes the thing was this:

When I inserted a `\' in the middle of a theorem environment
(corollary), it changed \end{corollary} to \end^?corollary}; undoing
the `\' (I use C-/ to undo) reverted the ^? to {. But then I deleted
(backspace) `?' `^' and `d', retyped `d' and `{' and the bug didn't
repeat ---that is, I could type the `\' without problem.

But I got a `$' replacing a space in an org-mode buffer. Which makes
me recall that in the first few weeks after installing Ubuntu 12.04, I
had a recurring and very annoying bug of `$'s getting inserted instead
of spaces in /var/lib/dpkg/available and /var/lib/dpkg/status, which
caused updates and installations to halt with errors, and I had to `
sudo gedit ' those files to retry the updates or installations. Most
of the times the offending `$'s *recurred in the same places*.

Fortunately, I found in the web the solution: sudo dpkg --clear-avail.
After that, I haven't had any more that problem. Before Ubuntu 12.04,
I hadn't had that problem at all.
Post by Lowell Gilbert
The «a» to «e» issue smells like a memory problem. There's exactly
one bit difference between the two characters. If you have ECC
memory, ignore me; otherwise I'll be surprised if a memory test on
your computer doesn't turn up problems.
David Kastrup, in the AUCTeX mailing list, is of the same opinion. I
ran memtester for about an hour, without any failure report; but
Kastrup says that's no guarantee, and that the real proof would be to
compile the Linux kernel.

I don't know if I have ECC RAM, but I don't think so, as my machine is
a low-end Gateway NV59 laptop.
Post by Lowell Gilbert
Also, you've had some excellent advice in another post. In addition
to dribble files, you might want to keep your files under version
control to better track (even unwanted) changes.
Yes, by all means, I will follow both advices.


Thank you very much!

Axel
Axel E. Retif
2013-01-20 04:01:02 UTC
Permalink
First, I want to thank Michael and Lowell for their help.

Apparently, it was indeed a memory (RAM) problem. I've got new memory
modules and I haven't seen any more corruption after almost two weeks.

Also, I installed Git and I'm keeping track of the changes in the
documents... just in case.


Thank you again

Axel

Loading...