Opened 14 years ago

Closed 14 years ago

#2837 closed bug (upstream)

merge shapefiles crashes qgis

Reported by: lutra Owned by: cfarmer
Priority: critical: causes crash or data corruption Milestone: Version 1.5.0
Component: Python plugins and bindings Version: Trunk
Keywords: Cc: alexbruy
Must Fix for Release: No Platform: All
Platform Version: Awaiting user input: no

Description

merging the following shapefiles

under linux (Ubuntu 10.04) causes qgis to crash

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
Segmentation fault

the same operation with the same dataset works fine under Windows Seven.

Using qgis trunk.

Change History (11)

comment:1 by lutra, 14 years ago

sorry, forgot to add the download link

http://www.faunalia.pt/downloads/cart_2.tar.gz

in reply to:  description ; comment:2 by jef, 14 years ago

Replying to lutra:

merging the following shapefiles under linux (Ubuntu 10.04) causes qgis to crash

not reproducable on Debian unstable. Do you have a backtrace?

in reply to:  2 ; comment:3 by jef, 14 years ago

Replying to jef:

not reproducable on Debian unstable. Do you have a backtrace?

oh, any plugins involved?

in reply to:  3 ; comment:4 by jef, 14 years ago

Replying to jef:

oh, any plugins involved?

like SDA4PP?

in reply to:  4 comment:5 by lutra, 14 years ago

Replying to jef:

Replying to jef:

oh, any plugins involved?

like SDA4PP?

I removed SDA4pp and disabled all the other and I still have the crash with the same message

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
Segmentation fault

I'm using the ubuntugis repositories and qgis trunk compiled from source.

comment:6 by alexbruy, 14 years ago

Cc: alexbruy added

Confirmed QGIS crash on Slackware linux. Under Windows XP merging the following files works fine. But on Linux QGIS craches too when I try to open shapefile pen_01.shp. Here is debug output before crash

Debug: /home/alex/devel/cpp/qgis/trunk/src/core/qgsmaprenderer.cpp: 186: (adjustExtentToSize) -24040.6198250000015832,40992.8055770874052541 : -22359.4931749999996100,41256.3346206665009959
Debug: /home/alex/devel/cpp/qgis/trunk/src/core/qgsscalecalculator.cpp: 139: (calculateGeographicDistance) Distance across map extent (m): 1.13268e+07
Debug: /home/alex/devel/cpp/qgis/trunk/src/core/qgsscalecalculator.cpp: 90: (calculate) Using conversionFactor of 39.3701
Debug: /home/alex/devel/cpp/qgis/trunk/src/core/qgsmaprenderer.cpp: 197: (adjustExtentToSize) Scale (assuming meters as map units) = 1:8.82862e+07
Debug: /home/alex/devel/cpp/qgis/trunk/src/gui/qgsmapoverviewcanvas.cpp: 162: (drawExtentRect) panning: extent to widget: [-2147483648,-2147483648] [1x1]
Debug: /home/alex/devel/cpp/qgis/trunk/src/core/qgsmaprenderer.cpp: 212: (render) ========== Rendering ==========
Debug: /home/alex/devel/cpp/qgis/trunk/src/core/qgsmaprenderer.cpp: 236: (render) Starting to render layer stack.
Debug: /home/alex/devel/cpp/qgis/trunk/src/core/qgsmaprenderer.cpp: 323: (render) Rendering at layer item pen_0120100627193701245
Debug: /home/alex/devel/cpp/qgis/trunk/src/core/qgsmaprenderer.cpp: 331: (render) If there is a QPaintEngine error here, it is caused by an emit call
Debug: /home/alex/devel/cpp/qgis/trunk/src/core/qgsmaprenderer.cpp: 342: (render) Rendering layer pen_01
Debug: /home/alex/devel/cpp/qgis/trunk/src/core/qgsmaprenderer.cpp: 343: (render)   Layer minscale 0
Debug: /home/alex/devel/cpp/qgis/trunk/src/core/qgsmaprenderer.cpp: 344: (render)   Layer maxscale 1e+08
Debug: /home/alex/devel/cpp/qgis/trunk/src/core/qgsmaprenderer.cpp: 345: (render)   Scale dep. visibility enabled? 0
Debug: /home/alex/devel/cpp/qgis/trunk/src/core/qgsmaprenderer.cpp: 346: (render)   Input extent: -24000.5930000000007567,40999.0800781250000000 : -22399.5200000000004366,41250.0601196289062500
Debug: /home/alex/devel/cpp/qgis/trunk/src/providers/ogr/qgsogrprovider.cpp: 586: (select) Setting spatial filter using POLYGON((-24040.61982500 40341.74243660, -24040.61982500 41907.39776115, -22359.49317500 41907.39776115, -22359.49317500 40341.74243660, -24040.61982500 40341.74243660))
ERROR 1: Corrupted .shp file : shape 3 : panPartStart[4] = 10, panPartStart[3] = 229
Segmentation fault

Running ogrinfo on this shape produces

bash-3.1$ ogrinfo ~/samples/vector/cart_2/pen_01.shp
INFO: Open of `/home/alex/samples/vector/cart_2/pen_01.shp'
      using driver `ESRI Shapefile' successful.
1: pen_01 (Line String)

comment:7 by lutra, 14 years ago

I guessed that was a problem in one of the shapefiles, nevertheless it should not crash.

PS I'm using GDAL 1.7

in reply to:  7 ; comment:8 by jef, 14 years ago

Replying to lutra:

I guessed that was a problem in one of the shapefiles, nevertheless it should not crash.

Looks like it crashes within OGR. OGR_L_GetNextFeature doesn't return...

in reply to:  8 comment:9 by jef, 14 years ago

Resolution: worksforme
Status: newclosed

Replying to jef:

Replying to lutra:

I guessed that was a problem in one of the shapefiles, nevertheless it should not crash.

Looks like it crashes within OGR. OGR_L_GetNextFeature doesn't return...

Fix filed as http://trac.osgeo.org/gdal/ticket/3665 GDAL #3665

comment:10 by jef, 14 years ago

Resolution: worksforme
Status: closedreopened

comment:11 by jef, 14 years ago

Platform: DebianAll
Resolution: upstream
Status: reopenedclosed
Summary: (linux) merge shapefiles crashes qgismerge shapefiles crashes qgis
Note: See TracTickets for help on using tickets.