Re: [Lazarus] Memory corruption when allocating and freeing 1 byte memory

2011-02-26 Thread Juha Manninen
Vincent Snijders kirjoitti lauantai 26 helmikuu 2011 10:27:19: It probably is some buffer overrun, at least that is more likely than a bug in the heap manager. WIthout sample source that can be compiled and run it is hard to draw any conclusion form the heaptrc and I doubt that anybody can

Re: [Lazarus] Memory corruption when allocating and freeing 1 byte memory

2011-02-26 Thread Juha Manninen
Vincent Snijders kirjoitti lauantai 26 helmikuu 2011 10:27:19: It probably is some buffer overrun, at least that is more likely than a bug in the heap manager. Replacing: GetMem (fInputString, (Len + 1) * SizeOf (REChar)); with: GetMem (fInputString, (Len + 2) * SizeOf (REChar)); in

[Lazarus] Memory corruption when allocating and freeing 1 byte memory

2011-02-25 Thread Juha Manninen
Hi I fixed a nasty memory corruption issue in r29667. It happens when TRegExpr is passed an empty source file. SearchFrm.pas has: RE.InputString:=Src; Then GetMem reserves only 1 byte of memory. Then FreeMem causes a crash and Lazarus dies (in my machine, in certain conditions): Marked

Re: [Lazarus] Memory corruption when allocating and freeing 1 byte memory

2011-02-25 Thread Juha Manninen
The strange thing is that I experienced the crash only with QT bindings although the problem has nothing to do with widget bindings. Strange... I bet most developers can't reproduce my findings (again). I could not reproduce it myself on a mini-laptop. It may be a 64-bit issue. Juha --