Recent

Author Topic: [Fixed] How to trace IDE crash?  (Read 4100 times)

eny

  • Hero Member
  • *****
  • Posts: 1648
[Fixed] How to trace IDE crash?
« on: May 20, 2011, 02:00:19 pm »
Today I tried opening a project I had worked on a couple of days ago.
What happens: the IDE starts loading the project and during that process it crashes and ends (as in: no more Lazarus in the task manager).

Any suggestions on how to trace this back to a possible cause?

I'm really stunned because this has never happened before.
Also nothing has changed for the IDE itself (no new packages, paths or whatever).
« Last Edit: May 20, 2011, 03:46:56 pm by eny »
All posts based on: Win10 (Win64); Lazarus 3_4  (x64) 25-05-2024 (unless specified otherwise...)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12011
  • Debugger - SynEdit - and more
    • wiki
Re: How to trace IDE crash?
« Reply #1 on: May 20, 2011, 02:27:10 pm »
Which version of Lazarus?

Try to backup your config files (in user dir), and start without (equals new/clean) config.

Or at least without EnvironmentOptions.xml

If it works without the config, then restore your old config and find the file that cause issues.

You may want to post the file that cause the trouble, so it can be checked against the latest trunk.

One possible cause in older Versions was, if you had certain windows/dialogs open, and Lazarus tried to re-open them on startup

Bart

  • Hero Member
  • *****
  • Posts: 5663
    • Bart en Mariska's Webstek
Re: How to trace IDE crash?
« Reply #2 on: May 20, 2011, 02:38:03 pm »
Some more ideas:
Rebuild the IDE with line info enabled (-gl),
then run Lazarus from commandline and see what the output is.
Or run Lazarus from within gdb.

Bart

eny

  • Hero Member
  • *****
  • Posts: 1648
Re: How to trace IDE crash?
« Reply #3 on: May 20, 2011, 03:24:13 pm »
Which version of Lazarus?
It's always in my sig  :)

Thanks for the hints. I managed to 'restore' the IDE for the particular project (starting with a clear settings directory worked; thx Martin_fr). Somehow the problem is related to range checking. I managed to grab the error message when the IDE crashes by pressing PrintScreen at the right moment (see attachment). Note that the dialog does not actually wait for me to press either button.

Now I get very strange runtime behaviour for the program I had the problem with in the first place.
My program aborts at the line below. This line is in ImgList.inc; part of the LCL  %)
Code: Pascal  [Select][+][-]
  1. procedure TCustomImageList.GetRawImage(Index: Integer; out Image: TRawImage);
  2. begin
  3.   Image.Init;
  4.  
  5.   if (FCount = 0) then Exit;
  6.   CheckIndex(Index);
  7.   FillDescription(Image.Description);
  8.   Image.DataSize := FWidth * FHeight * SizeOf(FData[0]);
  9.   Image.Data := @FData[Index * FWidth * FHeight];               //<------------- ABORT
  10. end;

The one thing I remember is that yesterday I started a new project with the Vampyre Imaging library. This library (not an installed package) has a bug in that it defines an array somewhere like this: 'array[0..0] of...'
This array is a placeholder for a dynamically allocated structure, but the array is accessed via an index.
Hence it generates range check errors at compile time.
So I had to disable range checking for this particular project.
But now this range check error has spread somehow to the other project and the IDE!
All posts based on: Win10 (Win64); Lazarus 3_4  (x64) 25-05-2024 (unless specified otherwise...)

eny

  • Hero Member
  • *****
  • Posts: 1648
[Solved] Re: How to trace IDE crash?
« Reply #4 on: May 20, 2011, 03:46:27 pm »
Because the problem was in the ImageList code, I removed the image list from the main form (.lfm file).
After that I could load the project, compile it and run it.

Then I dropped the imagelist component back onto the form and set the corresponding properties in the OI.
And now it works again  :o
No idea what caused this but it is a bit disconcerting...
All posts based on: Win10 (Win64); Lazarus 3_4  (x64) 25-05-2024 (unless specified otherwise...)

 

TinyPortal © 2005-2018