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

QGis 3.10.2 crashes when displaying two PostGIS raster layers #34456

Closed
Veence opened this issue Feb 13, 2020 · 6 comments
Closed

QGis 3.10.2 crashes when displaying two PostGIS raster layers #34456

Veence opened this issue Feb 13, 2020 · 6 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption Feedback Waiting on the submitter for answers

Comments

@Veence
Copy link

Veence commented Feb 13, 2020

Guys,
After loading two PostGIS raster layers and tinkering a bit with their symbology, each time I zoom in or out QGIS crashes with that message:

Qgis3(98042,0x700004632000) malloc: double free for ptr 0x7fc495453e00

Of course the actual address changes, but the reason remains the same.

Forensic examination of the stack suggests this is a problem in proj –

Thread 13 Crashed:: Thread (pooled)
0   libsystem_kernel.dylib        	0x00007fff5ea092c2 __pthread_kill + 10
1   libsystem_pthread.dylib       	0x00007fff5eac4bf1 pthread_kill + 284
2   libsystem_c.dylib             	0x00007fff5e9736a6 abort + 127
3   libsystem_malloc.dylib        	0x00007fff5ea82077 malloc_vreport + 545
4   libsystem_malloc.dylib        	0x00007fff5ea9ae0d malloc_zone_error + 183
5   libproj.15.dylib              	0x000000010a7051f8 std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::operator=(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&) + 54
6   libproj.15.dylib              	0x000000010a704f8c proj_as_wkt + 527
7   org.qgis.qgis3_core           	0x000000010820f448 QgsCoordinateReferenceSystem::toWkt(QgsCoordinateReferenceSystem::WktVariant, bool, int) const + 588
8   org.qgis.qgis3_core           	0x0000000108249d4c QgsCoordinateTransform::setFromCache(QgsCoordinateReferenceSystem const&, QgsCoordinateReferenceSystem const&, QString const&) + 236

But I'm still posting this here in case there's something wrong with QgsCoordinateReferenceSystem::toWkt(QgsCoordinateReferenceSystem::WktVariant, bool, int). If you deem this irrelevant, please ignore.

@Veence Veence added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Feb 13, 2020
@roya0045
Copy link
Contributor

Please provide information about your qgis (about section).

@Veence
Copy link
Author

Veence commented Feb 14, 2020

Sure, here it is!

QGIS version | 3.10.2-A Coruña |
QGIS code branch | Release QGIS code branch.3
Compiled against Qt | 5.14.1 | Running against Qt | 5.14.1
Compiled against GDAL/OGR | 3.0.3 | Running against GDAL/OGR | 3.0.3
Compiled against GEOS | 3.8.0-CAPI-1.13.1 | Running against GEOS | 3.8.0-CAPI-1.13.1
Compiled against SQLite | 3.31.1 | Running against SQLite | 3.31.1
PostgreSQL Client Version | 12.1 | SpatiaLite Version | 5.0.0-beta0
QWT Version | 6.1.4 | QScintilla2 Version | 2.11.2
Compiled against PROJ | 6.3.0 | Running against PROJ | Rel. 6.3.0, January 1st, 2020
OS Version | macOS Mojave (10.14)
Active python plugins | quick_map_services; Climb; processing; db_manager

@gioman
Copy link
Contributor

gioman commented Feb 14, 2020

@Veence please try qgis master, there have been changes about postgis rasters. If possible also add the two postgis rasters as table dumps.

@gioman gioman added Feedback Waiting on the submitter for answers Crash/Data Corruption labels Feb 14, 2020
@Veence
Copy link
Author

Veence commented Feb 14, 2020

@gioman
Ciao Giovanni,

I have been tinkering with the rasters, and the bug seems to have gone away. The key thing was to change the georeferencing of one raster. The one I changed had a positive scaleY while the other had a negative scaleY, and both had the same SRID (2154). I regenerated the first raster with a negative scaleY parameter in ST_AsRaster, and everything seems to be fine right now. However, I can have a go at it using the current version of QGis if need be. It’s a matter of a few seconds to recreate the original raster that caused the bug. Tell me.

Nel frattempo buon weekend!

@gioman
Copy link
Contributor

gioman commented Feb 15, 2020

However, I can have a go at it using the current version of QGis

@Veence yes please

t’s a matter of a few seconds to recreate the original raster that caused the bug. Tell me.

it would be important to have here attached the original rasters that caused the crash, in a ideal world QGIS should never crash.

@rouault
Copy link
Contributor

rouault commented May 26, 2020

I strongly believe this bug was fixed by

commit 8a7109163a9362af2a5e0187cf2b57fc0219fe59
Author: Nyall Dawson <nyall.dawson@gmail.com>
Date:   Tue Jan 21 11:21:14 2020 +1000

    Fix crash in rendering on proj 6 builds
    
    Ensure PJ* objects are never reused across threads.
    
    Fixes #33902

which landed in 3.10.3 in the LTR. Previously proj_as_wkt() could potentially be called on the same CRS object from several threads simultaneously, which would lead to the crash stack of this report

@rouault rouault closed this as completed May 26, 2020
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 Feedback Waiting on the submitter for answers
Projects
None yet
Development

No branches or pull requests

4 participants