[Qt] lazarus qt x86_64 rangecheck and segfault probs

zeljko zeljko at holobit.net
Wed Aug 27 08:30:05 CEST 2008


On Friday 22 August 2008 03:46, Terry Kemp wrote:
> Hi Qt people,
>
> I have finally been sufficiently annoyed by the constant access
> violation popups using Lazarus with Qt LCL on x86_64 that I decided to
> track it down ;)
>
> -----------------------------
> 1st problem is a rangecheck error when compiled with -g
>
> see attached gdb-lazqt-rangecheck.txt
>
> its in the call to
> function GetIntsPtr(PA : PIntArray): PPtrInt; cdecl; export;
> begin
>   Result := @PA^[0];
> end;
>
> I have no clue on this one (but its not a show stopper).
>
> ---------------------------------
> 2nd is continual access violation popups when hovering over forms,
> buttons, ide components etc. The 'hint popup' displays normally the
> first time then everytime thereafter it segfaults the program.
>
> This seems to be to do with the 'free' call in
>
>
> procedure TQtObject.EndEventProcessing;
> begin
>   if FInEventCount > 0 then
>     dec(FInEventCount);
>   if (FInEventCount = 0) and FReleaseInEvent then
>     Free;
> end;
>
>
> I have modified qtobjects.pas TQtTimer.EventFilter ...

I'll apply patch for this issue today so you can test.
I've already tested under win32,linux & Mac and it works OK,
also there are no more codetools AV's with this patch (seen on linux & mac).
Patch doesn''t use eventprocessing on timers. There are also small changes
to processing messages.


>
>
> Index: lcl/interfaces/qt/qtobjects.pas
> ===================================================================
> --- lcl/interfaces/qt/qtobjects.pas	(revision 16170)
> +++ lcl/interfaces/qt/qtobjects.pas	(working copy)
> @@ -3222,7 +3222,10 @@
>      QEvent_accept(Event);
>
>      if Assigned(FCallbackFunc) then
> +     begin
>        FCallbackFunc;
> +      exit;
> +     end;
>    end;
>    EndEventProcessing;
>  end;
>
> and it works a treat. No more crashes and I have code and form hints for
> the first time :)
>
> I bet this is not correct tho and may eat memory ;)
> Anyone know whats going on here?
>
>
> Attached is gdb log (output.txt) the shows backtrace of this fault.
>
> regards
>
> Terry



More information about the Qt mailing list