Recent

Author Topic: Unable to debug issue  (Read 2588 times)

Tony Stone

  • Full Member
  • ***
  • Posts: 216
Unable to debug issue
« on: August 22, 2021, 08:53:08 pm »
So I am having this problem in my program that seems to have popped up out of no where.  When i run it in release mode I get a range check error as my main form loads.  If i run it in debug mode i get no errors... however SOMETIMES in debug mode it seems to take 10 plus minutes to load.  All the while freezing my PC.  Mouse becomes stuck and hard drive flashes away.  This is on Linux Mint with Lazarus RC 2.2.0RC1

I don't know how to go about debugging this issue because it doesn't crash when running in debug mode.

I am using the forms sessionProperties with an XML prop storage component.  It has always worked great.  BUT, I have this feeling the issue may be there as none of my session properties load when this happens now.

Is there some other debugger tools I can try and use?

Thanks for any help and direction.  I hope I provided enough info to get started with solving this.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9754
  • Debugger - SynEdit - and more
    • wiki
Re: Unable to debug issue
« Reply #1 on: August 22, 2021, 09:12:32 pm »
You may have an uninitialized value....

- Check the warnings and notes that the compiler issues.
- debug using the -gt option (also -gtt and -gttt and -gtttt). 4 debug runs, with 1 to 4 "t".

You can also try to run in valgrind. Compile with -gv

valgrind --tool=memcheck  yourapp

Note, running in valgrind is slow. Seriously slow. But often worth it.

Tony Stone

  • Full Member
  • ***
  • Posts: 216
Re: Unable to debug issue
« Reply #2 on: August 22, 2021, 09:21:02 pm »
You may have an uninitialized value....

- Check the warnings and notes that the compiler issues.
- debug using the -gt option (also -gtt and -gttt and -gtttt). 4 debug runs, with 1 to 4 "t".

You can also try to run in valgrind. Compile with -gv

valgrind --tool=memcheck  yourapp

Note, running in valgrind is slow. Seriously slow. But often worth it.

Ok, so i went into my projects debugger options.  I did find the valgrind option but i am not seeing the -gt and -gttt options...  Where would i find those?

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9754
  • Debugger - SynEdit - and more
    • wiki
Re: Unable to debug issue
« Reply #3 on: August 22, 2021, 09:29:32 pm »
The simple "gt" is on the same page "trash variables"

For the -gtt... there is a "custom options" where you can add this.

If you write -gtt in the custom opts, then do not check the simple -gt. In the end all the "t" are added, and giving -gt and -gtt at the same time is the same as -gttt (3 t).


Tony Stone

  • Full Member
  • ***
  • Posts: 216
Re: Unable to debug issue
« Reply #4 on: August 22, 2021, 09:46:21 pm »
THANK YOU THANK YOU!

You were right... an uninitialized variable!  :-[

So I fixed that issue for now... but I think I am also finding other issues now with these debugger settings. 

Again, THANKS for the responsiveness!  The Lazarus forums truly have some of the best people in all of internet forum history...

The simple "gt" is on the same page "trash variables"

For the -gtt... there is a "custom options" where you can add this.

If you write -gtt in the custom opts, then do not check the simple -gt. In the end all the "t" are added, and giving -gt and -gtt at the same time is the same as -gttt (3 t).

Tony Stone

  • Full Member
  • ***
  • Posts: 216
Re: Unable to debug issue
« Reply #5 on: August 22, 2021, 09:48:51 pm »
And what is interesting... i think this variable when i first wrote it was set to 0.  And I think CodeTools refactoring may have removed the integer = 0; when i refactored.  I will have to see if I can reproduce that... maybe i found a bug in Lazarus...(probably not... the bug is probably me)

 

TinyPortal © 2005-2018