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

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Free Pascal - Lazarus mailing list
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
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

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

Free Pascal - Lazarus mailing list
On Sun, Aug 9, 2020 at 10:17 AM Julius via lazarus
<[hidden email]> 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
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

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

Free Pascal - Lazarus mailing list
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
> <[hidden email]> 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
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

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

Free Pascal - Lazarus mailing list
Hi, for anyone following this thread: it is fixed in Trunk.


On 09.08.20 12:59, Julius via lazarus wrote:

> 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
>> <[hidden email]> 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
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

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

Free Pascal - Lazarus mailing list
On Mon, Aug 10, 2020 at 12:21 PM Julius via lazarus
<[hidden email]> wrote:
> Hi, for anyone following this thread: it is fixed in Trunk.

Good  :)

Juha
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus