Bug report #5251

if "Options -> CRS -> coordinate reference system for new layers" is set "prompt for CRS" then creating QgsVectorLayer from different thread crashes QGIS

Added by Aníbal Pacheco over 7 years ago. Updated over 6 years ago.

Status:Closed
Priority:Severe/Regression
Assignee:-
Category:-
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed
Crashes QGIS or corrupts data:Yes Copied to github as #:14985

Description

Using master installed following https://issues.qgis.org/projects/quantum-gis/wiki/Download
Platform and platform version are specified on this issue metadata.
(2 shapefiles for sample data are attached)
Output when trying to merge:

$ qgis
Warning: loading of qgis translation failed [/usr/share/qgis/i18n//qgis_en_US]
Warning: loading of qt translation failed [/usr/share/qt4/translations/qt_en_US]
Warning: QPixmap: It is not safe to use pixmaps outside the GUI thread
Warning: QPixmap: It is not safe to use pixmaps outside the GUI thread
Warning: QPixmap: It is not safe to use pixmaps outside the GUI thread
Warning: QPixmap: It is not safe to use pixmaps outside the GUI thread
Warning: QPixmap: It is not safe to use pixmaps outside the GUI thread
Warning: qgis.bin: Fatal IO error: client killed

sample_shapefiles.tgz (300 KB) Aníbal Pacheco, 2012-03-28 11:45 AM


Related issues

Related to QGIS Application - Bug report #5962: "Merge Shapefile to one" crashes QGIS if .prj files are m... Closed 2012-07-06

Associated revisions

History

#1 Updated by Alexander Bruy over 7 years ago

  • Category set to 44
  • Assignee set to Alexander Bruy

#2 Updated by Giovanni Manghi over 7 years ago

  • Status changed from Open to Feedback

The cause can be the lack of .prj files. I tested on Windows and it crashed at the first attempt, then I fixed the shapes by adding the .prj files, run again the operation and it went well. Can you give it a try too?

#3 Updated by Aníbal Pacheco over 7 years ago

Yes, it worked well for me too after setting the projection

#4 Updated by Giovanni Manghi over 7 years ago

  • Subject changed from Merge shapefiles into one kills QGis to "Merge shapefiles to one" tool causes QGIS to crash if shapes are missing the .prj file

#5 Updated by Giovanni Manghi over 7 years ago

  • Crashes QGIS or corrupts data changed from No to Yes

#6 Updated by Alexander Bruy over 7 years ago

Well, the problem is not in Merge shapefiles to one. And not in the lack of .prj file (at least this is not main issue). The problem is that now QGIS by default asks for layer CRS when new new layer created or loaded (as requested in #4432). Seems that calling CRS selector from thread causes crash.

When I set "Coordinate Reference System for new layers" to "Use default CRS listed below" or to "Use project CRS" Merge shapefiles works fine even if there is no .prj file. So I think we can close this ticket and maybe open another about restoring previous default settings "Use default CRS listed below" because current settings is a source of many problems, for example see #4379, #4377 and other related tickets

#7 Updated by Aníbal Pacheco over 7 years ago

When you choose the whole directory (default) the CRS selector dialog popups well for each shapefile in the directory, but after select the CRS for the last shapefile QGIS crashes.

#8 Updated by Giovanni Manghi over 7 years ago

Alexander Bruy wrote:

So I think we can close this ticket and maybe open another about restoring previous default settings "Use default CRS listed below" because current settings is a source of many problems, for example see #4379, #4377 and other related tickets

Hi Alexander, I would not prefer to restore "Use default CRS listed below" because the lack of a explicit CRS (tiff+worldfile, missing .prj in shapes, etc.) is a source of a lot of confusion among inexperienced users when they add layers to a project. Moreover a user can always change the QGIS options as are now, so it would be always better to fix this issue rather than workaround it. Just my 2c :)

cheers

#9 Updated by Alexander Bruy over 7 years ago

Ok, but IMHO this is not an fTools issue. As I can see crash occurred during initialization of QgsVectorLayer object

#10 Updated by Giovanni Manghi over 7 years ago

Alexander Bruy wrote:

Ok, but IMHO this is not an fTools issue. As I can see crash occurred during initialization of QgsVectorLayer object

ok right, so a new ticket should be filed.

#11 Updated by Giovanni Manghi over 7 years ago

Alexander Bruy wrote:

Ok, but IMHO this is not an fTools issue. As I can see crash occurred during initialization of QgsVectorLayer object

Hi Alex, can you please file the proper ticket or change the title and description of this one? thanks.

#12 Updated by Alexander Bruy over 7 years ago

  • OS version deleted (oneiric)
  • Operating System changed from ubuntu to all
  • Subject changed from "Merge shapefiles to one" tool causes QGIS to crash if shapes are missing the .prj file to if "Options -> CRS -> coordinate reference system for new layers" is set "prompt for CRS" then creating QgsVectorLayer from different thread crashes QGIS

#13 Updated by Alexander Bruy over 7 years ago

  • Category deleted (44)
  • Assignee deleted (Alexander Bruy)

#14 Updated by Jürgen Fischer about 7 years ago

should have been fixed with commit:fdb2475d

#15 Updated by Giovanni Manghi about 7 years ago

Jürgen Fischer wrote:

should have been fixed with commit:fdb2475d

is this fix part of qgis 1.8? if yes then it seems that somehow is still affected, see #5962

#16 Updated by Paolo Cavallini about 7 years ago

  • Target version set to Version 2.0.0

#17 Updated by Giovanni Manghi almost 7 years ago

  • Resolution set to fixed
  • Status changed from Feedback to Closed

Definitely works on master.

#18 Updated by Gerhard Spieles almost 7 years ago

  • Status changed from Closed to Reopened

Hello Giovanni,

just tested it with master 29e009f.
QGis-dev.exe crash.

#19 Updated by Giovanni Manghi almost 7 years ago

  • Operating System deleted (all)
  • Resolution deleted (fixed)

gespiel - wrote:

Hello Giovanni,

just tested it with master 29e009f.
QGis-dev.exe crash.

ok, I will try on Windows too asap.

#20 Updated by Giovanni Manghi over 6 years ago

  • Priority changed from Normal to High

Jürgen Fischer wrote:

should have been fixed with commit:fdb2475d

still crashes master on both windows and linux.

#21 Updated by Giovanni Manghi over 6 years ago

probable duplicate of #5962

#22 Updated by Giovanni Manghi over 6 years ago

  • Priority changed from High to Severe/Regression

this should be a regression, so it is a blocker.

#23 Updated by Jürgen Fischer over 6 years ago

  • Status changed from Reopened to Closed

#24 Updated by Giovanni Manghi over 6 years ago

  • Resolution set to fixed

Also available in: Atom PDF