Recent

Author Topic: Forms/Dialogs cause SIGSEGV on (Manjaro) Linux when terminating program  (Read 1925 times)

Handoko

  • Hero Member
  • *****
  • Posts: 5130
  • My goal: build my own game engine using Lazarus
Re: Forms cause SIGSEGV on Linux when terminating program
« Reply #15 on: February 12, 2020, 02:02:45 pm »
I ever had similar problem. All the programs built using Lazarus that use TOpenGLControl always caused SIGSEGV error when terminating the program. The problem remained unsolved even I upgraded my Ubuntu from 19.04 to 19.10. Same hardware different versions of the OS, the error still existed. Of course, I had already tested using different versions of Lazarus too.

So that made me thought that was hardware problem. Maybe the VGA. But when I got a new harddisk and performed a complete fresh installation, the problem never happens anymore. So, who should be blame? Not the Lazarus/FPC, not the OS, not the hardware. A faulty harddisk? I don't think so.

@Munair

Maybe you can get a new harddisk to perform a fresh installation. At least try to create a Virtual Machine.
« Last Edit: February 12, 2020, 02:08:08 pm by Handoko »

munair

  • Hero Member
  • *****
  • Posts: 798
  • compiler developer @SharpBASIC
    • SharpBASIC
Re: Forms cause SIGSEGV on Linux when terminating program
« Reply #16 on: February 12, 2020, 02:03:55 pm »
Crash happens with both GTK2 and GTK3 widget sets. Previous tests were compiled against GTK2. This latest test compiled against GTK3:

terminal screenshot

strace dump
keep it simple

munair

  • Hero Member
  • *****
  • Posts: 798
  • compiler developer @SharpBASIC
    • SharpBASIC
Re: Forms cause SIGSEGV on Linux when terminating program
« Reply #17 on: February 12, 2020, 02:11:27 pm »
I ever had similar problem. All the programs built using Lazarus that use TOpenGLControl always caused SIGSEGV error. The problem remained unsolved even I upgraded my Ubuntu from 19.04 to 19.10. Same hardware different versions of the OS, the error still existed. Of course, I had already tested using different versions of Lazarus too.

So that made me thought that was hardware problem. Maybe the VGA. But when I got a new harddisk and performed a complete fresh installation, the problem never happens anymore. So, who should be blame? Not the Lazarus/FPC, not the OS, not the hardware. A faulty harddisk? I don't think so.

@Munair

Maybe you can get a new harddisk to perform a fresh installation. At least try to create a Virtual Machine.
I am currently on a brand-new system, just three weeks old. But if it were hardware related then one would expect similar errors with native GTK programs like GIMP and such. But that is not the case. I never test on VMs because errors may not show up in a VM environment. A good example is a current bug in Xojo 64-bits. Any attempt to open a printer dialog causes a silent crash. It appears to be network related, but the crash does not occur when tested within a VM environment.
keep it simple

Thaddy

  • Hero Member
  • *****
  • Posts: 14201
  • Probably until I exterminate Putin.
Re: Forms cause SIGSEGV on Linux when terminating program
« Reply #18 on: February 12, 2020, 02:16:26 pm »
@munair
Can you post actual and complete code? We are trying, but nobody can reproduce it.
Specialize a type, not a var.

munair

  • Hero Member
  • *****
  • Posts: 798
  • compiler developer @SharpBASIC
    • SharpBASIC
Re: Forms cause SIGSEGV on Linux when terminating program
« Reply #19 on: February 12, 2020, 02:22:52 pm »
SuseLinux 64 Tumbleweed, gtk2, KDE Plasma 5.17.5, Kernel 5.5.1-1
Have you also tried the GTK3 widget set? On Manjaro I use LTS kernel 5.4.18-1. Possibly Manjaro/Arch no longer maintain GTK2 packages.
keep it simple

munair

  • Hero Member
  • *****
  • Posts: 798
  • compiler developer @SharpBASIC
    • SharpBASIC
Re: Forms cause SIGSEGV on Linux when terminating program
« Reply #20 on: February 12, 2020, 02:30:25 pm »
@munair
Can you post actual and complete code? We are trying, but nobody can reproduce it.
Correction: WP reproduced and confirmed it.

