Skip to content
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

"export/add geometry columns" make QGIS crash if you have previously opened the attribute table #15036

Closed
qgib opened this issue Apr 9, 2012 · 23 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption High Priority Processing Relating to QGIS Processing framework or individual Processing algorithms
Milestone

Comments

@qgib
Copy link
Contributor

qgib commented Apr 9, 2012

Author Name: Giovanni Manghi (@gioman)
Original Redmine Issue: 5335
Affected QGIS version: master
Redmine category:processing/qgis
Assignee: Alexander Bruy


qgio@sibirica:~$ 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: QHttp: empty path requested is invalid -- using '/'
Warning: QObject::setParent: Cannot set parent, new parent is in a different 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
Xlib: sequence lost (0x1970f > 0x9717) in reply type 0x1c!
[xcb] Unknown request in queue while dequeuing
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
qgis.bin: ../../src/xcb_io.c:178: dequeue_pending_request: Assertion `!xcb_xlib_unknown_req_in_deq' failed.
Aborted

@qgib
Copy link
Contributor Author

qgib commented Apr 9, 2012

Author Name: Giovanni Manghi (@gioman)


  • subject was changed from "export/add geomtery columns" make QGIS crash if columns do already exist to "export/add geomtery columns" make QGIS crash if columns (area, perimeter,coordx,corrdy,etc.) do already exist

@qgib
Copy link
Contributor Author

qgib commented Apr 9, 2012

Author Name: Alexander Bruy (@alexbruy)


Tested under 32-bit Slackware and QGIS master d1a11be and it works fine with both options (create new layer and update existing layer). Maybe it crashes when this fields created by user and have different data type?

@qgib
Copy link
Contributor Author

qgib commented Apr 9, 2012

Author Name: Giovanni Manghi (@gioman)


Alexander Bruy wrote:

Maybe it crashes when this fields created by user and have different data type?

no, it crashes when using the tool two times in a row. I will attach here sample data that is causing the crash on both windows and ubuntu with qgis-master.

@qgib
Copy link
Contributor Author

qgib commented Apr 9, 2012

Author Name: Giovanni Manghi (@gioman)


Giovanni Manghi wrote:

Alexander Bruy wrote:

Maybe it crashes when this fields created by user and have different data type?

no, it crashes when using the tool two times in a row. I will attach here sample data that is causing the crash on both windows and ubuntu with qgis-master.

this is weird. I got the crash consistently for many tries while trying to find a pattern, then suddenly it stopped crashing (using the very same vectors)...

@qgib
Copy link
Contributor Author

qgib commented Apr 9, 2012

Author Name: Giovanni Manghi (@gioman)


Giovanni Manghi wrote:

Giovanni Manghi wrote:

Alexander Bruy wrote:

Maybe it crashes when this fields created by user and have different data type?

no, it crashes when using the tool two times in a row. I will attach here sample data that is causing the crash on both windows and ubuntu with qgis-master.

this is weird. I got the crash consistently for many tries while trying to find a pattern, then suddenly it stopped crashing (using the very same vectors)...

but still pretty easy to replicate... I tested other vectors and is enough to run two times in a row (after clicking "close" after the first time), regardless of the vector used. I have also vector that cause qgis to crash the first time the tool is run.

@qgib
Copy link
Contributor Author

qgib commented Apr 9, 2012

Author Name: Alexander Bruy (@alexbruy)


Weird, still works for me. I tried several times with different vectors.

@qgib
Copy link
Contributor Author

qgib commented Apr 9, 2012

Author Name: Salvatore Larosa (@slarosa)


Alexander Bruy wrote:

Weird, still works for me. I tried several times with different vectors.

The same for me, no problem!

@qgib
Copy link
Contributor Author

qgib commented Apr 9, 2012

Author Name: Salvatore Larosa (@slarosa)


I did some tests in more detail and I noticed that sometimes QGIS crashes!
It is very difficult to reproduce!

When it crashes I get this:

$ qgis
Warning: QObject::setParent: Cannot set parent, new parent is in a different thread
Warning: QObject::setParent: Cannot set parent, new parent is in a different 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: QApplication: Object event filter cannot be in a different 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: 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

@qgib
Copy link
Contributor Author

qgib commented Apr 10, 2012

Author Name: Giovanni Manghi (@gioman)


Salvatore Larosa wrote:

I did some tests in more detail and I noticed that sometimes QGIS crashes!
It is very difficult to reproduce!

When it crashes I get this:

[...]

it is really puzzling, but not that hard to replicate, at least on my Ubuntu machine with qgis-master installed with the nightly-build repo (and regardless of the vector used). The errors are the one already posted.

@qgib
Copy link
Contributor Author

qgib commented Apr 29, 2012

Author Name: Salvatore Larosa (@slarosa)


Is it still confirmed after Alexander's commit (d3a50e8)?

I cannot seem to reproduce it!

@qgib
Copy link
Contributor Author

qgib commented Apr 30, 2012

Author Name: Alexander Bruy (@alexbruy)


  • assigned_to_id removed cfarmer
  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented May 2, 2012

Author Name: Giovanni Manghi (@gioman)


Hi Alexander, the feedback is that I'm still able to get the crash consistently (but not always) on both Linux and Windows.


  • status_id was changed from Feedback to Open

@qgib
Copy link
Contributor Author

qgib commented May 2, 2012

Author Name: Salvatore Larosa (@slarosa)


Now, I am able to reproduce!!
Apparently, it occurs if before opens attribute table (very strange!)!

For reproduce:
Load layer;
Open Attribute table;
run Export/add geometry column (fTools)
Crashes!

I am investigating!

@qgib
Copy link
Contributor Author

qgib commented May 2, 2012

Author Name: Alexander Bruy (@alexbruy)


Maybe I'm wrong but this is because QGIS don't support simultaneous access to one datasource from different threads

@qgib
Copy link
Contributor Author

qgib commented May 2, 2012

Author Name: Salvatore Larosa (@slarosa)


It also occurs if the columns do not exist!


  • subject was changed from "export/add geomtery columns" make QGIS crash if columns (area, perimeter,coordx,corrdy,etc.) do already exist to "export/add geomtery columns" make QGIS crash if you have previously opened the attribute table

@qgib
Copy link
Contributor Author

qgib commented May 2, 2012

Author Name: Salvatore Larosa (@slarosa)


if "save to new shapefile" is flagged, works fine!

Alexander, you're probably right!

@qgib
Copy link
Contributor Author

qgib commented May 3, 2012

Author Name: Salvatore Larosa (@slarosa)


Alexander, I confirm, you're right!
Seems you can not access the same datasource from different threads simultaneously!!
That also occurs with Simplify Geometries tool!

one solution possible is:
I edited fTools (doGeometry.py and ui_frmGeometry.py) to avoid the issue by adding constraint to save a new file, as occurs in other tools!

@qgib
Copy link
Contributor Author

qgib commented May 3, 2012

Author Name: Alexander Bruy (@alexbruy)


I think remove this functionality is not good solution. Maybe it is better to add warning before processing. Giovanni what do you think?


  • assigned_to_id was configured as Alexander Bruy

@qgib
Copy link
Contributor Author

qgib commented May 3, 2012

Author Name: Jürgen Fischer (@jef-n)


  • subject was changed from "export/add geomtery columns" make QGIS crash if you have previously opened the attribute table to "export/add geometry columns" make QGIS crash if you have previously opened the attribute table

@qgib
Copy link
Contributor Author

qgib commented May 3, 2012

Author Name: Giovanni Manghi (@gioman)


Alexander Bruy wrote:

I think remove this functionality is not good solution. Maybe it is better to add warning before processing. Giovanni what do you think?

running ftools and have the results computed in the input layer instead of a new shapefile seems to be a need of most common users, so I would like to keep this option. The warning seems ok to me.

@qgib
Copy link
Contributor Author

qgib commented May 16, 2012

Author Name: Alexander Bruy (@alexbruy)


Fixed in changeset "d18529fc266cf03992a35244164b73e04e505a0e".


  • status_id was changed from Open to Closed

@qgib
Copy link
Contributor Author

qgib commented May 16, 2012

Author Name: Alexander Bruy (@alexbruy)


  • resolution was changed from to fixed

@qgib
Copy link
Contributor Author

qgib commented Apr 30, 2017

Author Name: Giovanni Manghi (@gioman)


The "ftools" category is being removed from the tracker, changing the category of this ticket to "Processing/QGIS" to not leave the category orphaned.

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! High Priority Processing Relating to QGIS Processing framework or individual Processing algorithms Crash/Data Corruption labels May 24, 2019
@qgib qgib added this to the Version 1.8.0 milestone May 24, 2019
@qgib qgib closed this as completed May 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption High Priority Processing Relating to QGIS Processing framework or individual Processing algorithms
Projects
None yet
Development

No branches or pull requests

1 participant