-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Segfault on adding TopoGeometry column #21807
Comments
Author Name: Sandro Santilli (@strk) It's actually easy to reproduce for me. Just start qgis, select a TopoGeometry column (not registered in topology.layer) and "Add" --> crash.
|
Author Name: Sandro Santilli (@strk) I don't know if this could be related: src/providers/postgres/qgspostgresconn.cpp: 903: (PQexec) [0ms] Not logged erroneous query: SELECT styleQML FROM layer_styles WHERE f_table_catalog |
Author Name: Jürgen Fischer (@jef-n)
|
Author Name: Giovanni Manghi (@gioman)
|
Author Name: Sandro Santilli (@strk) To reproduce: createdb bug13781 Then start qgis, Add PostGIS Layer, select public.t2, "Add". |
Author Name: Sandro Santilli (@strk) Debug log seems interesting: src/providers/postgres/qgspgtablemodel.cpp: 379: (layerURI) [16593ms] returning uri dbname='bug13781' port=5493 sslmode=disable key='""' srid=0 type=MultiPoint table="public"."t2" (tg) sql= |
Author Name: Sandro Santilli (@strk) I see that QgsPostgresProvider::QgsPostgresProvider has lots of early returns. The crash happens because a QgsPostgresProvider does not have an associated connection (possibly due to these early returns). Another bit of the output log shows this is a case of early return: src/providers/postgres/qgspostgresprovider.cpp: 2847: (getGeometryDetails) [0ms] Spatial column type is TopoGeometry |
Author Name: Sandro Santilli (@strk) Should a failed construction throw an exception rather than building partially ? |
Author Name: Sandro Santilli (@strk) Found the issue: while mValid member is initialized to false, the call to QgsPostgresProvider::getGeometryDetails() sets it to true, then the "invalid PostgreSQL topology layer" condition fails to set it back to false |
Author Name: Sandro Santilli (@strk) Confirmed, setting mValid=false when disconnecting the DB fixes this crash.
|
Author Name: Sandro Santilli (@strk) Fixed in changeset "54cf972ac2334451e69d2171cc4f3e42da3880df".
|
Author Name: Sandro Santilli (@strk) Still needs to be fixed in trunk
|
Author Name: Sandro Santilli (@strk) Fixed in changeset "65fb72a958c0d0cb0edce9c974cb6b2720d483b4".
|
Author Name: Sandro Santilli (@strk)
Original Redmine Issue: 13781
Affected QGIS version: 2.8.3
Assignee: Sandro Santilli
I'm not sure exactly what triggered this, anyway, here's a backtrace:
The text was updated successfully, but these errors were encountered: