-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Dbmanager causes QGIS to crash when trying to open Postgres db #38393
Comments
I also see this crash -- it's caused by #38262 |
@nyalldawson @rduivenvoorde I tried but I can't reproduce. |
I did do some further testing, to me it looks like th 'enumValue'-function is the culprit? The following all works in the python console:
But both
lead to an immidiate QGIS crash I tried to set a 0 as default, but that has typing errors:
|
Mmm, Tested on a Windows laptop here with osgeo4w: QGIS code revision 0bd81d27c6 Cannot reproduce it there The I trashed my build dir on my work/build laptop AND my install dirs and tried again: still crashing.
|
I tried to catch the exception by doing this in QtCreator, but (see screendump) it is not something I can debug... To me it looks like something is indeed going wrong within the python/c++ world around getting the key/value from some settings object. But this is going over my head, so I do not think I can be helpfull in this... |
Watching. I'm also getting this crash, and manually changing /usr/share/qgis/python/plugins/db_manager/db_plugins/postgis/plugin.py , line 87, from
to
effectively reverting #38262 makes it work again for me. It had crashed on me when connecting with a configured pg_service. |
I can confirm. I'm on Debian sid. Can I be more helpful? |
Investigating this. For me, But doing:
does crash for me on any sip version. Actually calling any method on the meta enum leads to crash (isValid, name, valueToKey). I have identified a crash in the past (https://github.com/qgis/QGIS/blob/master/python/core/additions/qgssettings.py#L48). I tried but we cannot make a deep copy on meta enums. I would need to investigate a bit more, but I suspect PyQt is also involved in the issue. |
@3nids thank you for looking at this! I suspected there was a SIP issue. I tested SIP 4.19.19 here with no crashes. |
Just tested 'sip -V' returns 4.19.24 with me (and crashing) Would it be helpfull to have that SIP version in the About box (where all those versions are)? (and also thanks from me! These are hard things to investigate/fix) |
what crashes?
Yes! |
Both:
and
and
|
There is something wrong about accessing the meta enum from static meta object I guess.
leads to a crash after ~7 iterations for me... |
I sent a request on PyQt mailing list (https://www.riverbankcomputing.com/pipermail/pyqt/2020-September/043153.html) but I have little hope this leads to a solution. @elpaso do you see any harm in reverting the commit causing the issue? |
I think the question is if my commit #38262 is a correct usage of the new API or not. If it is not correct you may revert it and explain how the original issue could be solved without using the If it is correct then we have a problem with the new enum API and we should fix or revert that API. The rationale is that we will have eventually have more and more adoption of the new enum API by plugin writers and if that API leads to random crashes it can be a real pain for everyone. |
Same problem here with Pop_OS! 20.04 and master. |
I have same issue on latest nightly master build with MacOS Catalina. QGIS version: 3.15.0 (qgis_nightly_master_20201008_122909.dmg | 08-Oct-2020 19:35) Apple crash log Process: QGIS [72464]Path: /Applications/QGIS.app/Contents/MacOS/QGIS Date/Time: 2020-10-12 11:01:05.344 +0100 System Integrity Protection: enabled Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_CRASH (SIGABRT) Application Specific Information: Thread 0 Crashed:: Dispatch queue: com.apple.main-thread |
This reverts commit 26e9ec9. It results in unfixable crashes on many platforms, likely due to some issue in sip itself Fixes qgis#38393, reopens qgis#38245 The original bug (being asked twice for credentials) is preferable over a hard crash
To reproduce:
(I'm on Debian testing here, QGIS master self compiled)
select postgis_full_version() gives me
POSTGIS="3.0.2 r2fb2a18" [EXTENSION] PGSQL="120" GEOS="3.8.1-CAPI-1.13.3" PROJ="7.1.0" LIBXML="2.9.10" LIBJSON="0.15" LIBPROTOBUF="1.3.3" WAGYU="0.4.3 (Internal)" (core procs from "3.0.0 r17983" need upgrade)
select version() gives me
PostgreSQL 12.3 (Debian 12.3-1+b1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 9.3.0-13) 9.3.0, 64-bit
stacktrace below:
../src/core/qgsdataitem.cpp:956 : (~QgsDataCollectionItem) [20ms] mName = localhost mPath = pg:/localhost
../src/core/qgsdataitem.cpp:266 : (~QgsDataItem) [0ms] mName = localhost mPath = pg:/localhost mChildren.size() = 0
../src/core/qgsdataitem.cpp:266 : (~QgsDataItem) [0ms] mName = OpenStreetMap mPath = xyz:/OpenStreetMap mChildren.size() = 0
../src/core/qgsdataitem.cpp:956 : (~QgsDataCollectionItem) [0ms] mName = localhost mPath = pg:/localhost
../src/core/qgsdataitem.cpp:266 : (~QgsDataItem) [0ms] mName = localhost mPath = pg:/localhost mChildren.size() = 0
../src/core/qgsdataitem.cpp:266 : (~QgsDataItem) [0ms] mName = OpenStreetMap mPath = xyz:/OpenStreetMap mChildren.size() = 0
QGIS died on signal 11[New LWP 120929]
[New LWP 120930]
[New LWP 120931]
[New LWP 120932]
[New LWP 120934]
[New LWP 120935]
[New LWP 120936]
[New LWP 120937]
[New LWP 120944]
[New LWP 120945]
[New LWP 120950]
[New LWP 120951]
[New LWP 120967]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007f0355df92c7 in __GI___wait4 (pid=120984, stat_loc=0x7ffdbada0114, options=0, usage=0x0) at ../sysdeps/unix/sysv/linux/wait4.c:27
27 ../sysdeps/unix/sysv/linux/wait4.c: No such file or directory.
[Current thread is 1 (Thread 0x7f034501af40 (LWP 120921))]
#0 0x00007f0355df92c7 in _GI___wait4 (pid=120984, stat_loc=0x7ffdbada0114, options=0, usage=0x0) at ../sysdeps/unix/sysv/linux/wait4.c:27
#1 0x00005635749cc257 in qgisCrash(int) (signal=11) at ../src/app/main.cpp:349
status = 32514
pidstr = "--pid=120921\000\177\000\000\020\377ٺ\375\177\000\000\224\210\365\340\002\177\000"
gdbpid = 120984
exename = "/home/richard/bin/qgis/master/debug/bin/qgis", '\000' <repeats 35 times>, "
\322\b{5V\000\000\300\256\067\350\002\177\000\000\000\000\000\000\000\000\000\000\300\070\035\350\002\177\000\000\000\000\000\000\000\000\000\000\230m\360D\003\177\000\000\000\000\000\000\000\000\000\000
\322\b{5V\000\000\030\000ں\375\177\000\000\000}\246\370\031\354R.\020", '\000' <repeats 15 times>, "\300\357\361D\003\177\000\000\000}\246\370\031\354R.\300\322\005{5V\000\000\340"...len = 45
#2 0x00007f0355d69e30 in () at /lib/x86_64-linux-gnu/libc.so.6
#3 __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:65
#4 0x00007f02e81ee3b9 in () at /usr/lib/python3/dist-packages/PyQt5/QtCore.cpython-38-x86_64-linux-gnu.so
#5 0x00007f02e0f589c7 in () at /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0
#6 0x00007f02e0f59817 in _PyObject_MakeTpCall () at /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0
#7 0x00007f02e0f34cd3 in () at /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0
#8 0x00007f02e0f328f9 in _PyEval_EvalFrameDefault () at /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0
#9 0x00007f02e1031ebf in _PyEval_EvalCodeWithName () at /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0
#10 0x00007f02e0f58b61 in _PyFunction_Vectorcall () at /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0
#11 0x00007f02e0f5a79a in () at /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0
#12 0x00007f02e0f34c4d in () at /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0
#13 0x00007f02e0f328f9 in _PyEval_EvalFrameDefault () at /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0
#14 0x00007f02e1031ebf in _PyEval_EvalCodeWithName () at /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0
#15 0x00007f02e0f58b61 in _PyFunction_Vectorcall () at /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0
#16 0x00007f02e0f5a79a in () at /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0
#17 0x00007f02e0f34c4d in () at /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0
#18 0x00007f02e0f328f9 in _PyEval_EvalFrameDefault () at /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0
#19 0x00007f02e0f2a073 in () at /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0
#20 0x00007f02e0f5a79a in () at /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0
#21 0x00007f02e0f34c4d in () at /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0
#22 0x00007f02e0f328f9 in _PyEval_EvalFrameDefault () at /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0
#23 0x00007f02e1031ebf in _PyEval_EvalCodeWithName () at /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0
#24 0x00007f02e0f58b61 in _PyFunction_Vectorcall () at /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0
#25 0x00007f02e0f5a79a in () at /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0
#26 0x00007f02e0f34c4d in () at /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0
#27 0x00007f02e0f328f9 in _PyEval_EvalFrameDefault () at /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0
#28 0x00007f02e0f2a073 in () at /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0
#29 0x00007f02e0f5a713 in () at /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0
#30 0x00007f02e0f5913c in PyVectorcall_Call () at /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0
#31 0x00007f0344f07dda in () at /usr/lib/python3/dist-packages/sip.cpython-38-x86_64-linux-gnu.so
#32 0x00007f0344f08009 in () at /usr/lib/python3/dist-packages/sip.cpython-38-x86_64-linux-gnu.so
#33 0x00007f02e81498bf in () at /usr/lib/python3/dist-packages/PyQt5/QtCore.cpython-38-x86_64-linux-gnu.so
#34 0x00007f02e8265a60 in () at /usr/lib/python3/dist-packages/PyQt5/QtCore.cpython-38-x86_64-linux-gnu.so
#35 0x00007f03592fa92a in QTreeViewPrivate::layout(int, bool, bool) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#36 0x00007f03592fd504 in QTreeViewPrivate::expand(int, bool) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#37 0x00007f03592fedc6 in QTreeViewPrivate::expandOrCollapseItemAtPos(QPoint const&) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#38 0x00007f03593015ad in QTreeView::mousePressEvent(QMouseEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#39 0x00007f02e07bd003 in () at /usr/lib/python3/dist-packages/PyQt5/QtWidgets.cpython-38-x86_64-linux-gnu.so
#40 0x00007f035907552e in QWidget::event(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#41 0x00007f035911cd4e in QFrame::event(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#42 0x00007f02e07beec3 in () at /usr/lib/python3/dist-packages/PyQt5/QtWidgets.cpython-38-x86_64-linux-gnu.so
#43 0x00007f035859a87b in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#44 0x00007f035903502e in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#45 0x00007f035903a781 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#46 0x00007f0356c84e51 in QgsApplication::notify(QObject*, QEvent*) (this=0x7ffdbada31c0, receiver=0x56357afec2a0, event=0x7ffdbada2220) at ../src/core/qgsapplication.cpp:444
done = true
FUNCTION = "notify"
#47 0x00007f035859ab62 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#48 0x00007f0359039696 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer&, bool, bool) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#49 0x00007f035908d95e in () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#50 0x00007f03590907ae in () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#51 0x00007f035903503f in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#52 0x00007f0356c84e51 in QgsApplication::notify(QObject*, QEvent*) (this=0x7ffdbada31c0, receiver=0x5635776781f0, event=0x7ffdbada25b0) at ../src/core/qgsapplication.cpp:444
done = true
FUNCTION = "notify"
#53 0x00007f035859ab62 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#54 0x00007f035896244b in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#55 0x00007f0358938bfb in QWindowSystemInterface::sendWindowSystemEvents(QFlagsQEventLoop::ProcessEventsFlag) () at /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#56 0x00007f030941db6a in () at /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#57 0x00007f034e4885fd in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#58 0x00007f034e488880 in () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#59 0x00007f034e48890f in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#60 0x00007f03585f02ff in QEventDispatcherGlib::processEvents(QFlagsQEventLoop::ProcessEventsFlag) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#61 0x00007f03585994db in QEventLoop::exec(QFlagsQEventLoop::ProcessEventsFlag) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#62 0x00007f03585a1782 in QCoreApplication::exec() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#63 0x00005635749d3a2f in main(int, char**) (argc=3, argv=0x7ffdbada44d8) at ../src/app/main.cpp:1637
preApplicationLogMessages = {<QList> = {<QListSpecialMethods> = {}, {p = {static shared_null = {ref = {atomic = {_q_value = {<std::__atomic_base> = {static _S_alignment = 4, _M_i = -1}, }}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d = 0x563576c355d0}, d = 0x563576c355d0}}, }
FUNCTION = "main"
mySnapshotFileName = {static null = {}, d = 0x7f035867b8a0 QArrayData::shared_null}
configLocalStorageLocation = {static null = {}, d = 0x563576c379d0}
profileName = {static null = {}, d = 0x563576c37320}
mySnapshotWidth = 800
mySnapshotHeight = 600
myHideSplash = false
settingsMigrationForce = false
mySkipVersionCheck = false
hideBrowser = false
myRestoreDefaultWindowState = false
myRestorePlugins = true
myCustomization = true
dxfOutputFile = {static null = {}, d = 0x7f035867b8a0 QArrayData::shared_null}
dxfSymbologyMode = QgsDxfExport::SymbolLayerSymbology
dxfScale = 50000
dxfEncoding = {static null = {}, d = 0x5635749deb00 <main::{lambda()#2}::operator()() const::qstring_literal>}
dxfMapTheme = {static null = {}, d = 0x7f035867b8a0 QArrayData::shared_null}
dxfExtent = {mXmin = 0, mYmin = 0, mXmax = 0, mYmax = 0}
takeScreenShots = false
screenShotsPath = {static null = {}, d = 0x7f035867b8a0 QArrayData::shared_null}
screenShotsCategories = 0
myInitialExtent = {static null = {}, d = 0x7f035867b8a0 QArrayData::shared_null}
translationCode = {static null = {}, d = 0x563576c3d9d0}
authdbdirectory = {static null = {}, d = 0x7f035867b8a0 QArrayData::shared_null}
pythonfile = {static null = {}, d = 0x7f035867b8a0 QArrayData::shared_null}
customizationfile = {static null = {}, d = 0x563577baa150}
globalsettingsfile = {static null = {}, d = 0x563576c2fb10}
openClProgramFolder = {static null = {}, d = 0x7f035867b8a0 QArrayData::shared_null}
args = {<QList> = {<QListSpecialMethods> = {}, {p = {static shared_null = {ref = {atomic = {_q_value = {<std::__atomic_base> = {static _S_alignment = 4, _M_i = -1}, }}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d = 0x563576c35970}, d = 0x563576c35970}}, }
myUseGuiFlag = true
rootProfileFolder = {static null = {}, d = 0x563576c37e20}
manager = { = {}, static staticMetaObject = {d = {superdata = {direct = 0x7f0358819260 QObject::staticMetaObject}, stringdata = 0x7f03576253c0 <qt_meta_stringdata_QgsUserProfileManager>, data = 0x7f0357625440 <qt_meta_data_QgsUserProfileManager>, static_metacall = 0x7f03567241c8 <QgsUserProfileManager::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>, relatedMetaObjects = 0x0, extradata = 0x0}}, mWatchProfiles = false, mWatcher = std::unique_ptr = {get() = 0x0}, mRootProfilePath = {static null = {}, d = 0x563576c37e20}, mUserProfile = std::unique_ptr = {get() = 0x0}, mSettings = std::unique_ptr = {get() = 0x563576c37480}}
profile = 0x563576c3cdb0
profileFolder = {static null = {}, d = 0x563576c38f20}
myApp = { = {}, static staticMetaObject = {d = {superdata = {direct = 0x7f0359529160 QApplication::staticMetaObject}, stringdata = 0x7f0357611fc0 <qt_meta_stringdata_QgsApplication>, data = 0x7f03576121c0 <qt_meta_data_QgsApplication>, static_metacall = 0x7f035670a3c4 <QgsApplication::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>, relatedMetaObjects = 0x0, extradata = 0x0}}, static QGIS_ORGANIZATION_NAME = 0x7f0357758522 "QGIS", static QGIS_ORGANIZATION_DOMAIN = 0x7f0357758527 "qgis.org", static QGIS_APPLICATION_NAME = 0x7f0357758530 "QGIS3", static mFileOpenEventReceiver31500 = 0x563577c349e0, static mInitialized31500 = true, static mRunningFromBuildDir31500 = false, static sMaxThreads31500 = -1, mIconCache = {d = 0x563576a4eb60}, mCursorCache = {d = 0x563577ec59e0}, mQgisTranslator = 0x563576dfb9d0, mQtTranslator = 0x563576dc0340, mDataItemProviderRegistry = 0x5635771b6be0, mAuthManager = 0x563577213410, mApplicationMembers = 0x563576d590b0, static sApplicationMembers = 0x0, static sAuthManager = 0x0}
settings = { = {}, static staticMetaObject = {d = {superdata = {direct = 0x7f0358819260 QObject::staticMetaObject}, stringdata = 0x7f0357621100 <qt_meta_stringdata_QgsSettings>, data = 0x7f0357621140 <qt_meta_data_QgsSettings>, static_metacall = 0x7f03567200d0 <QgsSettings::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>, relatedMetaObjects = 0x0, extradata = 0x0}}, mUserSettings = 0x563576cd8330, mGlobalSettings = 0x56357703d4c0, mUsingGlobalArray = false}
libPaths = {<QList> = {<QListSpecialMethods> = {}, {p = {static shared_null = {ref = {atomic = {_q_value = {<std::__atomic_base> = {static _S_alignment = 4, M_i = -1}, }}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d = 0x563577be79b0}, d = 0x563577be79b0}}, }
relLibPath = {static null = {}, d = 0x563577ba0940}
customizationsettings = 0x563577bcc860
systemEnvVars = {d = 0x563576ff1260}
useCustomVars = false
desiredStyle = {static null = {}, d = 0x5635749df920 <main::{lambda()#42}::operator()() const::qstring_literal>}
theme = {static null = {}, d = 0x7f035867b8a0 QArrayData::shared_null}
activeStyleName = {static null = {}, d = 0x56357702a530}
mySplashPath = {static null = {}, d = 0x7f0357759680 <QgsApplication::splashPath()::{lambda()#1}::operator()() const::qstring_literal>}
myPixmap =
w = 600
h = 300
mypSplash = 0x5635772418f0
qgis = 0x563577c349e0
sigwatch = { = {}, static staticMetaObject = {d = {superdata = {direct = 0x7f0358819260 QObject::staticMetaObject}, stringdata = 0x563574a203c0 <qt_meta_stringdata_UnixSignalWatcher>, data = 0x563574a20480 <qt_meta_data_UnixSignalWatcher>, static_metacall = 0x5635749da924 <UnixSignalWatcher::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>, relatedMetaObjects = 0x0, extradata = 0x0}}, d_ptr = 0x563577baab00}
retval = 1956774144
[Inferior 1 (process 120921) detached]
gdb returned 0
/home/richard/bin/qgis: line 7: 120921 Aborted /home/richard/bin/qgis/master/debug/bin/qgis "$@"
The text was updated successfully, but these errors were encountered: