Recent

Author Topic: Now I have lost a full day of coding and I am still in the dark  (Read 1731 times)

CarmichaelJohn

  • New Member
  • *
  • Posts: 46
Now I have lost a full day of coding and I am still in the dark
« on: September 20, 2020, 11:26:35 am »
Hello,
My prior plea for help got very complicated for me.  I am a simple mathematician rather than a programmer genius, so I do not know all of the intricacies of Lazarus.  However, the obvious thing to me (and I admit I am not terribly knowledgeable about the programming intricacies) is that none of this craziness started happening until I uninstalled Lazarus 2.0.8 and installed Lazarus 2.0.10.  So I am going back to 2.0.8 to see if the problem continues, because this is most frustrating, and I do not want to have to learn how to use supplemental programs to make what should be be.  Does anyone have any other suggestions.  The last six hours were done without any other program open,  I did not access Delphi at all.
Thank you for your help so far.
John

jwdietrich

  • Hero Member
  • *****
  • Posts: 1232
    • formatio reticularis
Re: Now I have lost a full day of coding and I am still in the dark
« Reply #1 on: September 20, 2020, 11:44:28 am »
Can you be more specific and describe your concrete problem?

Please provide a code example that worked with Lazarus 2.0.8 but doesn't work with version 2.0.10.

Edit: I just saw that this is a kind of duplicate of another topic started by you, and you depicted your problem there. This is a weird thing that I never experienced in more than 10 years with Lazarus and FPC.
« Last Edit: September 20, 2020, 11:50:25 am by jwdietrich »
function GetRandomNumber: integer; // xkcd.com
begin
  GetRandomNumber := 4; // chosen by fair dice roll. Guaranteed to be random.
end;

http://www.formatio-reticularis.de

Lazarus 2.2.6 | FPC 3.2.2 | PPC, Intel, ARM | macOS, Windows, Linux

Bart

  • Hero Member
  • *****
  • Posts: 5275
    • Bart en Mariska's Webstek
Re: Now I have lost a full day of coding and I am still in the dark
« Reply #2 on: September 20, 2020, 11:45:02 am »
Well, I have never experienced that at all.
My config may have been screwed after an update, but I never ever lost my programs.
And yes, sometimes compilation failed, either because some functions were moved to other units, or something in the new compiler had changed.
All this of course is peanuts compared to loosing your program.

Then again, I started long time ago to have my own subversion repository at SF.
Whenever I change something significant I commit it.
If I screw it up (or Lazarus does somehow, as you say happened to you), I can simply retrieve any previous version (so even if I accidentally commit the broken version).

This will not help you with your current problem, but it's worth your while to consider having your own repository (svn or git. @others: please don't start a war about this).

And yes, svn or git are "supplemental" programs, but you will benefit from it's use regardless of what language you do your programming in.

Just my 2 cents.

Bart

jamie

  • Hero Member
  • *****
  • Posts: 6090
Re: Now I have lost a full day of coding and I am still in the dark
« Reply #3 on: September 20, 2020, 12:03:46 pm »
maybe an issue between formats of the project file where as after using a newer laz It no longer works with older laz, the designer that is. it would appear that you loose your design layout etc..

@WP made a convert program to fix that .
The only true wisdom is knowing you know nothing

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: Now I have lost a full day of coding and I am still in the dark
« Reply #4 on: September 21, 2020, 01:47:37 pm »
The last six hours were done without any other program open,  I did not access Delphi at all.
You did not write if everything worked fine during those hours, or if you still had a problem.

In any case, if it happens again (hopefully not) collect as much info as you can. Because your post at https://forum.lazarus.freepascal.org/index.php/topic,51509.0.html did not have any info that anyone could give a definite answer. So all you got was guesses.

Look at the bottom of the editor window, for each file (when you select the tab) it gives the full path and filename. Are those the path and file you expect?

If you have a file were you got the problem, can you open it in a different editor (notepad)? Same problem?

Is the file in some backup folder (created by the IDE)?

--------
Also, how do you create new files?
- File => NEw => ....
- OR: open an existing file, and "save as" with new name, then edit it?

--------------
Not sure what else could help.

I have not experienced anything like this. And apparently no one else who replied ever had the problem. So no one else (that answered) has used the exact workflow leading to the problem. It may still be a valid workflow. But without understanding how to get to the problem, there is nothing that can be done about it.

CarmichaelJohn

  • New Member
  • *
  • Posts: 46
Re: Now I have lost a full day of coding and I am still in the dark
« Reply #5 on: September 22, 2020, 01:23:01 am »
Hello, and it is still happening.

All of the files corrupted are in the project folder, i.e., C:/Users/John/Documents/Lazarus Projects/file name

When I made the changes I would click on “File-Save All” after every few changes.  I did this much more frequently than I normally would because of the problem.

