qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.68k stars 3.02k forks source link

QGIS crash showing raster symbology in layer properties #39693

Closed luipir closed 4 years ago

luipir commented 4 years ago

Describe the bug QGIS crash showing raster symbology in layer properties

How to Reproduce

  1. add a raster into the project
  2. Double click on the added layer to open layer properties
  3. Click on Symbology => crash

Not F7 works correctly

QGIS and OS versions

QGIS version 3.16.0-Hannover QGIS code revision 43b64b13f3
Compiled against Qt 5.9.5 Running against Qt 5.9.5
Compiled against GDAL/OGR 2.2.3 Running against GDAL/OGR 2.2.3
Compiled against GEOS 3.7.1-CAPI-1.11.1 Running against GEOS 3.7.1-CAPI-1.11.1 27a5e771
Compiled against SQLite 3.22.0 Running against SQLite 3.22.0
PostgreSQL Client Version 13.0 (Ubuntu 13.0-1.pgdg18.04+1) SpatiaLite Version 4.3.0a
QWT Version 6.1.3 QScintilla2 Version 2.10.2
PROJ.4 Version 493
OS Version Ubuntu 18.04.5 LTS This copy of QGIS writes debugging output.
Active python plugins plugin_reloader; IPyConsole; remotedebug; Qgis2threejs; db_manager; processing; MetaSearch

Additional context

luipir commented 4 years ago

definetively I need a processing farm where to do parallel compilation... crash happen applying some commit between 7854c61 and ecc6bfcd7a (bubble debugging ;) )

PedroVenancio commented 4 years ago

Is the standalone installer coming with the outdated QT or is this only the osgeo install? I assume its only the osgeo one.

No, I have the standalone and the crash

QGIS version 3.16.0-Hannover QGIS code revision 43b64b13f3
Compiled against Qt 5.11.2 Running against Qt 5.11.2
Compiled against GDAL/OGR 3.1.4 Running against GDAL/OGR 3.1.4
Compiled against GEOS 3.8.1-CAPI-1.13.3 Running against GEOS 3.8.1-CAPI-1.13.3
Compiled against SQLite 3.29.0 Running against SQLite 3.29.0
PostgreSQL Client Version 11.5 SpatiaLite Version 4.3.0
QWT Version 6.1.3 QScintilla2 Version 2.10.8
Compiled against PROJ 6.3.2 Running against PROJ Rel. 6.3.2, May 1st, 2020
OS Version Windows 10 (10.0)
luipir commented 4 years ago

seems this is the commit affecting the crash... there is a before and after this one 35d62ab0d47fa309b2de8fdad3aab66836b32585

gioman commented 4 years ago

seems this is the commit affecting the crash... there is a before and after this one 35d62ab

@luipir can you ping the author explaining your findings? @DelazJ

nirvn commented 4 years ago

@luipir , thanks for having taken the time and CPU cycles to narrow it down to this commit. Seeing daily reports on this has been alarming.

luipir commented 4 years ago

@DelazJ I hadn't time to do a revert and check side effect... btw not yet investigated what is the cause of the issue

nirvn commented 4 years ago

@luipir , @DelazJ , we need to fix this prior 3.16.1 release (in ~9 days). It seems the short term solution here would be to revert https://github.com/qgis/QGIS/commit/35d62ab0d47fa309b2de8fdad3aab66836b32585 for 3.16.1 and revisit whenever someone has free time to diagnose what went wrong to begin with.

( ping @nyalldawson )

DelazJ commented 4 years ago

Hi, I couldn't get the crash locally (I'm on focal) on master and 3.16 compiling is underway. But since I'm unable to understand half of the log messages above, I just revert the changes, only the ones related to the raster layer properties, to begin with. See #39879 The suspected commit was supposed to address only visual issues so I'm surprised it generated such a mess. Sorry!

Same problem for my even when I try to open Settings>Options (to paste here the info of my configuration).

I also revert raster changes in the Options dialog

roya0045 commented 4 years ago

@DelazJ try to compile with qt 5.11, this seems to be important as qt5.12 seems fine. @nirvn could it be possibly to simply update qt version or is this a thing only for more important release?

luipir commented 4 years ago

@luipir , @DelazJ , we need to fix this prior 3.16.1 release (in ~9 days). It seems the short term solution here would be to revert 35d62ab for 3.16.1 and revisit whenever someone has free time to diagnose what went wrong to begin with.

( ping @nyalldawson )

first test cherry-piking your two commits 634d8bf2c652894e398bac22989e94b3ef5838fd and e3e2577097e4507344c39e455ea52a09d4fb44e6 applied on fd9b11d (upstream/release-3_16) does not solve the issue... I'll try to do a complete revert of that commit

luipir commented 4 years ago

a compete revert of 35d62ab on fcafb2716bb4afebccb7f2db93eb9aac00fe120f (upstream/release-3_16) solve the crash :|... at leat in my installation.

