View Issue Details

IDProjectCategoryView StatusLast Update
0036019LazarusLCLpublic2019-11-08 14:05
ReporterValentinAssigned ToZeljan Rikalo 
PrioritynormalSeverityminorReproducibilityalways
Status assignedResolutionopen 
PlatformLinuxOSKubuntuOS Version19.04
Product Version2.0.4Product Build 
Target VersionFixed in Version 
Summary0036019: Qt5 programs on exit terminated with Segmentation fault
DescriptionPrograms with LCLWidgetType:=qt5 exit with Segmentation fault.


Workaround the problem:

procedure TForm1.FormDestroy(Sender: TObject);
begin
  FreeAndNil(Self)
end;
Steps To ReproduceKubuntu: 19.04
KDE Plasma: 5.15.4
Qt Version: 5.12.2
Qt type: 64-bit
Additional InformationApplication: Project1 (Project1), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7fdf2ba54bc0 (LWP 18787))]

Thread 3 (Thread 0x7fdf23512700 (LWP 18789)):
#0 0x00007fdf2fb1d729 in __GI___poll (fds=0x7fdf1c004e30, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
0000001 0x00007fdf2db18bf6 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
0000002 0x00007fdf2db18d1c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
0000003 0x00007fdf2e964063 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
0000004 0x00007fdf2e90f5bb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
0000005 0x00007fdf2e75a2c6 in QThread::exec() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
0000006 0x00007fdf2af82565 in ?? () from /lib/x86_64-linux-gnu/libQt5DBus.so.5
0000007 0x00007fdf2e75b612 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
0000008 0x00007fdf2e45f182 in start_thread (arg=<optimized out>) at pthread_create.c:486
0000009 0x00007fdf2fb29b1f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 2 (Thread 0x7fdf29f84700 (LWP 18788)):
#0 0x00007fdf2fb1d729 in __GI___poll (fds=0x7fdf29f83d28, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
0000001 0x00007fdf2e482917 in ?? () from /lib/x86_64-linux-gnu/libxcb.so.1
0000002 0x00007fdf2e48453a in xcb_wait_for_event () from /lib/x86_64-linux-gnu/libxcb.so.1
0000003 0x00007fdf2b0ba6a8 in ?? () from /lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
0000004 0x00007fdf2e75b612 in ?? () from /lib/x86_64-linux-gnu/libQt5Core.so.5
0000005 0x00007fdf2e45f182 in start_thread (arg=<optimized out>) at pthread_create.c:486
0000006 0x00007fdf2fb29b1f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 1 (Thread 0x7fdf2ba54bc0 (LWP 18787)):
[KCrash Handler]
0000006 0x00007fdf2e937dbe in QMetaCallEvent::QMetaCallEvent(QtPrivate::QSlotObjectBase*, QObject const*, int, int, int*, void**, QSemaphore*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
0000007 0x00007fdf2e93a2e4 in QMetaObject::activate(QObject*, int, int, void**) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
0000008 0x00007fdf2e93aaaf in QObject::destroyed(QObject*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
0000009 0x00007fdf2e94128f in QObject::~QObject() () from /lib/x86_64-linux-gnu/libQt5Core.so.5
0000010 0x00007fdf28e241b0 in ?? () from /lib/x86_64-linux-gnu/libKF5IconThemes.so.5
0000011 0x00007fdf2fa532ac in __run_exit_handlers (status=0, listp=0x7fdf2fbf0718 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:108
0000012 0x00007fdf2fa533da in __GI_exit (status=<optimized out>) at exit.c:139
0000013 0x00007fdf2fa32b72 in __libc_start_main (main=0x7fff94e91b80, argc=0, argv=0x0, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff94e91c88) at ../csu/libc-start.c:342
0000014 0x0000000000000000 in ?? ()
[Inferior 1 (process 18787) detached]
TagsNo tags attached.
Fixed in Revision
LazTarget
WidgetsetQT5
Attached Files

Relationships

related to 0035057 confirmedZeljan Rikalo Shell dialogs in QT5 widgetset causes AV after application is closed 
related to 0033667 confirmedZeljan Rikalo Exception-Klasse ┬╗External: SIGSEGV 

Activities

Zeljan Rikalo

2019-10-07 19:38

developer   ~0118396

No more such errors with glibc >= 2.27, also I don't have such problems with linuxmint 19.2

Zeljan Rikalo

2019-10-08 09:38

developer   ~0118406

Also, fpc-3.2.0 helps here. No crashes in any case even with glibc-2.26.

Valentin

2019-10-22 15:03

reporter   ~0118771

ubuntu 19.10, glibc-2.30

Without FreeAndNil(Self) on FormDestroy - no errors on exit, but the program remains in memory.

Zeljan Rikalo

2019-10-22 19:01

developer   ~0118773

@Valentin, Why FreeAndNil(Self) in OnDestroy() event of form ? That does not smell good.
I'm testing Qt5 with fpc-3.2beta and it works ok here - Fedora 29 64bit and LinuxMint 19.2 64bit (libQt5Pas built by me on Fedora 24 64bit from trunk lazarus - lcl/interfaces/qt5/cbindings against Qt5-5.6.2).
Also, look at my latest comments in related issues (about kio-core bug).

Valentin

2019-10-23 12:38

reporter   ~0118777

Hi Zeljan, I'll wait for fpc-3.2 and hope to resolve the problem. :)
For the time being FreeAndNill(Slef) helps the program to exit and release memory.
Anyway, I thank you for your contribution! :)

Zeljan Rikalo

2019-10-23 14:13

developer   ~0118778

@Valentin, try to rebuild fpc-3.0.4 for your target (that also helped me on Fedora 26).

Zeljan Rikalo

2019-11-08 14:05

developer   ~0119158

Just spotted that under recent KDE Plasma any exception in LCL program will go to KCrash.
export KDE_DEBUG=1 ./yourprogram should fix such problem (or add export KDE_DEBUG=1 in your $HOME/.bashrc as permanent solution).

Issue History

Date Modified Username Field Change
2019-08-27 18:30 Valentin New Issue
2019-08-28 08:34 Zeljan Rikalo Assigned To => Zeljan Rikalo
2019-08-28 08:34 Zeljan Rikalo Status new => assigned
2019-08-28 10:12 Zeljan Rikalo Relationship added related to 0035057
2019-08-28 10:13 Zeljan Rikalo Relationship added related to 0033667
2019-10-07 19:38 Zeljan Rikalo Note Added: 0118396
2019-10-08 09:38 Zeljan Rikalo Note Added: 0118406
2019-10-22 15:03 Valentin Note Added: 0118771
2019-10-22 19:01 Zeljan Rikalo Note Added: 0118773
2019-10-23 12:38 Valentin Note Added: 0118777
2019-10-23 14:13 Zeljan Rikalo Note Added: 0118778
2019-11-08 14:05 Zeljan Rikalo Note Added: 0119158