Opened 17 years ago

Closed 16 years ago

Last modified 15 years ago

#586 closed bug (worksforme)

Qgis 0.8.0 Crash on opening existing project using PostGis layer

Reported by: john.floyd@… Owned by: nobody
Priority: critical: causes crash or data corruption Milestone:
Component: Project Loading / Saving Version: 0.8
Keywords: postgis, crash Cc:
Must Fix for Release: Yes Platform: Fedora
Platform Version: FC6 Awaiting user input: no

Description

Crashes on opening an existing project with segmentation error after changing properties on layer in a previous session. Note the existing project was created with current qgis8.

Examination of the project file before and after changes shows that the password for the postgis access is dropped. Opening the project without changes, allows loading of the project.

eg

<datasource>host=localhost dbname=shoalhaven port=5432 user=shoalhaven password= table=public.depthdata_qad (location) sql=</datasource>

Easy to replicate.

My version self compiled on Fedora 6, using qt4-4.2.2-1.fc6 and postgis 1.1.x

Change History (7)

comment:1 by john.floyd@…, 17 years ago

Milestone: Version 0.8 Release
Type: defectbug
Version: HEAD0.8

comment:2 by john.floyd@…, 17 years ago

I think that the problem is due to the maplayer method publicSource, which removes the password=xxx out of the datasource URI, and if a change to the layer is made then this URI (minus the password=xxx is written to the project file! A solution is to either re gen the text version of the URI when collating the project file or create a copy of the URI for the publicSource method.

A better approach would be to forget about storing the text version and always regen the text version as required. (there is some comment about the duplication of the uri in different forms in the code)

comment:3 by john.floyd@…, 17 years ago

Extra.

It only occurs if you also view the Metadata Page of a postgis layer properties. You actually dont need to change anything! Just hit OK or Apply for the property window and then save the project. Password will disappear from the project file datasource entry for that layer! And on restarting, qgis will crash with a segmentaion error.

Q? The password parsing code should be made to handle the password= condition (that is nothing after the =) without crashing regardless.

comment:4 by anonymous, 17 years ago

Milestone: Version 0.8.2 Release

comment:5 by pcav, 16 years ago

Awaiting user input: unset

The bug seems solved in 0.9.2. If it is not confirmed, please close it.

comment:6 by pcav, 16 years ago

Resolution: worksforme
Status: newclosed

comment:7 by (none), 15 years ago

Milestone: Version 0.9.2

Milestone Version 0.9.2 deleted

Note: See TracTickets for help on using tickets.