luipir commented 4 years ago

The problem to do a revert without knowing the origin of the problem and to implement a relative test is that: 1) we do not know if happen in other installation and qt combination 2) we can face the issue later So a revert would be just an emergency (and under observation) measure

nirvn commented 4 years ago

Revert the cause of a known crasher that's reported near-daily -> +1 :)

luipir commented 4 years ago

Revert the cause of a known crasher that's reported near-daily -> +1 :)

I leave next step to you

soraimperial commented 4 years ago

Experiencing similar problems, as mentioned, #39917 and #39823. Single click on some menus (docked processing toolbox , intersect, dissolve, Map Tools, Merge Layers) and double click sometimes on proprieties and symbology (less common, but I'm not working raster atm anyway).

I wonder if somehow a translation could impact it? Clean profile, tested it and apparently stopped crashing. Apply american english language (from OS Portuguese, only change I did to clean profile) and apparently the problems return? But only sometimes??

The crashes are so random that it is hard to figure out. Since opening #39917, I have been working for two hours without a single crash, using mostly the tools that did lead to a crash before, on my own profile (not a new one, since it seemed to crash more like that). Everything working right, while all during the weekend, I couldn't perform a single action without crashing, except on blank profile.

QT 5.11.2 as well. And qgis 3.14 at first did not replicate these issues, but I have then since been having them also in 3.14 today.

luipir commented 4 years ago

BINGO! we probably have a fix! @nirvn found the QT issue that probably is the base of the issue https://bugreports.qt.io/browse/QTBUG-69204 and reading the qt patch here: https://codereview.qt-project.org/c/qt/qtbase/+/242929/7/src/widgets/styles/qstylesheetstyle.cpp#2913 I had the idea to invalidate styleSheet cache just before applying the new style... just doing setStyleSheet("") before the applying style and it works :)

luipir commented 4 years ago

The moain problem now is do it only in QgsCollapsibleGroupBox.cpp and specifically only inside void QgsCollapsibleGroupBoxBasic::updateStyle() or do it in every play where setStyleSheet is applied (145 times in qgis code)? And it should depend on qte version used

nirvn commented 4 years ago

I say go conservative, only fix what cause crashes on 5.9.

luipir commented 4 years ago

I say go conservative, only fix what cause crashes on 5.9. QT patch is applied to 5.12.4

IMHO should be:

#if QT_VERSION < QT_VERSION_CHECK(5, 12, 4)
      setStyleSheet( "" );
#endif

we had report of crash with qt 5.11 in this thread

luipir commented 4 years ago

sorry close button too near to comment ;)

nirvn commented 4 years ago

@luipir , sounds good -- go for it.

roya0045 commented 4 years ago

@luipir @nirvn Great work guys!

gastgit commented 4 years ago

hi, apologize in advance for asking here, but how do I fix this issue? can someone point to a link w/ instructions? I have qgis 3.16 on ubuntu18.04 with qt 5.9.5 and would like not to compile from source, but just use apt-get. Do I need to add deb https://qgis.org/ubuntu-nightly-release bionic main to my sources and reinstall with sudo apt-get install qgis python3-qgis qgis-plugin-grass ?

or install newer Qt version from here https://launchpad.net/~beineri/+archive/ubuntu/opt-qt-5.14.2-bionic which installs in /opt, but then point qgis to this newer Qt? How does one point qgis to a different Qt installation?

Again apologies for asking here... I didn't find a coherent explanation elsewhere

Tnx!

gioman commented 4 years ago

apologize in advance for asking here, but how do I fix this issue?

@gastgit you compile the code with the fix or you wait the next round of minor/point releases (pr also you stick with the LTR version, 3.10).

gastgit commented 4 years ago

Tnx @gioman When I try to use the sources: deb https://qgis.org/ubuntu-ltr bionic main deb-src https://qgis.org/ubuntu-ltr bionic main

I have a whole host of broken dependencies. When I add deb https://qgis.org/ubuntugis/ bionic main deb-src https://qgis.org/ubuntugis/ bionic main

Installation goes smoothly but it installs 3.16. How can I install 3.10 ? Tx

jef-n commented 4 years ago

Installation goes smoothly but it installs 3.16. How can I install 3.10 ?

Install from http://qgis.org/ubuntugis-ltr, if you updated packages from ubuntugis and want to keep them or downgrade back to the vanilla ubuntu versions and use ubuntu-ltr.

gastgit commented 4 years ago

Tnx @jef-n for your assistance I replaced deb https://qgis.org/ubuntugis bionic main deb-src https://qgis.org/ubuntugis bionic main

with

deb https://qgis.org/ubuntugis-ltr bionic main deb-src https://qgis.org/ubuntugis-ltr bionic main

and still got broken dependencies that did not show up when I was able to install the 3.16 version with http://qgis.org/ubuntugis/