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

Pyspatialite in QGIS 3 crash #24619

Closed
qgib opened this issue Jun 19, 2017 · 8 comments
Closed

Pyspatialite in QGIS 3 crash #24619

qgib opened this issue Jun 19, 2017 · 8 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption High Priority PyQGIS Related to the PyQGIS API

Comments

@qgib
Copy link
Contributor

qgib commented Jun 19, 2017

Author Name: Hugo Mercier (@mhugo)
Original Redmine Issue: 16720
Affected QGIS version: master
Redmine category:python_bindings_/_sipify


To reproduce, in a Python console:

from pyspatialite import dbapi2
conn = dbapi2.connect("")
cur = conn.cursor()
cur.execute("select * from whatever")

Crash report:

## User Feedback



## Report Details

*Crash ID*: 69b1a2351fc0e2533da4af70098845753375fea9


*Stack Trace*
((unknown module)) _pysqlite_query_execute (unknown file):(unknown line)
(python36) PyCFunction_FastCallDict (unknown file):(unknown line)
(python36) PyObject_GenericGetAttr (unknown file):(unknown line)
(python36) PyEval_EvalFrameDefault (unknown file):(unknown line)
(python36) PyErr_Occurred (unknown file):(unknown line)
(python36) PyEval_EvalCode (unknown file):(unknown line)
(python36) PyDict_SetItemId (unknown file):(unknown line)
(python36) PyDict_SetItemId (unknown file):(unknown line)
(python36) PyCFunction_FastCallDict (unknown file):(unknown line)
(python36) PyObject_GenericGetAttr (unknown file):(unknown line)
(python36) PyEval_EvalFrameDefault (unknown file):(unknown line)
(python36) PyObject_GenericGetAttr (unknown file):(unknown line)
(python36) PyEval_EvalFrameDefault (unknown file):(unknown line)
(python36) PyErr_Occurred (unknown file):(unknown line)
(python36) PyObject_GenericGetAttr (unknown file):(unknown line)
(python36) PyEval_EvalFrameDefault (unknown file):(unknown line)
(python36) PyErr_Occurred (unknown file):(unknown line)
(python36) PyObject_GenericGetAttr (unknown file):(unknown line)
(python36) PyEval_EvalFrameDefault (unknown file):(unknown line)
(python36) PyObject_GenericGetAttr (unknown file):(unknown line)
(python36) PyEval_EvalFrameDefault (unknown file):(unknown line)
(python36) PyObject_GenericGetAttr (unknown file):(unknown line)
(python36) PyEval_EvalFrameDefault (unknown file):(unknown line)
(python36) PyFunction_FastCallDict (unknown file):(unknown line)
(python36) PyObject_CallFunctionObjArgs (unknown file):(unknown line)
(python36) PyObject_Call (unknown file):(unknown line)
((unknown module)) PyInit_sip (unknown file):(unknown line)
((unknown module)) PyInit_Qsci (unknown file):(unknown line)
(Qt5Widgets) QWidget::event (unknown file):(unknown line)
(Qt5Widgets) QFrame::event (unknown file):(unknown line)
(Qt5Widgets) QAbstractScrollArea::event (unknown file):(unknown line)
((unknown module)) PyInit_Qsci (unknown file):(unknown line)
(Qt5Widgets) QApplicationPrivate::notify_helper (unknown file):(unknown line)
(Qt5Widgets) QApplication::notify (unknown file):(unknown line)
((unknown module)) QgsApplication::notify (unknown file):(unknown line)
(Qt5Core) QCoreApplication::notifyInternal2 (unknown file):(unknown line)
(Qt5Widgets) QSizePolicy::QSizePolicy (unknown file):(unknown line)
(Qt5Widgets) QSizePolicy::QSizePolicy (unknown file):(unknown line)
(Qt5Widgets) QApplicationPrivate::notify_helper (unknown file):(unknown line)
(Qt5Widgets) QApplication::notify (unknown file):(unknown line)
((unknown module)) QgsApplication::notify (unknown file):(unknown line)
(Qt5Core) QCoreApplication::notifyInternal2 (unknown file):(unknown line)
((unknown module)) QGuiApplicationPrivate::processKeyEvent (unknown file):(unknown line)
((unknown module)) QWindowSystemInterface::sendWindowSystemEvents (unknown file):(unknown line)
(Qt5Core) QEventDispatcherWin32::processEvents (unknown file):(unknown line)
((unknown module)) CallWindowProcW (unknown file):(unknown line)
((unknown module)) DispatchMessageW (unknown file):(unknown line)
(Qt5Core) QEventDispatcherWin32::processEvents (unknown file):(unknown line)
((unknown module)) qt_plugin_query_metadata (unknown file):(unknown line)
(Qt5Core) QEventLoop::exec (unknown file):(unknown line)
(Qt5Core) QCoreApplication::exec (unknown file):(unknown line)
((unknown module)) main (unknown file):(unknown line)
((unknown module)) WinMain (unknown file):(unknown line)
((unknown module)) __scrt_common_main_seh (unknown file):(unknown line)
((unknown module)) BaseThreadInitThunk (unknown file):(unknown line)
((unknown module)) RtlUserThreadStart (unknown file):(unknown line)


