Recent

Author Topic: Lazarus crashes when linked as gtk2, works with QT5  (Read 608 times)

grl

  • New Member
  • *
  • Posts: 43
Lazarus crashes when linked as gtk2, works with QT5
« on: March 16, 2025, 07:24:40 pm »
Hi @all!

recently switched over from Laptop using Debian12 cinneamon to a new one running Kubuntu 24.04.
I manage my Lazarus-installs using fpcupdeluxe, so I expected to just copy over the Lazarus folder and start up again.

I tried this with Lazarus Lazarus 3.7 and 4.0 RC2 - no difference

But Lazarus won't start throwing an exception.
Code: Pascal  [Select][+][-]
  1. [FORMS.PP] ExceptionOccurred
  2.   Sender=EInvalidOp
  3.   Exception=Invalid floating point operation
  4.   Stack trace:
  5.   $00007E116707FD8B
  6.   $00007E11672B96CC
  7. TApplication.HandleException: EInvalidOp
  8. Invalid floating point operation
  9.   Stack trace:
  10.   $00007E116707FD8B
  11.   $00007E11672B96CC
  12. Exception at 00007E116707FD8B: EInvalidOp:
  13. Invalid floating point operation.
  14.  

After a lot of try and error I found the following:
The crashing Lazarus was compiled using gtk2.
If I compiled the same install as qt5 I could start it.

Now are there several components I'd like to use that need gtk2 on linux (e.g. cef4delphi out of the online repositories and the comercial Fast Reports that I use a lot).

