Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2020-08

SIGEGV crash when a hint displays under certain circumstances, qt5

5 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Julius

Hi,

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.

TO "FIX"
===========
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;
begin
  Result := (LCLObject  nil) and not IsFrameWindow and not
7929 ==>    (csDesigning in LCLObject.ComponentState) and
    (TCustomForm(LCLObject).FormStyle = fsMDIChild) and not
IsFormDesign(LCLObject);
end;

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

class procedure TQtWSWinControl.SetText(const AWinControl: TWinControl;
  const AText: string);
begin
  if not WSCheckHandleAllocated(AWincontrol, 'SetText') then
    Exit;
==> 308  TQtWidget(AWinControl.Handle).BeginUpdate;
  TQtWidget(AWinControl.Handle).setText(GetUtf8String(AText));
  TQtWidget(AWinControl.Handle).EndUpdate;
end;
Julius

Reply by email

Juha Manninen
to Julius
AM Julius wrote 6 lines
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.

Building "generically" means the widgetset is GTK2. Can you please test also with Lazarus trunk. QT5 has got fixes and improvements there.
If you can still reproduce, please file a bug report.

Regards,
Juha

Reply by email

Julius
to Juha Manninen

Ok, I will look into that. Have a great Sunday.

Juha Manninen wrote 17 lines
On Sun, Aug 9, 2020 at 10:17 AM Julius via lazarus wrote: > 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. Building "generically" means the widgetset is GTK2. Can you please test also with Lazarus trunk. QT5 has got fixes and improvements there. If you can still reproduce, please file a bug report. Regards, Juha
Julius

Reply by email

Julius
to Julius

Hi, for anyone following this thread: it is fixed in Trunk.

Julius wrote 21 lines
Ok, I will look into that. Have a great Sunday. On 09.08.20 11:45, Juha Manninen via lazarus wrote: > On Sun, Aug 9, 2020 at 10:17 AM Julius via lazarus > wrote: >> 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. > > Building "generically" means the widgetset is GTK2. > Can you please test also with Lazarus trunk. QT5 has got fixes and > improvements there. > If you can still reproduce, please file a bug report. > > Regards, > Juha >
Julius

Reply by email