Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Layer Properties pop up (unusable) behind the DataSource Manager/Browser dialog #39094

Closed
rduivenvoorde opened this issue Sep 30, 2020 · 10 comments · Fixed by #54808
Closed

Layer Properties pop up (unusable) behind the DataSource Manager/Browser dialog #39094

rduivenvoorde opened this issue Sep 30, 2020 · 10 comments · Fixed by #54808
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption Data Source Manager QGIS Browser

Comments

@rduivenvoorde
Copy link
Contributor

The new context menu's in the Browser work great, both in the Browser widgets as in the DataSource Manager/Browser dialog where the Browser is an integral part of.

But if you select 'Layer Properties' in the Browser dialog for a db, those Layer Properties (with me) popup behind the modal 'DataSource Manager -- Browser' window. So then you cannot use/close it, only AFTER you close the DataSource Manager.

It has probably more to do with the Modality of the DataSourceManager then with the actual layer props. But current behaviour is not very intuitive/usable, as you have to close the DataSourceManager first before being able to use or close the Layer props

Screenshot-20200930074159-1335x948

@rduivenvoorde rduivenvoorde added DB Manager Relating to the DB Manager core plugin Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Source Manager labels Sep 30, 2020
@gioman gioman added QGIS Browser and removed DB Manager Relating to the DB Manager core plugin labels Jun 10, 2021
@Pedro-Murteira
Copy link

Still valid on QGIS 3.16.15 and 3.22.2.

@alexbruy
Copy link
Contributor

Can't reproduce with the latest master (f344919) on Linux. Maybe depends on the used DE/WM?

@alexbruy alexbruy added the Feedback Waiting on the submitter for answers label Sep 22, 2023
@rduivenvoorde
Copy link
Contributor Author

@alexbruy (good to see you! ) You are right, I cannot reproduce this anymore on my current setup and master.

There is something fishy going on though. Apparently the DataSourceManager (DSM) dialog does not have the main window as parent (anymore?).
Because, after showing the Layer Properties dialog (opening in front of the DSM), clicking on it, moves the DSM to the back of the QGIS window.

BUt this is probably due to the fact that the properties dialog has the mainwindow as parent. And I'm not sure if you want it to have the DMS dialog as parent when invoked from there?

Anyway, the original issue is not valid anymore. Feel free to close. I do not have a good solution for handling this dialog stacking...

@rduivenvoorde
Copy link
Contributor Author

Mmm, I do have a crash after this simple test....


