Bug report #406
Copy selected attributes crashes with PostGIS layer
Status: | Closed | ||
---|---|---|---|
Priority: | Low | ||
Assignee: | Gary Sherman | ||
Category: | Vectors | ||
Affected QGIS version: | Regression?: | No | |
Operating System: | Debian | Easy fix?: | No |
Pull Request or Patch supplied: | Resolution: | fixed | |
Crashes QGIS or corrupts data: | Copied to github as #: | 10465 |
Description
Using 0.8.0 preview 2 on Ubuntu 6.06.
I selected some features from a PostGIS layer, opened the attribute table, then tried to copy the selected records to the clipboard. QGIS crashed with a segmentation fault. Happens with all PostGIS layers points, lines or areas.
Works OK with the shapefile of the same layer.
History
#1 Updated by Gavin Macaulay - almost 18 years ago
Works for me with latest svn. Are you able to try the svn version of qgis?
Does anyone else have this problem?
#2 Updated by anonymous - almost 18 years ago
Replying to [comment:2 g_j_m]:
I'll give it a go and let you know.
#3 Updated by Colin-Reed-nrico-com-au - almost 18 years ago
I checked out revision 6146, but couldn't get it to compile:
g++ -DHAVE_CONFIG_H -I. -I. -I../.. -DPKGDATAPATH=\\"/home/kol/apps/share/qgis\\" -I../gui/ -I../ui/ -I../core/ -g -Wall -I/usr/include -DQT3_SUPPORT -I/usr/mkspecs/default -I/usr/include/qt4/Qt3Support -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtDesigner -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4/QtSql -I/usr/include/qt4/QtXml -I/usr/include/qt4 -I/usr/include/qt4/QtSvg -I/usr/include/qt4/QtTest -I/usr/include/qt4/QtDesigner -D_REENTRANT -DQT_THREAD_SUPPORT -DQGISDEBUG -I/usr/include -g -Wall -MT libqgis_legend_la-qgslegend.lo -MD -MP -MF .deps/libqgis_legend_la-qgslegend.Tpo -c qgslegend.cpp -fPIC -DPIC -o .libs/libqgis_legend_la-qgslegend.o
qgslegend.h: In constructor 'QgsLegend::QgsLegend(QgisApp*, QWidget*, const char*)':
qgslegend.h:348: warning: 'QgsLegend::mMapCanvas' will be initialized after
qgslegend.h:334: warning: 'bool QgsLegend::mShowLegendLayerFiles'
qgslegend.cpp:56: warning: when initialized here
qgslegend.cpp: In member function 'virtual void QgsLegend::mouseReleaseEvent(QMouseEvent*)':
qgslegend.cpp:299: warning: unused variable 'origLayer'
qgslegend.cpp:320: warning: unused variable 'origLayer'
qgslegend.cpp:321: warning: unused variable 'destLayer'
qgslegend.cpp: In member function 'void QgsLegend::addLayer(QgsMapLayer*)':
qgslegend.cpp:527: error: 'class QgsLegendLayerFileGroup' has no member named 'setHidden'
qgslegend.cpp: In member function 'bool QgsLegend::readXML(QDomNode&)':
qgslegend.cpp:1054: error: 'class QgsLegendLayerFileGroup' has no member named 'setHidden'
qgslegend.cpp:1054: error: 'class QgsLegendLayerFileGroup' has no member named 'setHidden'
qgslegend.cpp: In member function 'QgsLegendLayer* QgsLegend::findLegendLayer(const QString&)':
qgslegend.cpp:1163: warning: suggest parentheses around assignment used as truth value
qgslegend.cpp: In member function 'void QgsLegend::showLegendLayerFileGroups()':qgslegend.cpp:1668: error: 'class QgsLegendLayerFileGroup' has no member named 'setHidden'
qgslegend.cpp:1671: warning: suggest parentheses around assignment used as truth value
maker4: *** [libqgis_legend_la-qgslegend.lo] Error 1
Colin
#4 Updated by Marco Hugentobler almost 18 years ago
Colin,
Your Qt version seems to be < 4.2 (the current minimum version for QGIS)
Marco
#5 Updated by anonymous - almost 18 years ago
Thanks Marco,
I had 4.1.2. It took me a while to figure out how to get 4.2 installed into the right places, but I finally got the latest svn compiled succesfully.
Unfortunately, still the same result! Crash and segmentation fault when i hit the copy button.
When I selected the PostGIS layer I got a few error dialogs saying:
Could not open SRS database /resources/srs.db
Error(14): unable to open database file
but it plotted OK. Selected a single line feature, opened the attribute table, moved the selected feature to the top, clicked the copy button:
...
Debug: qgspostgresprovider.cpp: 726: (getFeatureAttributes) QgsPostgresProvider::getFeatureAttributes using: select * from "public"."GEODATA_250k_coast" where "oid" = 607568
Debug: qgspostgresprovider.cpp: 726: (getFeatureAttributes) QgsPostgresProvider::getFeatureAttributes using: select * from "public"."GEODATA_250k_coast" where "oid" = 607569
Debug: qgspostgresprovider.cpp: 845: (reset) Setting up binary cursor: declare qgisf binary cursor for select "oid",asbinary("the_geom",'NDR') as qgs_feature_geometry from "public"."GEODATA_250k_coast"
WARNING: there is no transaction in progress
Debug: qgsmaplayer.cpp: 127: (name) QgsMapLayer::name: returning name 'GEODATA_250k_coast
Warning: selecting row with id 606635
Debug: qgspostgresprovider.cpp: 726: (getFeatureAttributes) QgsPostgresProvider::getFeatureAttributes using: select * from "public"."GEODATA_250k_coast" where "oid" = 606635
Debug: qgspostgresprovider.cpp: 789: (getFeatureGeometry) QgsPostgresProvider::getFeatureGeometry using: declare qgisf binary cursor for select asbinary("the_geom",'NDR') from "public"."GEODATA_250k_coast" where "oid" = 606635
WARNING: there is already a transaction in progress
QgsClipboard::replaceWith: replaced QGis clipboard.
Segmentation fault
BTW PostGIS is v 1.1.6 and postgresql is 8.1.5
Thanks,
Colin
#6 Updated by Gavin Macaulay - almost 18 years ago
Can you attach a backtrace?
#7 Updated by Colin-Reed-nrico-com-au - almost 18 years ago
This is from strace (tail end)- is this OK?
Colin
select(9, [3 7 8], [], [], {0, 699757}) = 0 (Timeout) gettimeofday({1164967947, 507085}, NULL) = 0 gettimeofday({1164967947, 507120}, NULL) = 0 gettimeofday({1164967947, 507189}, NULL) = 0 write(4, "\\0", 1) = 1 gettimeofday({1164967947, 508933}, NULL) = 0 uname({sys="Linux", node="kol-laptop", ...}) = 0 write(7, "\\227\\24\\25\\0\\"\\0\\200\\2\\1\\0\\0\\0\\16\\0\\0\\0\\7\\0\\7\\0\\377\\377"..., 888) = 888 read(7, "\\34\\225\\204\\325\\323j\\200\\2\\'\\0\\0\\0\\365,\\200=\\0,\\200=x]"..., 32) = 32 read(7, "\\34\\225\\205\\325\\323j\\200\\2\\334\\0\\0\\0\\365,\\200=\\0,\\200="..., 32) = 32 read(7, "\\34\\225\\206\\325\\323j\\200\\2\\370\\0\\0\\0\\365,\\200=\\0,\\200="..., 32) = 32 read(7, "\\34\\225\\207\\325\\323j\\200\\2\\366\\0\\0\\0\\365,\\200=\\0,\\200="..., 32) = 32 read(7, "\\1 \\211\\325\\t\\0\\0\\0#\\0\\0\\0\\0\\0\\0\\0\\t\\0\\0\\0\\30\\0\\0\\0\\30"..., 32) = 32 read(7, "C\\0\\0\\0\\1\\0\\0\\0\\1\\0\\0\\0\\350\\365\\35\\10\\320x\\364\\277\\350"..., 36) = 36 write(7, "\\22\\0\\17\\0\\323j\\200\\2#\\0\\0\\0#\\0\\0\\0 \\0\\7\\0\\t\\0\\0\\0C\\0\\0"..., 100) = 100 read(7, "\\34\\225\\212\\325\\323j\\200\\2#\\0\\0\\0\\366,\\200=\\0,\\200=x]\\35"..., 32) = 32 read(7, "\\1 \\214\\325\\t\\0\\0\\0#\\0\\0\\0\\0\\0\\0\\0\\t\\0\\0\\0\\30\\0\\0\\0\\30"..., 32) = 32 read(7, "C\\0\\0\\0\\1\\0\\0\\0\\1\\0\\0\\0\\350\\365\\35\\10\\320x\\364\\277\\350"..., 36) = 36 write(7, "\\22\\0\\17\\0\\323j\\200\\2#\\0\\0\\0#\\0\\0\\0 \\0\\7\\0\\t\\0\\0\\0C\\0\\0"..., 208) = 208 read(7, "\\34\\225\\215\\325\\323j\\200\\2#\\0\\0\\0\\366,\\200=\\0,\\200=x]\\35"..., 32) = 32 read(7, "\\34\\225\\216\\325\\323j\\200\\2(\\0\\0\\0\\366,\\200=\\0,\\200=x]\\35"..., 32) = 32 read(7, "\\34\\225\\217\\325\\323j\\200\\2D\\0\\0\\0\\366,\\200=\\0,\\200=x]\\35"..., 32) = 32 read(7, "\\1 \\220\\325\\5\\0\\0\\0\\362\\0\\0\\0\\0\\0\\0\\0\\5\\0\\0\\0\\30\\0\\0\\0"..., 32) = 32 read(7, "\\2\\0\\0\\0\\1\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0", 20) = 20 gettimeofday({1164967947, 511254}, NULL) = 0 write(7, "\\22\\0\\v\\0\\323j\\200\\2\\362\\0\\0\\0\\362\\0\\0\\0 \\0\\7\\0\\5\\0\\0\\0"..., 1460) = 1460 ioctl(7, FIONREAD, commit:9b988b7b (SVN r129)) = 0 read(7, "\\34\\225\\221\\325\\323j\\200\\2\\362\\0\\0\\0\\370,\\200=\\0,\\200="..., 128) = 128 ioctl(7, FIONREAD, r0) = 0 write(7, "7\\0\\4\\0\\336j\\200\\2\\325j\\200\\2\\0\\0\\0\\0;\\3\\5\\0\\336j\\200\\2"..., 88) = 88 ioctl(7, FIONREAD, r0) = 0 gettimeofday({1164967947, 513568}, NULL) = 0 select(9, [3 7 8], [], [], {1, 993621}) = 1 (in r3, left {1, 996000}) gettimeofday({1164967947, 513659}, NULL) = 0 read(3, "\\0", 16) = 1 read(3, 0xbff481d0, 16) = -1 EAGAIN (Resource temporarily unavailable) gettimeofday({1164967947, 513760}, NULL) = 0 ioctl(7, FIONREAD, r0) = 0 gettimeofday({1164967947, 513830}, NULL) = 0 select(9, [3 7 8], [], [], {1, 993359}) = 1 (in r7, left {0, 816000}) gettimeofday({1164967948, 692338}, NULL) = 0 gettimeofday({1164967948, 692373}, NULL) = 0 ioctl(7, FIONREAD, commit:d028a068 (SVN r33)) = 0 read(7, "\\4\\1\\331\\325\\2231\\200=c\\0\\0\\0\\310c\\200\\2\\0\\0\\0\\0\\230\\0"..., 32) = 32 write(7, "\\22\\0\\7\\0\\240c\\200\\2\\360\\0\\0\\0\\6\\0\\0\\0 \\3\\5\\0\\1\\0\\0\\0\\223"..., 80) = 80 gettimeofday({1164967948, 693209}, NULL) = 0 write(4, "\\0", 1) = 1 write(7, "7\\0\\4\\0\\337j\\200\\2\\322c\\200\\2\\0\\0\\0\\0007\\3\\4\\0\\340j\\200"..., 2704) = 2704 ioctl(7, FIONREAD, ) = 0 read(7, "\\34\\225\\332\\325\\240c\\200\\2\\360\\0\\0\\0\\2241\\200=\\0\\0\\0\\0"..., 352) = 352 gettimeofday({1164967948, 695222}, NULL) = 0 select(9, [3 7 8], [], [], {0, 0}) = 1 (in r3, left {0, 0}) gettimeofday({1164967948, 695310}, NULL) = 0 read(3, "\\0", 16) = 1 read(3, 0xbff481d0, 16) = -1 EAGAIN (Resource temporarily unavailable) gettimeofday({1164967948, 695411}, NULL) = 0 ioctl(7, FIONREAD, r0) = 0 ioctl(7, FIONREAD, r0) = 0 write(7, "7\\0\\4\\0\\347j\\200\\2\\322c\\200\\2\\0\\0\\0\\0;\\3\\v\\0\\347j\\200\\2"..., 112) = 112 ioctl(7, FIONREAD, r0) = 0 write(7, "7\\0\\4\\0\\350j\\200\\2\\322c\\200\\2\\0\\0\\0\\0;\\3\\5\\0\\350j\\200\\2"..., 88) = 88 ioctl(7, FIONREAD, r0) = 0 write(7, "7\\0\\4\\0\\351j\\200\\2\\322c\\200\\2\\0\\0\\0\\0;\\3\\5\\0\\351j\\200\\2"..., 88) = 88 ioctl(7, FIONREAD, r0) = 0 write(7, "7\\0\\4\\0\\352j\\200\\2\\322c\\200\\2\\0\\0\\0\\0;\\3\\5\\0\\352j\\200\\2"..., 88) = 88 ioctl(7, FIONREAD, r0) = 0 write(7, "7\\0\\4\\0\\353j\\200\\2\\322c\\200\\2\\0\\0\\0\\0;\\3\\5\\0\\353j\\200\\2"..., 88) = 88 write(7, "7\\0\\4\\0\\354j\\200\\2\\322c\\200\\2\\0\\0\\0\\0;\\3\\5\\0\\354j\\200\\2"..., 88) = 88 ioctl(7, FIONREAD, r0) = 0 gettimeofday({1164967948, 696486}, NULL) = 0 select(9, [3 7 8], [], [], {0, 246723}) = 1 (in r7, left {0, 152000}) gettimeofday({1164967948, 792159}, NULL) = 0 gettimeofday({1164967948, 792194}, NULL) = 0 ioctl(7, FIONREAD, commit:d028a068 (SVN r33)) = 0 read(7, "\\5\\1a\\326\\3671\\200=c\\0\\0\\0\\310c\\200\\2\\0\\0\\0\\0\\230\\0@\\0"..., 32) = 32 gettimeofday({1164967948, 792361}, NULL) = 0 write(4, "\\0", 1) = 1 write(7, "7\\0\\4\\0\\355j\\200\\2\\322c\\200\\2\\0\\0\\0\\0007\\3\\4\\0\\356j\\200"..., 7200) = 7200 write(2, "Debug: qgspostgresprovider.cpp: "..., 174) = 174 rt_sigprocmask(SIG_BLOCK, [PIPE], [], 8) = 0 write(12, "\\27\\3\\1\\0 \\232k*\\211\\377\\300\\22\\0206\\364\\225.\\301\\204="..., 90) = 90 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 poll([{fd=12, events=POLLIN|POLLERR, revents=POLLIN}], 1, -1) = 1 read(12, "\\27\\3\\1\\0 ", 5) = 5 read(12, "\\271F\\232\\3158\\270\\377\\252\\251\\246\\226\\247i\\234\\336\\364"..., 32) = 32 read(12, "\\27\\3\\1\\0\\360", 5) = 5 read(12, "\\364\\v\\3322\\16\\240\\312\\214\\331\\6\\263,\\7G\\353/\\22\\327\\10"..., 240) = 240 write(2, "Debug: qgspostgresprovider.cpp: "..., 227) = 227 rt_sigprocmask(SIG_BLOCK, [PIPE], [], 8) = 0 write(12, "\\27\\3\\1\\0 |\\242\\355D\\232Q\\365\\24\\301\\3107\\331\\271\\330\\200"..., 74) = 74 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 poll([{fd=12, events=POLLIN|POLLERR, revents=POLLIN}], 1, -1) = 1 read(12, "\\27\\3\\1\\0 ", 5) = 5 read(12, "\\274\\345Co!\\315;.\\302G\\317\\360\\202\\300\\24\\206n\\216\\223"..., 32) = 32 read(12, "\\27\\3\\1\\0@", 5) = 5 read(12, "\\272x\\323\\300tjks\\211tl\\204\\370\\202Q\\5\\225\\250\\306\\331"..., 64) = 64 write(2, "WARNING: there is already a tra"..., 53) = 53 poll([{fd=12, events=POLLIN|POLLERR, revents=POLLIN}], 1, -1) = 1 read(12, "\\27\\3\\1\\0 ", 5) = 5 read(12, "\\352S\\326x\\356\\346-4T\\272\\263\\224\\260Q\\356\\351b\\370i\\255"..., 32) = 32 read(12, "\\27\\3\\1\\0 ", 5) = 5 read(12, "\\232\\f\\277&\\ff\\263h\\367p\\221,\\276\\214\\254\\260v\\334\\332"..., 32) = 32 rt_sigprocmask(SIG_BLOCK, [PIPE], [], 8) = 0 write(12, "\\27\\3\\1\\0 \\261\\7\\356\\25\\tf\\317\\345\\32\\336;8\\374\\332\\274"..., 90) = 90 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 poll([{fd=12, events=POLLIN|POLLERR, revents=POLLIN}], 1, -1) = 1 read(12, "\\27\\3\\1\\0 ", 5) = 5 read(12, "\\241\\263\\234Z>\\331?d=P\\262\\6u_.\\315;\\360\\264rq\\376m\\vp"..., 32) = 32 read(12, "\\27\\3\\1\\0@", 5) = 5 read(12, "\\267\\253}\\204\\250Sy\\347\\241\\302[\\351K\\10\\363[VY@Jt\\231"..., 96) = 96 poll([{fd=12, events=POLLIN|POLLERR, revents=POLLIN}], 1, -1) = 1 read(12, "\\27\\3\\1\\0 ", 5) = 5 read(12, "\ \\367\\313\\324\\271\\224\\224\\315?\\6\\254\\0\\240Z}\\225F\\272"..., 32) = 32 read(12, "\\27\\3\\1\\0 ", 5) = 5 read(12, " \\340\\fI\\235\\252Y\\227#\\251]b\\233\\20q\\203&\\242$\\225\\262"..., 32) = 32 rt_sigprocmask(SIG_BLOCK, [PIPE], [], 8) = 0 write(12, "\\27\\3\\1\\0 \\326\\305?\\263\\334\\344T|\\315obf\\5~\\213\\312\\307"..., 74) = 74 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 poll([{fd=12, events=POLLIN|POLLERR, revents=POLLIN}], 1, -1) = 1 read(12, "\\27\\3\\1\\0 ", 5) = 5 read(12, "\\304<\\224u\\236\\274\\34\\215\\4\\233\\2044\\375V\ \\366n\\30\\331"..., 32) = 32 read(12, "\\27\\3\\1\\0\\200", 5) = 5 read(12, "\\270.\\247e\\34\\'\\335.\\306\\320\\23\\347\\264N\\31\\2\\214POH\\200"..., 128) = 128 poll([{fd=12, events=POLLIN|POLLERR, revents=POLLIN}], 1, -1) = 1 read(12, "\\27\\3\\1\\0 ", 5) = 5 read(12, "!9o\\301Q\\321\\0\\251o\\333\\362\\223_fE\\341O\\267\\2148\\220!8"..., 32) = 32 read(12, "\\27\\3\\1\\0 ", 5) = 5 read(12, "E\\33ScP\\232\\257h~\\214\\327g\\237\\266@@u\\260\\223\\272K\\253"..., 32) = 32 rt_sigprocmask(SIG_BLOCK, [PIPE], [], 8) = 0 write(12, "\\27\\3\\1\\0 A\\213\\350\\354\\226y1\\335_*}=Y\\276\\252\\332r\\206"..., 74) = 74 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 poll([{fd=12, events=POLLIN|POLLERR, revents=POLLIN}], 1, -1) = 1 read(12, "\\27\\3\\1\\0 ", 5) = 5 read(12, "T\\337|\\3773\\325\\363\\335\\334\\332\\223\\24\\275\\257\\6D\\213\\320"..., 32) = 32 read(12, "\\27\\3\\1\\0000", 5) = 5 read(12, "\\212\\256\\212\\343\\322\\367\\333\\1^Q\\216\\366I\\226\\340\\303@"..., 48) = 48 write(2, "QgsClipboard::replaceWith: repla"..., 51) = 51 write(2, "\ ", 1) = 1 --- SIGSEGV (Segmentation fault) @ 0 (0) --- +++ killed by SIGSEGV +++
#8 Updated by Gavin Macaulay - almost 18 years ago
A backtrace would be better. Something like this should work:
tcsh
limit coredumpsize unlimited
qgis
gdb /path/to/qgis core.XXXXX
bt
where core.XXXXX is the name of the coredump file that is generated when qgis crashed. The first 10 or 15 lines from the bt command are all that are required.
#9 Updated by Colin-Reed--nrico-com-au - almost 18 years ago
Thanks for that. I haven't done this before.
Here it is:
#0 0xb67f8963 in [[QgsGeometry]]::wkt (this=0x0) at qgsgeometry.cpp:178 #3905 0xb69568ca in [[QgsClipboard]]::replaceWithCopyOf (this=0x80a3d58, features=@0xbf9dcd7c) at qgsclipboard.cpp:82 #3906 0xb6924691 in [[QgisApp]]::editCopy (this=0x80a3b18, layerContainingSelection=0x83e1530) at qgisapp.cpp:3430 #3907 0xb694d560 in [[QgsAttributeTableDisplay]]::copySelectedRowsToClipboard ( this=0x83a5c78) at qgsattributetabledisplay.cpp:236 #3908 0xb6a94657 in [[QgsAttributeTableDisplay]]::qt_metacall (this=0x83a5c78, _c=QMetaObject::InvokeMetaMethod, _id=8, _a=0xbf9dd2ec) at qgsattributetabledisplay.moc.cpp:90 #3909 0xb7e2dc92 in QMetaObject::activate (sender=0x8103e90, from_signal_index=29, to_signal_index=30, argv=0x0) at kernel/qobject.cpp:2911 #3910 0xb7e2df69 in QMetaObject::activate (sender=0x0, m=0x0, from_local_signal_index=2, to_local_signal_index=3, argv=0x8050d58) at kernel/qobject.cpp:2963 #3911 0xb79062d5 in QAbstractButton::clicked (this=0x0, _t1=false) at .moc/release-shared/moc_qabstractbutton.cpp:176 #3912 0xb7732523 in QAbstractButtonPrivate::emitClicked (this=0x8405a88) at widgets/qabstractbutton.cpp:517 #3913 0xb773372f in QAbstractButtonPrivate::click (this=0x8405a88) at widgets/qabstractbutton.cpp:510 #10 0xb7733917 in QAbstractButton::mouseReleaseEvent (this=0x8103e90, e=0xbf9dd974) at widgets/qabstractbutton.cpp:1072 #3914 0xb77d964a in QToolButton::mouseReleaseEvent (this=0x0, e=0x8050d58) at widgets/qtoolbutton.cpp:598 #3915 0xb74eba18 in QWidget::event (this=0x8103e90, event=0xbf9dd974) at kernel/qwidget.cpp:5576 #3916 0xb7732886 in QAbstractButton::event (this=0x8103e90, e=0xbf9dd974) at widgets/qabstractbutton.cpp:1034 #3917 0xb77d9484 in QToolButton::event (this=0x0, e=0x0) at widgets/qtoolbutton.cpp:1005 #3918 0xb74a7a33 in QApplicationPrivate::notify_helper (this=0x807d1a8, receiver=0x8103e90, e=0xbf9dd974) at kernel/qapplication.cpp:3435
Colin
#10 Updated by Gavin Macaulay - almost 18 years ago
A potential fix is available in svn 49658807 (SVN r6167).
If you're able to checkout and compile up the latest qgis, please do so and see if the problem has been fixed.
The backtrace suggests that some of the geometries in the postgres database are empty.
#11 Updated by Colin-Reed-nrico-com-au - almost 18 years ago
OK, that stops it from crashing, but I don't think there should be any null geometries. I checked in PostGIS by selecting where the_geom is null and it didn't find any. I selected a single feature from the map then copied from the attribute table and had a NULL as the geometry for that record, but it is plotting on the screen so it shouldn't be null.
After a bit of experimentation I found that if I selected a feature and it came up with a null geometry, if I inverted the selection, then inverted it again, it worked OK and the geometry showed up in the pasted text.
Maybe it's not talking to Postgis properly when it's initially fetching the geometries? The null shows up as the first record in each case and it seems in each case that the null's appear there is a warning message about a transaction already in progress:
Debug: qgspostgresprovider.cpp: 789: (getFeatureGeometry) [[QgsPostgresProvider]]::getFeatureGeometry using: declare qgisf binary cursor for select asbinary("the_geom",'NDR') from "public"."GEODATA_250k_coast" where "oid" = 607202 *WARNING: there is already a transaction in progress* Debug: qgspostgresprovider.cpp: 726: (getFeatureAttributes) [[QgsPostgresProvider]]::getFeatureAttributes using: select * from "public"."GEODATA_250k_coast" where "oid" = 607230 Debug: qgspostgresprovider.cpp: 789: (getFeatureGeometry) [[QgsPostgresProvider]]::getFeatureGeometry using: declare qgisf binary cursor for select asbinary("the_geom",'NDR') from "public"."GEODATA_250k_coast" where "oid" = 607230 Debug: qgspostgresprovider.cpp: 726: (getFeatureAttributes) [[QgsPostgresProvider]]::getFeatureAttributes using: select * from "public"."GEODATA_250k_coast" where "oid" = 607496 Debug: qgspostgresprovider.cpp: 789: (getFeatureGeometry) [[QgsPostgresProvider]]::getFeatureGeometry using: declare qgisf binary cursor for select asbinary("the_geom",'NDR') from "public"."GEODATA_250k_coast" where "oid" = 607496 Debug: qgspostgresprovider.cpp: 726: (getFeatureAttributes) [[QgsPostgresProvider]]::getFeatureAttributes using: select * from "public"."GEODATA_250k_coast" where "oid" = 607562 Debug: qgspostgresprovider.cpp: 789: (getFeatureGeometry) [[QgsPostgresProvider]]::getFeatureGeometry using: declare qgisf binary cursor for select asbinary("the_geom",'NDR') from "public"."GEODATA_250k_coast" where "oid" = 607562 [[QgsClipboard]]::replaceWith: replaced QGis clipboard. Debug: qgsgeometry.cpp: 2171: (exportToWkt) [[QgsGeometry]]::exportToWkt: entered Debug: qgsgeometry.cpp: 2305: (exportToWkt) [[QgsGeometry]]::exportToWkt: MULTILINESTRING found Debug: qgsgeometry.cpp: 2171: (exportToWkt) [[QgsGeometry]]::exportToWkt: entered Debug: qgsgeometry.cpp: 2305: (exportToWkt) [[QgsGeometry]]::exportToWkt: MULTILINESTRING found Debug: qgsgeometry.cpp: 2171: (exportToWkt) [[QgsGeometry]]::exportToWkt: entered Debug: qgsgeometry.cpp: 2305: (exportToWkt) [[QgsGeometry]]::exportToWkt: MULTILINESTRING found [[QgsClipboard]]::replaceWith: replaced system clipboard with: wkt_geom,gid,feattype,type,elevation,featrel,attrrel,planacc,elevacc,source,created,retired,pid,symbol,shape_leng NULL,6305,Connector Standard,2,0.00000000000,2003-03-11,2003-03-11,9999,25,GEOSCIENCE AUSTRALIA,2006-05-09~1569900,0,0 ...
Thanks,
Colin
#12 Updated by anonymous - almost 18 years ago
The NULL in the copied text is something I made qgis put in when it finds an empty geometry, but real problem is why qgis gets an empty geometry in the first place. I'll look some more.
#13 Updated by anonymous - almost 18 years ago
- Resolution set to fixed
- Status changed from Open to Closed
Fixed in svn . Thanks for the backtrace and debugging messages, Colin - they allowed me to work out how to reproduce the problem and hence fix it.
#14 Updated by Colin-Reed-nrico-com-au - almost 18 years ago
The fix works fine for me too.
Thanks!
Colin
#15 Updated by Anonymous over 15 years ago
Milestone Version 0.8 deleted