Recent

Author Topic: Strange problem  (Read 2054 times)

daveinhull

  • Sr. Member
  • ****
  • Posts: 297
  • 1 divided by nothing must still be 1!
Strange problem
« on: April 19, 2018, 05:02:16 pm »
HI,

I have encountered a very strange problem.

I'm working on a development and it was going fine until yesterday when it started crashing with an out of memory error.
I went back to an earlier version and re-made the recent changes. All OK, it works.
However, if I delete just one control on the form, it crashes again with an out of memory error.
I've rebuilt the environment but it still does the same.

Anyone got any thoughts on what is going on?

Thanks
Dave
Version #:1.8.4 Date 2019-01-08 FPC Version: 3.0.4 and SVN Revision 57972 for x86_64-win64-win32/win64

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Strange problem
« Reply #1 on: April 19, 2018, 05:13:59 pm »
Your app is allocating memory without freeing it, probably repeatedly.
Without a working crystal ball, or inspection of a compilable source that shows the problem, your guesses are likely to be better than ours about the cause of this state of affairs.

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Strange problem
« Reply #2 on: April 19, 2018, 06:48:16 pm »
out of memory can happen for two reasons.
1) to many resources or memory allocated.
2) a recursive call gone out of control.

In your case assuming the problem is in the IDE I would say some control you placed on the form triggers some sort of infinite recursive loop, my first instict is to blame lcl and its quirky resize but the devs have already thought about infinite recursion and added a different exception to stop it.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

daveinhull

  • Sr. Member
  • ****
  • Posts: 297
  • 1 divided by nothing must still be 1!
Re: Strange problem
« Reply #3 on: April 20, 2018, 01:27:20 am »
Thanks for the replies and I do appreciate that it would be difficult to get to the root of the problem without seeing the code etc.

However, the strange but is not the actual error which if cause I could investigate for recursive situations consuming memory. The problem is that it works absolutely fine until I simple delete a control, then it errors. It also errors in a completely different place to the control that I delete.

Is there any tool that can check for internal consistency issues with the IDE, or look for other such potential problem.

Thanks
Dave
Version #:1.8.4 Date 2019-01-08 FPC Version: 3.0.4 and SVN Revision 57972 for x86_64-win64-win32/win64

jamie

  • Hero Member
  • *****
  • Posts: 6077
Re: Strange problem
« Reply #4 on: April 20, 2018, 01:43:35 am »
are you using a lot of Timages  with preloaded images?
The only true wisdom is knowing you know nothing

HeavyUser

  • Sr. Member
  • ****
  • Posts: 397
Re: Strange problem
« Reply #5 on: April 20, 2018, 01:53:27 am »
the source of the IDE is in your installation directory. Simply open it in the IDE and debug it as any other program

daveinhull

  • Sr. Member
  • ****
  • Posts: 297
  • 1 divided by nothing must still be 1!
Re: Strange problem
« Reply #6 on: April 20, 2018, 04:41:12 am »
Hi all,

So, after a lot of slow testing I've found the problem - it was with the Access DB I was using.
I went back to the last working version and tried removing the control and all was well.
I then updated the code slowly toward the latest version and all was well.
The last bit of code change required the latest Access DB, so I went and got it from the directory with the failing code it, and it failed again
I went back a version and took the old Access DB and hand modified it to the required state and all was well.

I have absolutely no idea what was wrong, but it all works again now. I did do a clean and repair in the 'problem' DB, but that didn't do anything.

So anyway, problem fixed.

Thanks
Dave
Version #:1.8.4 Date 2019-01-08 FPC Version: 3.0.4 and SVN Revision 57972 for x86_64-win64-win32/win64

 

TinyPortal © 2005-2018