Exampe project:
Laz_TestMsg.tar.gz
« Last Edit: February 12, 2020, 02:33:40 pm by Munair »
keep it simple

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: Forms cause SIGSEGV on Linux when terminating program
« Reply #21 on: February 12, 2020, 02:45:48 pm »
SuseLinux 64 Tumbleweed, gtk2, KDE Plasma 5.17.5, Kernel 5.5.1-1
Have you also tried the GTK3 widget set? On Manjaro I use LTS kernel 5.4.18-1. Possibly Manjaro/Arch no longer maintain GTK2 packages.

Hi

Just tested empty application with gtk3:

* No crash from IDE
* No crash from Desktop
* No crash from terminal

Winni

munair

  • Hero Member
  • *****
  • Posts: 798
  • compiler developer @SharpBASIC
    • SharpBASIC
Re: Forms cause SIGSEGV on Linux when terminating program
« Reply #22 on: February 12, 2020, 02:59:50 pm »
SuseLinux 64 Tumbleweed, gtk2, KDE Plasma 5.17.5, Kernel 5.5.1-1
Have you also tried the GTK3 widget set? On Manjaro I use LTS kernel 5.4.18-1. Possibly Manjaro/Arch no longer maintain GTK2 packages.

Hi

Just tested empty application with gtk3:

* No crash from IDE
* No crash from Desktop
* No crash from terminal

Winni
Thanks!
keep it simple

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Forms cause SIGSEGV on (Manjaro) Linux when terminating program
« Reply #23 on: February 12, 2020, 03:08:44 pm »
Tested in Xubutu 18.04; no errors except the (rather normal*) warning shown:

Code: [Select]
lucamar@Satellite-L500:~/SoftDev/Test/Forum/AppExit$ uname -a
Linux Satellite-L500 5.3.0-28-generic #30~18.04.1-Ubuntu SMP Fri Jan 17 06:14:09 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

lucamar@Satellite-L500:~/SoftDev/Test/Forum/AppExit$ ./pTestMsg
Gtk-Message: 15:05:11.919: GtkDialog mapped without a transient parent. This is discouraged.
lucamar@Satellite-L500:~/SoftDev/Test/Forum/AppExit$_


* (Lazarus GTK apps frequently whine a little about windows and its parents (like "trying to close a parent window that isn't there" and such) but that's pecata minuta ;) )
« Last Edit: February 12, 2020, 03:11:36 pm by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: Forms cause SIGSEGV on (Manjaro) Linux when terminating program
« Reply #24 on: February 12, 2020, 03:17:57 pm »
.... that's pecata minuta ;) )

Norddeutsch:

Das is Banane

munair

  • Hero Member
  • *****
  • Posts: 798
  • compiler developer @SharpBASIC
    • SharpBASIC
Re: Forms cause SIGSEGV on (Manjaro) Linux when terminating program
« Reply #25 on: February 12, 2020, 03:30:12 pm »
@lucamar
Quote
Gtk-Message: 15:05:11.919: GtkDialog mapped without a transient parent. This is discouraged.
This is probably the reason. I can use my relatively large program indefinitely even after ShowMessage has been fired multiple times. But after it has been fired (once) and I exit the program, I get this SIGSEGV.

Of course, it doesn't show up when launched as a desktop application, so most of the time the error goes unnoticed. I still think that this has to do with how the LCL handles GTK windows/dialogs. One Linux system may be more lenient towards these errors while other, such as Manjaro/Arch are more strict.
keep it simple

dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Forms/Dialogs cause SIGSEGV on (Manjaro) Linux when terminating program
« Reply #26 on: February 13, 2020, 09:22:08 am »
yes Munair, I have seen a number of segv on exit when testing my app on GTK3, I noted in a bug report (on another issue) that it seemed to happen to me about one in five times I started and stopped even simple apps.

I gave up on GTK3 and now recommend QT5 on newer Linux OS.

Some of the GTK3 LCL code is using deprecated GTK3 interfaces,  particularly around scaling and showing windows, getting monitor sizes, resolutions etc.  If they cannot keep the GTK3 interface stable, its all just too hard.

QT5 seems pretty good on recently released linux, pretty poor on older ones (such as Ubuntu LTS).

Davo

Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

 

TinyPortal © 2005-2018