Bug 79189 - All opened files empty (correct size, but nulled) after crash!
Summary: All opened files empty (correct size, but nulled) after crash!
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.0.1   Edit
Hardware: PC Windows XP
: P3 blocker (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2004-11-22 10:23 EST by Vedran Lerenc CLA
Modified: 2007-06-22 10:04 EDT (History)
4 users (show)

See Also:


Attachments
Log File (complete since installation on 11/18) (17.28 KB, text/plain)
2004-11-24 03:40 EST, Vedran Lerenc CLA
no flags Details
Installed plug-ins text list. (2.54 KB, text/plain)
2004-11-24 03:51 EST, Vedran Lerenc CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vedran Lerenc CLA 2004-11-22 10:23:10 EST
Hi,

I am working with Eclipse since version 2.0 - a couple of days ago I installed 
version 3.0.1 on my computer and today I created a new project on old sources, 
worked with it for the whole day (without closing Eclipse) and had to turn off 
the computer because of a total hang-up. After restart all files which have 
been open in the editor when I turned off the computer were empty! The file 
size was correct, but in a hex editor I saw that all bytes were 0x00!

I grepped the workspace for them and found the Java files in the metadata 
folder - I succeeded in restoring them from local history, but all other files 
were destroyed! I could find no copy of them anywhere!

To me this looks like Eclipse destroyed the files on restart because of a 
problem with the state of the editor buffers pointing to newly allocated 
memory, which Eclipse somehow then wrote to disk, although they were empty.

I hope you can find the bug - until then I have no other choice, but to work 
with my old Eclipse installation again.

Best Regards,

Vedran Lerenc
Comment 1 John Arthorne CLA 2004-11-22 10:56:34 EST
If you still have it, please attach your log file (workspace/.metadata/.log).
This might contain information from around the time of the crash that provides
more clues.
Comment 2 Dani Megert CLA 2004-11-22 11:02:23 EST
>all files which have been open in the editor
Which editor?
Any other plug-ins installed?

See:
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-text-home/development/bug-incomplete.htm
Comment 3 Vedran Lerenc CLA 2004-11-24 03:40:43 EST
Created attachment 16092 [details]
Log File (complete since installation on 11/18)

Attached as requested by john_arthorne@ca.ibm.com.
Comment 4 Vedran Lerenc CLA 2004-11-24 03:51:37 EST
Created attachment 16093 [details]
Installed plug-ins text list.

No other than the default plug-ins were installed and I have provided a list of
them with this attachment.

With "open editors" I meant text editors for my Velocity templates I had
open/lost during the crash (correct size, nulled content) and the Java editors
I had open/lost during the crash (correct size, nulled content), but recovered
from the local history.
Comment 5 Dani Megert CLA 2004-11-24 05:03:33 EST
Can you provide some more info about the .log. I see 4 sessions and to me it
looks like the second one is the one where you saw the problem, right?

SESSION Nov 18, 2004 16:18:57.281
  terminated due to out of memory exception (which is probably also caused
  the hangup of your computer). BTW: how much memory do you give 
  Eclipse?

SESSION Nov 18, 2004 16:30:01.156
  this one is probably after restarting your workspace. It shows a Java 
  Builder error - not sure whether the builder could be the cause for losing 
  your files. How was your project and Java build path setup?

SESSION Nov 19, 2004 09:54:11.468
  which is in the morning of the next day and shows that it could not find
  the .project information any more. Interestingly it seems like the last of
  those log entries wrote a bunch of 0x00

SESSION Nov 22, 2004 15:31:34.62
  which is 3 days later - there's some errors in
  parsing XML files while restoring the workbench. This doesn't seem the
  cause for the missing files.

Moving to Java Core for comment.
Comment 6 Kai-Uwe Maetzel CLA 2004-11-24 05:42:29 EST
Vedran,

Just to emphasize Dani's questions: When did you restart? Directly after the 
crash? I.e. did you turn off the computer Nov 22?

The interesting part in the log file is that it contains a rather long block 
of null bytes. When you restarted your computer did a recovery/disk checking 
program run?
Comment 7 Vedran Lerenc CLA 2004-11-24 07:11:39 EST
> Can you provide some more info about the .log. I see 4 sessions and to me
> it looks like the second one is the one where you saw the problem, right?

Sorry, no, everything happened this Monday afternoon, i.e. on 11/22 at about 3 
PM. I guess you can ignore all prior messages.

Until now I have not noticed the null content in the log, but these nulls 
could represent the Eclipse start which caused my files to get erased - I 
would guess that the last logged session was a follow-up restart/my last 
restart of Eclipse in which I reconstructed the Java files from local history.

My guess for the order of events:

Monday afternoon: Computer had to be turned off, because of a hang-up of the 
Windows XP Explorer - after I killed all Explorers (a move operation of a 
large folder triggered from the Explorer caused my Explorer to no longer 
respond) my computer refused to show me the Task Manager again - no reaction 
on keyboard input. Without task manager I couldn't restart the Explorer and 
had to turn off the machine.

Monday afternoon, maybe represented by the nulled entries in the log: I 
restarted the machine/Eclipse and was irritated to see no projects at all in 
the Package Explorer. I assumed that I haven't restarted Eclipse since I 
created the projects in my workspace and that therefore Eclipse has forgotten 
about them, but I wasn't sure. I re-created them and was again irritated to 
see empty editor panes when opening them. Then I began to understand, that 
only those sources were lost, that were open during the hang-up. I closed 
Eclipse, backed up the workspace and took a closer look. I saw that my files 
were still there, had the correct size, but were completely nulled. I found my 
Java sources in the metadata folder grepping for their content - content of my 
velocity template files was lost; no files found. I thought, that I can 
restore the content of my Java files manually, but hoped that Eclipse can pick 
the latest version easier than I via the local history and accepted the loss 
of my other files.

SESSION Nov 22, 2004 15:31:34.62 - I restarted Eclipse and restored my Java 
files from local history, applied the last changes I lost from my last save 
point manually. Local history for my other files was not available - don't 
know how to activate this feature for them.

That's it - I hope this helps. Of course, I am not sure about the exact times, 
but at least the order of events is the right one.

Regards,

Vedran
Comment 8 Vedran Lerenc CLA 2004-11-24 07:16:17 EST
> Just to emphasize Dani's questions: When did you restart? Directly after
> the crash? I.e. did you turn off the computer Nov 22?

Yes, I restarted my machine/Eclipse directly after the crash on Nov 22.

> The interesting part in the log file is that it contains a rather long block
> of null bytes. When you restarted your computer did a recovery/disk checking
> program run?

No, at least nothing I was aware of - what Windows XP is doing in background I 
don't know. The crash seemed to have had no influence on the other software 
components. Only Eclipse has lost the projects, and my open files were nulled.

Regards,

Vedran
Comment 9 Vedran Lerenc CLA 2004-11-24 07:18:39 EST
> BTW: how much memory do you give Eclipse?

I started Eclipse as follows:

C:\Development\Tools\Java\Eclipse\eclipse.exe -vmargs -Xms128m -Xmx256m -
DproxySet=true -Dhttp.proxyHost=PrOxY -Dhttp.proxyPort=8080 -
Dhttp.nonProxyHosts=*.sap.corp

Regards,

Vedran
Comment 10 Philipe Mulet CLA 2004-11-24 07:27:43 EST
Back to JDT Text. Last comments seem to rather point at open editor contents.
Comment 11 Vedran Lerenc CLA 2004-11-24 07:46:01 EST
I am not familiar with your internal structure, of course, but, IMHO, a bunch 
of null bytes also in the log file seems not to point to text editors only. 
Isn't that an indication of a more general problem here?

Regards,

Vedran
Comment 12 Kai-Uwe Maetzel CLA 2004-11-24 08:51:45 EST
John, any thinkable explanation of the null bytes in the log from the core 
perspective?
Comment 13 John Arthorne CLA 2004-11-24 09:40:41 EST
The log file is written using simple java.io (BufferedWriter,
OutputStreamWriter, and FileOutputStream).  The very first thing written to the
log after opening it for the first time in a session is the string "!SESSION",
so it is likely that the null characters are from the time of the crash.

This looks to me like it's not an Eclipse bug.  Corruption of the log file and
the editor's files, which are completely unrelated pieces with no common code
for writing them except the VM's class libraries, suggests either a VM,
operating system, or hardware failure on the originator's machine. For example,
a RAM failure could have caused RAM containing OS file buffers to be nulled. 
The fact that Windows XP completely hung at the same time (not an easy thing to
do), seems to support this theory.
Comment 14 Vedran Lerenc CLA 2004-11-24 11:05:53 EST
> Corruption of the log file and
the editor's files, which are completely unrelated pieces with no common code
for writing them except the VM's class libraries, suggests either a VM,
operating system, or hardware failure on the originator's machine.

I agree, if it is really the case that both entities have nothing else in 
common than the things you have listed.

> For example, a RAM failure could have caused RAM containing OS file buffers 
to be nulled.

I don't think so - I had no other symptoms and I know how I confused Windows 
XP.

> The fact that Windows XP completely hung at the same time (not an easy thing 
to do), seems to support this theory.

Well, you can get Windows XP to behave like this or at least bring it into a 
state where it will need time to recover from - no one said, that the machine 
wouldn't have recovered if I would have waited long enough. ;-)

In this case I moved one folder with lots of files from one spot to another 
(nothing related to my work or Eclipse). After minutes nothing had happened 
and I wasn't sure, if I really have moved the folder and did it again. Again 
nothing happened and although I guessed that the Explorer was working hard to 
do important stuff (e.g. determine useless information like overall file size 
to present me with a nice looking progress bar or whatever - the usual dialog 
box hasn't shown up - I guess even the pre-phase of this UI command took so 
long), I decided to open a command line and run the command there. I was 
curious how Windows XP would manage the requests, since the Explorer hasn't 
complained about the same UI move command called twice. I believe that from 
that moment on my Explorers failed to respond and that after I killed them and 
my command line even the Task Manager didn't show up after pressing 
CTRL+ALT+DEL. At that moment I waited a little bit longer and then switched 
off the machine.

If this really caused some basic operating system IO operations to fail, 
Windows XP would have a major problem with its file system, especially because 
neither the log nor my sources were part of the moved folder. Such a bug is 
extremly unlikely to find in the Windows XP file system. Even if, then why are 
only files corrupted that were in contact with Eclipse? What are you doing 
with the log and the files you show in the editors - do you hold their 
handles? Because if not, I can't believe that the operating system's file 
system would have corrupted files no process holds a handle on - other files 
already stored on disk shouldn't become destroyed and if, then my whole system 
should have become corrupt, but it isn't. Everything runs fine. If you hold 
the handles, then the operating system must have destroyed my files prior to 
the switch off or during a kind of repair mode when powering up. However, it 
doesn't seem very likely that Windows XP has such a major bug, but I may be 
wrong.

Regards,

Vedran
Comment 15 Dani Megert CLA 2004-11-25 11:13:21 EST
>After restart all files which have been open in the editor when I turned off the 
>computer were empty
Did you edit and save those files? Were also files affected that you only opened
in the editor but didn't change?

What files system?
Comment 16 Vedran Lerenc CLA 2004-11-25 11:30:02 EST
I don't know for sure - I guess, that I have also edited thoose files or at 
least planned to edit them.

File System: NTFS

Regards,

Vedran
Comment 17 Dani Megert CLA 2004-12-08 13:35:58 EST
Used VM: Sun 1.4.2_01
Comment 18 Dani Megert CLA 2004-12-13 06:25:27 EST
Setting to remind. We verified that the files opened by text infrastructure get
correctly closed.
Comment 19 Dani Megert CLA 2007-06-22 09:58:51 EDT
Get rid of deprecated state.
Comment 20 Dani Megert CLA 2007-06-22 10:04:15 EDT
.