The Project is called “Statistical Distributions Sep 18 2020" and the main program form consists of a lot of Radio buttons, each will, “On-Click” execute a showmodal on a specific statistical distribution.  Currently I have only coded three: a Beta Distribution, a Beta Prime Distribution, and a Cauchy-Lorentz Distribution.  Each form is very much like all of the other distribution forms: a TAChart showing six variations on the probability density function plotted against “x”, twelve Edit boxes to imput shape parameters, 36 labels that display the various characteristic parameters for each curve, a TmainMenu component having six menu items: Zero-out all variables, initialize all variables, calculate, print (not yet programmed so the on-click event has not been activated in the Object Inspector, and a close command.  That pretty much sums up the extent of the coding so far.  When completed I anticipate up to 45 or 50 radio buttons with a concomitant number of forms. There is also one unit that is in the uses part of each module.  This unit contains the definition for the arrays that are used and the variable to access each array.

I am using Lazarus IDE v2.0.8 r62944, my OS is Windows 10, 64bits.

It appears that the changes were saved to the corresponding file in the backup folder.  However given what is happening I am afraid to touch that backup file for fear that it too will disappear.

The program was before all of the mayhem began compiling and executing with the one completed distribution, the beta distribution.  However, the last time I tried to compile and run I got an error and the following message: “Project project StatisticalDistributionsSep182020 raised exception class ‘External SIGSEGV’.  In file ‘formmainprogramsep182020.pas at line 88: FormCauchyLorentzDistSep202020.showmodal;”.

I do not have any other information at all, the above is all I know or have seen.
Once again, thank you in advance for any help you might be able to provide.
John




winni

  • Hero Member
  • *****
  • Posts: 3197
Re: Now I have lost a full day of coding and I am still in the dark
« Reply #6 on: September 22, 2020, 01:37:16 am »
Hello, and it is still happening.

It appears that the changes were saved to the corresponding file in the backup folder.  However given what is happening I am afraid to touch that backup file for fear that it too will disappear.


Hi!

Then copy the backup´ file to a backupbackup directory.
Then you can use the backup files.
Not such a big trick.

Winni

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: Now I have lost a full day of coding and I am still in the dark
« Reply #7 on: September 22, 2020, 01:46:00 am »
First of all: Backup the entire folder:
C:/Users/John/Documents/Lazarus Projects/file name

Keep that backup:
- For you, in case there are more problems
- For any questions that may arise from this thread.



What files are corrupted: Pascal (.pas, .pp), Forms (.lfm), both? Or does it give an error opening the project file?

How many files are corrupted?

What does corrupted mean? Is it reverted to an old version? Is it empty? Is it random other content?



Could you share some of the files?

You can sent them in private, and I will tread them as confidential: lazarus [at] mfriebe.de

Attach to forum, or sent:
- Project file *.lpi
- session, if exists: *.lps
- sample of corrupted file; and last good version as found in backup folder



Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: Now I have lost a full day of coding and I am still in the dark
« Reply #8 on: September 22, 2020, 01:53:18 am »
Quote
‘External SIGSEGV’.
This is an error in your code. Likely a nil dereference, or a dangling pointer. ("class" is internally a pointer)
Could also be an out of range operation, if you do not have range-checks enabled.

It is unlikely to cause the issue. At least not to be the root cause.

The IDE should have opened the file in which the error was.
Next time you get an error like this, and the IDE shows you the source position of the error => look at the bottom of the source editor, and check the full path and filename.
If it is one of your files (and not a file that came with Lazarus) then make sure it has the path that you expect it to have.

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2020
  • Former Delphi 1-7, 10.2 user
Re: Now I have lost a full day of coding and I am still in the dark
« Reply #9 on: September 22, 2020, 02:02:04 am »
@CarmichaelJohn

I have never experienced anything like this myself. That said, your unit names (and project name) seem especially long. I have no idea whether this is causing your issues, but it's a possibility.

If you could document step by step exactly how to reliably reproduce the issue (and provide the source files) that would go a long way to resolving your issue. Unless someone can reproduce your issue, it cannot be resolved.

I'm not sure why you started another thread about the same issue... in the previous thread I suggested checking the files in your project's backup directory. It seems in this thread you mention that the files in the project backup directory are OK. In that case, exit Lazarus, manually copy the backup files from the backup directory to the project directory and then start Lazarus again. Check the files in Lazarus are what you expect before continuing to edit.

CarmichaelJohn

  • New Member
  • *
  • Posts: 46
Re: Now I have lost a full day of coding and I am still in the dark
« Reply #10 on: September 22, 2020, 02:12:20 am »
Please do not spend any more time on this problem.  I am pretty sure that I have picked up a virus and I have called our IT service guy for an appointment.  I won't try anything else until I am sure that I have a clean machine.  I sincerely regret wasting your time on this when It most likely is my own machine.
Thank you for your kindness, John

 

TinyPortal © 2005-2018