^C[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007f2df00f2a57 in __GI___wait4 (pid=555833, stat_loc=0x7ffd66f2c894, options=0, usage=0x0) at ../sysdeps/unix/sysv/linux/wait4.c:30
30	../sysdeps/unix/sysv/linux/wait4.c: No such file or directory.
[Current thread is 1 (Thread 0x7f2ddbbde0c0 (LWP 553220))]
#0  0x00007f2df00f2a57 in __GI___wait4 (pid=555833, stat_loc=0x7ffd66f2c894, options=0, usage=0x0) at ../sysdeps/unix/sysv/linux/wait4.c:30
        sc_ret = -512
        sc_cancel_oldtype = 0
#1  0x000056237b7fe5f4 in qgisCrash(int) (signal=11) at /home/richard/git/qgis/src/app/main.cpp:350
        status = 32765
        pidstr = "--pid=553220\000\177\000\000\300\275\371\205#V\000\000\300\244\341~#V\000"
        gdbpid = 555833
        exename = "/home/richard/bin/qgis_/master/debug/bin/qgis\000\000\000\000\212s}#V\000\000\002\b\000\000\000\002\000\000\200\310\362f\375\177\000\000\2645\353\363-\177\000\000@Q\f\177#V\000\000\000Q\f\177#V\000\000\360\317\362f\375\177\000\000\253@\353\363-\177\000\000\000\301E}#V\000\000\002\b\000\000\000\002\000\0000\310\362f\000\000\000\000eи\364-\177\000\0000\256\371\205#V\000\000\000bC(\264\306\306b0\256\371\205#V\000\000\200\312\362f\375\177\000\000`f\v}#V\000\000\220f\v}#V\000\000\001\345\210}#V\000\000\r"...
        len = 45
#2  0x00007f2df005afd0 in <signal handler called> () at /lib/x86_64-linux-gnu/libc.so.6
#3  __strcasecmp_l_avx2 () at ../sysdeps/x86_64/multiarch/strcmp-avx2.S:283
#4  0x00007f2dea6669ab in GDALDataset::GetMetadata(char const*) () at /lib/x86_64-linux-gnu/libgdal.so.32
#5  0x00007f2df12bfc5e in QgsOgrProviderUtils::GDALCloseWrapper(void*) (hDS=0x562387884540) at /home/richard/git/qgis/src/core/providers/ogr/qgsogrproviderutils.cpp:1169
        mGDALDriver = 0x7ffd66f2d6e0
        mGDALDriverName = {d = 0x62c6c6b428436200}
        datasetName = {d = 0x0}
        __FUNCTION__ = "GDALCloseWrapper"
#6  0x00007f2df12c68b2 in QgsOgrProviderUtils::releaseInternal(QgsOgrProviderUtils::DatasetIdentification const&, QgsOgrProviderUtils::DatasetWithLayers*, bool) (ident=..., ds=0x5623872b6090, removeFromDatasetList=true) at /home/richard/git/qgis/src/core/providers/ogr/qgsogrproviderutils.cpp:2439
#7  0x00007f2df12c69e9 in QgsOgrProviderUtils::release(QgsOgrLayer*&) (layer=@0x7ffd66f2d7c0: 0x562386d174f0) at /home/richard/git/qgis/src/core/providers/ogr/qgsogrproviderutils.cpp:2461
        locker = {val = 139835338778553}
#8  0x00007f2df12cc608 in QgsOgrLayerReleaser::operator()(QgsOgrLayer*) const (this=0x562386d59e00, layer=0x562386d174f0) at /home/richard/git/qgis/src/core/providers/ogr/qgsogrproviderutils.cpp:3377
#9  0x00007f2df12947fc in std::__uniq_ptr_impl<QgsOgrLayer, QgsOgrLayerReleaser>::reset(QgsOgrLayer*) (this=0x562386d59e00, __p=0x0) at /usr/include/c++/12/bits/unique_ptr.h:203
        __old_p = 0x562386d174f0
#10 0x00007f2df1292485 in std::unique_ptr<QgsOgrLayer, QgsOgrLayerReleaser>::reset(QgsOgrLayer*) (this=0x562386d59e00, __p=0x0) at /usr/include/c++/12/bits/unique_ptr.h:501
#11 0x00007f2df128f94a in QgsOgrProvider::close() (this=0x562386d59d00) at /home/richard/git/qgis/src/core/providers/ogr/qgsogrprovider.cpp:3856
#12 0x00007f2df127494d in QgsOgrProvider::~QgsOgrProvider() (this=0x562386d59d00, __in_chrg=<optimized out>) at /home/richard/git/qgis/src/core/providers/ogr/qgsogrprovider.cpp:480
#13 0x00007f2df1274a8a in QgsOgrProvider::~QgsOgrProvider() (this=0x562386d59d00, __in_chrg=<optimized out>) at /home/richard/git/qgis/src/core/providers/ogr/qgsogrprovider.cpp:481
#14 0x00007f2df1f06196 in QgsVectorLayer::~QgsVectorLayer() (this=0x5623878b3270, __in_chrg=<optimized out>) at /home/richard/git/qgis/src/core/vector/qgsvectorlayer.cpp:255
#15 0x00007f2df1f065a2 in QgsVectorLayer::~QgsVectorLayer() (this=0x5623878b3270, __in_chrg=<optimized out>) at /home/richard/git/qgis/src/core/vector/qgsvectorlayer.cpp:273
#16 0x00007f2df790afaa in std::default_delete<QgsMapLayer>::operator()(QgsMapLayer*) const (this=0x5623867f2380, __ptr=0x5623878b3270) at /usr/include/c++/12/bits/unique_ptr.h:95
#17 0x00007f2df78f47be in std::unique_ptr<QgsMapLayer, std::default_delete<QgsMapLayer> >::~unique_ptr() (this=0x5623867f2380, __in_chrg=<optimized out>) at /usr/include/c++/12/bits/unique_ptr.h:396
        __ptr = @0x5623867f2380: 0x5623878b3270
#18 0x00007f2df5a64011 in QgsBrowserLayerProperties::~QgsBrowserLayerProperties() (this=0x5623867f22f0, __in_chrg=<optimized out>) at /home/richard/git/qgis/build/src/gui/qgis_gui_autogen/EWIEGA46WW/../../../../../src/gui/qgsbrowserdockwidget_p.h:105
#19 0x00007f2df5a6403e in QgsBrowserLayerProperties::~QgsBrowserLayerProperties() (this=0x5623867f22f0, __in_chrg=<optimized out>) at /home/richard/git/qgis/build/src/gui/qgis_gui_autogen/EWIEGA46WW/../../../../../src/gui/qgsbrowserdockwidget_p.h:105
#20 0x00007f2df3edb28e in QObjectPrivate::deleteChildren() () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#21 0x00007f2df4ba07b6 in QWidget::~QWidget() () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#22 0x00007f2df5a63eba in QgsBrowserPropertiesDialog::~QgsBrowserPropertiesDialog() (this=0x562388c2ab80, __in_chrg=<optimized out>) at /home/richard/git/qgis/build/src/gui/qgis_gui_autogen/EWIEGA46WW/../../../../../src/gui/qgsbrowserdockwidget_p.h:163
#23 0x00007f2df5a63edc in QgsBrowserPropertiesDialog::~QgsBrowserPropertiesDialog() (this=0x562388c2ab80, __in_chrg=<optimized out>) at /home/richard/git/qgis/build/src/gui/qgis_gui_autogen/EWIEGA46WW/../../../../../src/gui/qgsbrowserdockwidget_p.h:163
#24 0x00007f2df3edb28e in QObjectPrivate::deleteChildren() () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#25 0x00007f2df4ba07b6 in QWidget::~QWidget() () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#26 0x00007f2df780a657 in QgisApp::~QgisApp() (this=0x56237d738a00, __in_chrg=<optimized out>) at /home/richard/git/qgis/src/app/qgisapp.cpp:2209
#27 0x00007f2df780a680 in QgisApp::~QgisApp() (this=0x56237d738a00, __in_chrg=<optimized out>) at /home/richard/git/qgis/src/app/qgisapp.cpp:2209
#28 0x000056237b807081 in main(int, char**) (argc=3, argv=0x7ffd66f2fb48) at /home/richard/git/qgis/src/app/main.cpp:1831

@rduivenvoorde
Copy link
Contributor Author

rduivenvoorde commented Sep 22, 2023

I can easily reproduce this crash now...: because the Properties dialog can be opened from the DSM, and it is NOT bound to it, you can open several layer properties windows.

So to reproduce the crash/LWP:

  • open DSM
  • go to Geopackage, open the Layer Properties
  • do that again for same layer
  • close the DSM
  • (note that you still have 2 layer properties dialogs floating around
  • close QGIS
  • Crash/LWP

@rduivenvoorde
Copy link
Contributor Author

Mmm no need to open the DSM dialog for this, I can also make QGIS crash by opening Layer Properties twice from the normal Browser panel.

  • open Layer properties from Browser panel of a gpkg layer
  • again: open a second layer properties window from the same layer/browser panel
  • with these 2 windows open, close QGIS
  • crash (without debug trace though):
src/core/providers/ogr/qgsogrconnpool.cpp:39 : (QgsOgrConnPool) [0ms] Leaving.
QGIS died on signal 11src/app/qgscrashhandler.cpp:71 : (handleCrash) [0ms] /tmp/qgis-crash-info-557147
/home/richard/bin/qgis: line 28: 557147 Segmentation fault      /home/richard/bin/qgis_/master/debug/bin/qgis "$@"

I'm on e5e6a13671

@alexbruy alexbruy removed the Feedback Waiting on the submitter for answers label Sep 22, 2023
@rduivenvoorde
Copy link
Contributor Author

I can reproduce this on Windows too. Testing 3.28 in an old VM, I see crashes in the Event log

image

@rduivenvoorde
Copy link
Contributor Author

Should I create a new Issue for this?

@alexbruy
Copy link
Contributor

IMHO better to create another ticket about crash, but I'm also ok with leaving this.

@rduivenvoorde
Copy link
Contributor Author

Downloaded a fresh Lima QGIS on windows, also get it to crash by opening 2 Layer Property dialogs from the browser:

User Feedback

Double opening of LayerProperties in Browser, and then closing QGIS (with 2 open LayerProperties dialog).

Report Details

Python Stack Trace

Windows fatal exception: access violation

Current thread 0x000029f0 (most recent call first):
<no Python frame>

Stack Trace


CPLODBCDriverInstaller::RemoveDriver :
QgsOgrProviderUtils::GDALCloseWrapper :
QgsOgrProviderUtils::releaseInternal :
QgsOgrProviderUtils::release :
QgsGeoPackageProjectStorage::type :
QgsPrecalculatedTextMetrics::count :
QgsPrecalculatedTextMetrics::count :
QgsPrecalculatedTextMetrics::count :
QgsVectorLayer::~QgsVectorLayer :
QgsDataDefinedSizeLegendWidget::~QgsDataDefinedSizeLegendWidget :
QgsBrowserPropertiesDialog::QgsBrowserPropertiesDialog :
QObjectPrivate::deleteChildren :
QWidget::~QWidget :
QgsHandleBadLayers::setFilename :
QObjectPrivate::deleteChildren :
QWidget::~QWidget :
pdal::operator< :
main :
BaseThreadInitThunk :
RtlUserThreadStart :

QGIS Info
QGIS Version: 3.32.3-Lima
QGIS code revision: 67d4610
Compiled against Qt: 5.15.3
Running against Qt: 5.15.3
Compiled against GDAL: 3.7.2
Running against GDAL: 3.7.2

System Info
CPU Type: x86_64
Kernel Type: winnt
Kernel Version: 10.0.22621

@nyalldawson nyalldawson self-assigned this Oct 3, 2023
nyalldawson added a commit to nyalldawson/QGIS that referenced this issue Oct 3, 2023
These must be deleted before calling QgsApplication::exitQgis,
or we get a crash

Fixes qgis#39094
3nids pushed a commit that referenced this issue Oct 3, 2023
These must be deleted before calling QgsApplication::exitQgis,
or we get a crash

Fixes #39094
nyalldawson added a commit to nyalldawson/QGIS that referenced this issue Oct 3, 2023
These must be deleted before calling QgsApplication::exitQgis,
or we get a crash

Fixes qgis#39094

(cherry picked from commit d2ee3eb)
nyalldawson added a commit that referenced this issue Oct 6, 2023
These must be deleted before calling QgsApplication::exitQgis,
or we get a crash

Fixes #39094

(cherry picked from commit d2ee3eb)
nyalldawson added a commit that referenced this issue Oct 27, 2023
These must be deleted before calling QgsApplication::exitQgis,
or we get a crash

Fixes #39094

(cherry picked from commit d2ee3eb)
nyalldawson added a commit that referenced this issue Oct 28, 2023
These must be deleted before calling QgsApplication::exitQgis,
or we get a crash

Fixes #39094

(cherry picked from commit d2ee3eb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption Data Source Manager QGIS Browser
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants