Recent

Author Topic: Lazarus deletes project directory and all its contents  (Read 6697 times)

Martin V

  • Full Member
  • ***
  • Posts: 139
Lazarus deletes project directory and all its contents
« on: October 31, 2011, 08:28:01 pm »
Hello,

I have Ubuntu Linux 10.04 installed and already two times, while debugging, my project folder and all subfolders vanish. The directory d flag has gone and the former project directory is a simple file with a length of 12 kB.

Is it possible to write the d flag again? What happened here? Is this a Linux bug?

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9874
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus deletes project directory and all its contents
« Reply #1 on: October 31, 2011, 08:36:45 pm »
Which version of Lazarus are you using?
If snapshot or SVN, which revision?

Did the IDE open any editors with "trash/random" data in it?

There was are recent issue, observed in trunk 0.9.31 (but potentially present earlier) (fixed only a few days ago) were clicking certain callstack entries, would open such an editor, and could lead to the directory being affected.

IIRC there was also a report that on certain linux distros the user can open a directory as if it was a file. Again it would look rubbish in the editor.
but if written back to disk, it may cause havoc.


As an immediate workaround, set the IDE backup option to create a backup (via file extension / not in a subfolder).
Then if the IDE writes your directory as file, it should rename the original directory first and save your data.

For anything else more feedback is required.

Martin V

  • Full Member
  • ***
  • Posts: 139
Re: Lazarus deletes project directory and all its contents
« Reply #2 on: October 31, 2011, 08:57:01 pm »
I have downloaded a daily snapshot version of Lazarus 1 week ago. The date of the l*.deb files is 2011-10-17.
The first occurence of the problem was that while debugging, the IDE said it cannot write the LPI project file. The file which has the name the directory had before is in the attachment below (renamed to *.txt). It seems that it holds textual Lazarus stuff in XML language like the LPI file. So has Lazarus written this file and overwritten the directory?
I have worked with user rights, not with administrator rights.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9874
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus deletes project directory and all its contents
« Reply #3 on: October 31, 2011, 09:23:56 pm »
Unfortunately you left one of my questions unanswered:
Quote
Did the IDE open any editors with "trash/random" data in it?

As I said, maybe by clicking the callstack? Or by using the file-open dialog?


Anyway, while I am not an expert, it doesn't look like it is a directory in text format.

I don't know if it could be an executable (very wild guess...)?
Have you checked the settings were the executable should be created?

Can you check the output from the compiler? Start Lazarus from a console, and watch the output.


If not, we'll need to find out what else the file is.

Martin V

  • Full Member
  • ***
  • Posts: 139
Re: Lazarus deletes project directory and all its contents
« Reply #4 on: October 31, 2011, 09:55:47 pm »
Yes, I used call stack Ctrl-F3.
I did not use the file open dialog in this case.

I worked several days on the project and all worked fine. I used the call stack window several times without problems.
« Last Edit: October 31, 2011, 11:04:16 pm by Martin V »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9874
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus deletes project directory and all its contents
« Reply #5 on: October 31, 2011, 11:41:25 pm »
Ok, it would be good to have definite steps to reproduce:

- Ensure you have backups, made yourself (I guess you do anyway at the moment)
- set Lazarus to do them fo you in addition (as described in previous post)

Watch out for any editor that may show "weird" content.

One way to force it (unless you update to the very latest trunk) is to double-click a line in the callstack that has no source (and therefore shows an address, and "??")

But then you should have noticed the weird file in the editor before....

Martin V

  • Full Member
  • ***
  • Posts: 139
Re: Lazarus deletes project directory and all its contents
« Reply #6 on: November 01, 2011, 09:50:17 am »
I wonder about the rights of the file system. Why has an application the right to overwrite a directory by a file? Normally, the operating system has to omit this behaviour. I use computers for 28 years and it's the first time that it happened. I really wonder that Linux tolerates this behaviour.

Where are the files? Physically, they should be still here, but the entry in the directory is lost. Is there a tool where I can reconstruct my files? File system ist ext4.

First, I have to reconstruct the work of the last days, sorry. Then I will try to reproduce the bug.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9874
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus deletes project directory and all its contents
« Reply #7 on: November 04, 2011, 03:29:30 pm »
There is a new report on the mailing list:
http://lists.lazarus.freepascal.org/pipermail/lazarus/2011-November/068431.html

If indeed it is on most recent trunk, then the issue is caused by a different bug (the debugger/callstack issue is already fixed in trunk)

You may want to follow this on the mailinglist.

 

TinyPortal © 2005-2018