[Lazarus] SIGEGV crash when a hint displays under certain circumstances, qt5

Julius JuuS at mailbox.org
Sun Aug 9 09:17:14 CEST 2020


I've run into a problem and I can't find any references by google or
mantis. Basically, depending on the path you take, displaying a hint
in a qt5 build causes program crash with SIGEGV. The problem is easy to
reproduce and to "fix".

I'm running Laz 2.0.6, Kubuntu 20.04, it is a qt5 project. When built
"generically" (ie, no qt5 widgetset specified) it works with no
problems. I also tested Laz 2.0.10.

Maybe someone has insights? If someone could confirm it so that I know
it is not just my computer/code, I will file a bug report.

To Reproduce:
A Main form and 2 sub-forms. The subforms are not autocreated.
A checkbox on all 3 forms that toggles the form's showhint property,
initially all have showhint := false;

Two buttons on the main form, each has a hint.

First button does a "with TmyForm1.Create(self)", in a try/finally
block, and only uses the command ShowModal. Likewise the second button
does exactly the same for the second sub form.

Each subform has some control as you like, each with a hint.

Run the application. Open the first subform and toggle its hints on,
then mouse over the control to show the hint.

Then, open the second subform and toggle its hints on. When the mouse is
moved over the control you get the SIGEGV.

Using the same application, run it again.

This time, on the main form, be sure to toggle its Showhint to on, mouse
over one of the buttons (the hint MUST be shown, toggling ShowHInt alone
causes the same error), and then Hint behaviour is normal.

Laz 2.0.6: I can get it to give me a location sometimes and it points to
line 7929 in qt5/qtwidgets.pas:

function TQtMainWindow.IsMdiChild: Boolean;
  Result := (LCLObject <> nil) and not IsFrameWindow and not
7929 ==>    (csDesigning in LCLObject.ComponentState) and
    (TCustomForm(LCLObject).FormStyle = fsMDIChild) and not

Laz 2.0.10: Stops at Line 308 in qt5/qtwscontrols.pp

class procedure TQtWSWinControl.SetText(const AWinControl: TWinControl;
  const AText: string);
  if not WSCheckHandleAllocated(AWincontrol, 'SetText') then
==> 308  TQtWidget(AWinControl.Handle).BeginUpdate;


More information about the lazarus mailing list