Tried to compile the ide with debug enabled - but then I don't get a lot more information.
(if that helps: These are the further lines I get in addition to the ones above when comping as Debug-IDE:
Code: Pascal  [Select][+][-]
  1. Heap dump by heaptrc unit of [path2Lazarusinstall]/lazarus/lazarus
  2. 129441 memory blocks allocated : 11318325/11718336
  3. 129435 memory blocks freed     : 11318013/11718024
  4. 6 unfreed memory blocks : 312
  5. True heap size : 1376256
  6. True free heap : 1374624
  7. Should be : 1374792
  8. Call trace for block $000078ED25314980 size 128
  9.   $0000000000435E11
  10. Call trace for block $000078ED22954C00 size 40
  11.   $0000000000435E11
  12. Call trace for block $000078ED22954B00 size 24
  13. Call trace for block $000078ED22BFC900 size 48
  14.   $0000000001EE5469  $IDTHREAD_$$_init$,  line 785 of Core/IdThread.pas
  15.   $0000000000438FDC
  16. Call trace for block $000078ED22BFC800 size 24
  17.   $0000000001EE5469  $IDTHREAD_$$_init$,  line 785 of Core/IdThread.pas
  18.   $0000000000438FDC
  19. Call trace for block $000078ED22BFB800 size 48
  20.   $0000000000438FDC
  21.  

As its the same on 3.7 and 4.0 RC2 I'd suspect some library issues on the new Laptop. But if so - how to find which one?
Also tried to start Lazarus with --debug-enable=DBG_VERBOSE but the exception seems to happen too early to let lazarus honor the command line option....

I'm a little lost at that time - any hints how to figure out what happens at start and how to get rid of it?

regards
Lukas

TRon

  • Hero Member
  • *****
  • Posts: 4309
Re: Lazarus crashes when linked as gtk2, works with QT5
« Reply #1 on: March 16, 2025, 09:22:31 pm »
Start Lazarus from a terminal and in case that doesn't provide enough hints then strace is your friend on Linux.
Today is tomorrow's yesterday.

dsiders

  • Hero Member
  • *****
  • Posts: 1391
Re: Lazarus crashes when linked as gtk2, works with QT5
« Reply #2 on: March 16, 2025, 10:02:13 pm »
Hi @all!

recently switched over from Laptop using Debian12 cinneamon to a new one running Kubuntu 24.04.
I manage my Lazarus-installs using fpcupdeluxe, so I expected to just copy over the Lazarus folder and start up again.

I tried this with Lazarus Lazarus 3.7 and 4.0 RC2 - no difference

But Lazarus won't start throwing an exception.
Code: Pascal  [Select][+][-]
  1. [FORMS.PP] ExceptionOccurred
  2.   Sender=EInvalidOp
  3.   Exception=Invalid floating point operation
  4.   Stack trace:
  5.   $00007E116707FD8B
  6.   $00007E11672B96CC
  7. TApplication.HandleException: EInvalidOp
  8. Invalid floating point operation
  9.   Stack trace:
  10.   $00007E116707FD8B
  11.   $00007E11672B96CC
  12. Exception at 00007E116707FD8B: EInvalidOp:
  13. Invalid floating point operation.
  14.  

After a lot of try and error I found the following:
The crashing Lazarus was compiled using gtk2.
If I compiled the same install as qt5 I could start it.

Now are there several components I'd like to use that need gtk2 on linux (e.g. cef4delphi out of the online repositories and the comercial Fast Reports that I use a lot).

Tried to compile the ide with debug enabled - but then I don't get a lot more information.
(if that helps: These are the further lines I get in addition to the ones above when comping as Debug-IDE:
Code: Pascal  [Select][+][-]
  1. Heap dump by heaptrc unit of [path2Lazarusinstall]/lazarus/lazarus
  2. 129441 memory blocks allocated : 11318325/11718336
  3. 129435 memory blocks freed     : 11318013/11718024
  4. 6 unfreed memory blocks : 312
  5. True heap size : 1376256
  6. True free heap : 1374624
  7. Should be : 1374792
  8. Call trace for block $000078ED25314980 size 128
  9.   $0000000000435E11
  10. Call trace for block $000078ED22954C00 size 40
  11.   $0000000000435E11
  12. Call trace for block $000078ED22954B00 size 24
  13. Call trace for block $000078ED22BFC900 size 48
  14.   $0000000001EE5469  $IDTHREAD_$$_init$,  line 785 of Core/IdThread.pas
  15.   $0000000000438FDC
  16. Call trace for block $000078ED22BFC800 size 24
  17.   $0000000001EE5469  $IDTHREAD_$$_init$,  line 785 of Core/IdThread.pas
  18.   $0000000000438FDC
  19. Call trace for block $000078ED22BFB800 size 48
  20.   $0000000000438FDC
  21.  

As its the same on 3.7 and 4.0 RC2 I'd suspect some library issues on the new Laptop. But if so - how to find which one?
Also tried to start Lazarus with --debug-enable=DBG_VERBOSE but the exception seems to happen too early to let lazarus honor the command line option....

I'm a little lost at that time - any hints how to figure out what happens at start and how to get rid of it?

regards
Lukas

Core/IdThread.pas is an Indy unit. Remove the contents of the directory where Indy is installed and try to rebuild to see if it is really the culprit or just a symptom of something else.
Preview the next Lazarus documentation release at: https://dsiders.gitlab.io/lazdocsnext

grl

  • New Member
  • *
  • Posts: 43
Re: Lazarus crashes when linked as gtk2, works with QT5
« Reply #3 on: March 17, 2025, 01:58:43 pm »
Core/IdThread.pas is an Indy unit. Remove the contents of the directory where Indy is installed and try to rebuild to see if it is really the culprit or just a symptom of something else.

Already tried that.
Did some package by package testing today...
Seems like the rx_lazreport package out of RX is the problem.
Once I remove that Lazarus starts again....

Lukas

Mr.Madguy

  • Hero Member
  • *****
  • Posts: 869
Re: Lazarus crashes when linked as gtk2, works with QT5
« Reply #4 on: March 17, 2025, 07:35:13 pm »
Have you tried to disable FPU exceptions? External libraries, especially C/C++ ones, may expect FPU exceptions disabled. Everybody, who has ever tried to use D3D, should know about this problem.

Try this:
Code: Pascal  [Select][+][-]
  1.   SetExceptionMask([exInvalidOp, exDenormalized, exZeroDivide,
  2.     exOverflow, exUnderflow, exPrecision]);
  3.  
Is it healthy for project not to have regular stable releases?
Just for fun: Code::Blocks, GCC 13 and DOS - is it possible?

 

TinyPortal © 2005-2018