*Plugins*


*Project Info*


*QGIS Info*
QGIS Version: 2.99.0-Master
QGIS code revision: c69c596
Compiled against Qt: 5.7.1
Running against Qt: 5.7.1
Compiled against GDAL: 2.2.0
Running against GDAL: 2.2.0


*System Info*
CPU Type: x86_64
Kernel Type: winnt
Kernel Version: 10.0.14393

@qgib
Copy link
Contributor Author

qgib commented Jun 19, 2017

Author Name: Giovanni Manghi (@gioman)


  • priority_id was changed from Normal to High

@qgib
Copy link
Contributor Author

qgib commented Jul 4, 2017

Author Name: Hugo Mercier (@mhugo)


Reproduced also on Linux with WITH_INTERNAL_PYSPATIALITE, not specific to Windows


  • operating_system was changed from Windows to
  • category_id was changed from Windows Package to Python bindings / sipify
  • assigned_to_id removed Jürgen Fischer

@qgib
Copy link
Contributor Author

qgib commented Aug 9, 2017

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


  • subject was changed from Pyspatialite in QGIS 3 crash on Windows to Pyspatialite in QGIS 3 crash

@qgib
Copy link
Contributor Author

qgib commented Oct 31, 2017

Author Name: gcarrillo - (gcarrillo -)


This was fixed with the help of Jürgen F.

See 6402160, 6415fad, and e523780


  • status_id was changed from Open to Closed

@qgib qgib closed this as completed Oct 31, 2017
@qgib
Copy link
Contributor Author

qgib commented Nov 2, 2017

Author Name: Andreas Kositz (Andreas Kositz)


gcarrillo - wrote:

This was fixed with the help of Jürgen F.

See 6402160, 6415fad, and e523780

Does fixed mean, pyspatialite was removed? How do I access or create SpatiaLite Layer using Python without pySpatialite? Sqlite3 does not provide any functionality.

@qgib
Copy link
Contributor Author

qgib commented Nov 3, 2017

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


Andreas Kositz wrote:

Does fixed mean, pyspatialite was removed? How do I access or create SpatiaLite Layer using Python without pySpatialite? Sqlite3 does not provide any functionality.

Yes. Load the extension (see 6402160).

@qgib
Copy link
Contributor Author

qgib commented Nov 3, 2017

Author Name: Andreas Kositz (Andreas Kositz)


I am very sorry, but what is meant by "load the extension"?
My old way was:
@from pyspatialite import dbapi2 as sqlite
con = sqlite.connect(db_path)@

The assumed new way is:
@import sqlite3
con = sqlite3.dbapi2.connect(db_path)
con.enable_load_extension(True)
conn.execute("SELECT load_extension('mod_spatialite')")@

Which does not work.
Loading any Spatialite-DB in the DB-Manager is also not possible anymore, which seems a little related.

@jürgen Fischer & gcarillo, thanks for the effort, works now!

@qgib
Copy link
Contributor Author

qgib commented Nov 3, 2017

Author Name: gcarrillo - (gcarrillo -)


Andreas, see my answer to your question at GIS.SE: https://gis.stackexchange.com/a/260679/4972

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! High Priority PyQGIS Related to the PyQGIS API Crash/Data Corruption labels May 25, 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 PyQGIS Related to the PyQGIS API
Projects
None yet
Development

No branches or pull requests

1 participant