Hello

I am a newcomer to GIS community and already excited by QGIS!  My first Python program using PyQGIS interface ends up crashing with SIGSEGV, please help!  I'm referring https://docs.qgis.org/3.16/en/docs/pyqgis_developer_cookbook/intro.html#python-applications.

The platform is MacOS and the rudimentary Python program I'm trying is:

    from qgis.core import QgsApplication
QgsApplication.setPrefixPath('/Applications/QGIS-LTR.app/Contents/MacOS', True)
    app = QgsApplication([], False)
    app.initQgis() # SIGSEGV happens here

The stack trace indicates QgsProject failed to get created because sqlite3_create_function_v2() tried to de-reference a NULL pointer.  Full stack trace is attached.  Is this something MacOS specific?  Am I missing something obvious?

Asim



1   libsqlite3.dylib                    0x00007fff6f5b7654 createFunctionApi + 
148
2   libsqlite3.dylib                    0x00007fff6f4f043a 
sqlite3_create_function_v2 + 26
3   libspatialite.7.dylib               0x0000000115815200 
register_spatialite_sql_functions + 96
4   libspatialite.7.dylib               0x000000011586121b spatialite_init_ex + 
107
5   org.qgis.qgis3_core                 0x000000010e689918 
spatialite_database_unique_ptr::open_v2(QString const&, int, char const*) + 184
6   org.qgis.qgis3_core                 0x000000010e3c7d69 
QgsAuxiliaryStorage::createDB(QString const&) + 41
7   org.qgis.qgis3_core                 0x000000010e3c60cf 
QgsAuxiliaryStorage::open(QString const&) + 335
8   org.qgis.qgis3_core                 0x000000010e3c6341 
QgsAuxiliaryStorage::QgsAuxiliaryStorage(QString const&, bool) + 97
9   org.qgis.qgis3_core                 0x000000010e5dd111 
QgsProject::QgsProject(QObject*) + 577
10  org.qgis.qgis3_core                 0x000000010e5e1bca 
QgsProject::instance() + 42
11  org.qgis.qgis3_core                 0x000000010dfecedb 
QgsStyleModel::QgsStyleModel(QgsStyle*, QObject*) + 1659
12  org.qgis.qgis3_core                 0x000000010e39617c 
QgsApplication::init(QString) + 4540
13  org.qgis.qgis3_core                 0x000000010e39ffaa 
QgsApplication::initQgis() + 234
14  _core.so                            0x000000011d2e4931 
meth_QgsApplication_initQgis(_object*, _object*) + 65
15  libpython3.8.dylib                  0x00000001066511ae 
cfunction_call_varargs + 286
16  libpython3.8.dylib                  0x00000001066509a5 _PyObject_MakeTpCall 
+ 149
17  libpython3.8.dylib                  0x00000001066ee1c7 
_PyEval_EvalFrameDefault + 34471
18  libpython3.8.dylib                  0x00000001066efc23 
_PyEval_EvalCodeWithName + 563
19  libpython3.8.dylib                  0x00000001066e5a90 PyEval_EvalCode + 48
20  libpython3.8.dylib                  0x00000001067e5cd5 
PyRun_InteractiveOneObjectEx + 741
21  libpython3.8.dylib                  0x00000001067e58e7 
PyRun_InteractiveLoopFlags + 263
22  libpython3.8.dylib                  0x00000001067e57c5 PyRun_AnyFileExFlags 
+ 85
23  libpython3.8.dylib                  0x00000001067f1792 pymain_run_stdin + 
306
24  libpython3.8.dylib                  0x00000001067f0cf7 pymain_run_python + 
343
25  libpython3.8.dylib                  0x00000001067f0b54 Py_RunMain + 20
26  libpython3.8.dylib                  0x00000001067f0ef3 pymain_main + 35
27  libpython3.8.dylib                  0x00000001067f0f57 Py_BytesMain + 39
28  libdyld.dylib                       0x00007fff7051dcc9 start + 1
_______________________________________________
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to