qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.48k stars 2.99k forks source link

QGIS crashes when writing code in python (console or script) #50130

Closed ghtmtt closed 2 years ago

ghtmtt commented 2 years ago

What is the bug or the crash?

Quite randomly when using both the python console or the python editor, QGIS crashes. Mostly it happens when the return key is pressed. Could it be related to the python version installed in my distro (Debian Sid with default Python 3.10.6).

This is what I have in the QGIS crash editor:

Python Stack Trace
Fatal Python error: Segmentation fault

Current thread 0x00007ff63f7dedc0 (most recent call first):

Extension modules: PyQt5.QtCore, PyQt5.QtGui, PyQt5.QtWidgets, PyQt5.QtPrintSupport, PyQt5.Qsci, PyQt5.QtXml, PyQt5.QtPositioning, PyQt5.QtSql, PyQt5.QtNetwork, qgis._core, qgis._gui, osgeo._gdal, osgeo._gdalconst, osgeo._ogr, osgeo._osr, _brotli, unicodedata2, numpy.core._multiarray_umath, numpy.core._multiarray_tests, numpy.linalg.lapack_lite, numpy.linalg._umath_linalg, numpy.fft._pocketfft_internal, numpy.random._common, numpy.random.bit_generator, numpy.random._bounded_integers, numpy.random._mt19937, numpy.random.mtrand, numpy.random._philox, numpy.random._pcg64, numpy.random._sfc64, numpy.random._generator, pandas._libs.tslibs.dtypes, pandas._libs.tslibs.base, pandas._libs.tslibs.np_datetime, pandas._libs.tslibs.nattype, pandas._libs.tslibs.timezones, pandas._libs.tslibs.ccalendar, pandas._libs.tslibs.tzconversion, pandas._libs.tslibs.strptime, pandas._libs.tslibs.fields, pandas._libs.tslibs.timedeltas, pandas._libs.tslibs.timestamps, pandas._libs.properties, pandas._libs.tslibs.offsets, pandas._libs.tslibs.parsing, pandas._libs.tslibs.conversion, pandas._libs.tslibs.period, pandas._libs.tslibs.vectorized, pandas._libs.ops_dispatch, pandas._libs.missing, pandas._libs.hashtable, pandas._libs.algos, pandas._libs.interval, pandas._libs.tslib, pandas._libs.lib, pandas._libs.hashing, pandas._libs.ops, numexpr.interpreter, bottleneck.reduce, bottleneck.nonreduce, bottleneck.nonreduce_axis, bottleneck.move, pandas._libs.arrays, pandas._libs.index, pandas._libs.join, pandas._libs.sparse, pandas._libs.reduction, pandas._libs.indexing, pandas._libs.internals, pandas._libs.writers, pandas._libs.window.aggregations, pandas._libs.window.indexers, pandas._libs.reshape, pandas._libs.groupby, pandas._libs.parsers, pandas._libs.json, pandas._libs.testing, lxml._elementpath, lxml.etree, PIL._imaging, PyQt5.QtSvg, PyQt5.QtTest, matplotlib._c_internal_utils, matplotlib._path, kiwisolver, matplotlib._image, scipy._lib._ccallback_c, scipy.linalg._fblas, scipy.linalg._flapack, scipy.linalg._cythonized_array_utils, scipy.linalg._flinalg, scipy.linalg._solve_toeplitz, scipy.linalg._matfuncs_sqrtm_triu, scipy.linalg.cython_blas, scipy.linalg.cython_lapack, scipy.linalg._decomp_update, scipy.sparse._sparsetools, scipy.sparse._csparsetools, scipy.sparse.csgraph._tools, scipy.sparse.csgraph._shortest_path, scipy.sparse.csgraph._traversal, scipy.sparse.csgraph._min_spanning_tree, scipy.sparse.csgraph._flow, scipy.sparse.csgraph._matching, scipy.sparse.csgraph._reordering, scipy.special._ufuncs_cxx, scipy.special._ufuncs, scipy.special._specfun, scipy.special._comb, scipy.special._ellip_harm_2, scipy.interpolate._fitpack, scipy.interpolate.dfitpack, scipy.interpolate._bspl, scipy.interpolate._ppoly, scipy.spatial._ckdtree, scipy._lib.messagestream, scipy.spatial._qhull, scipy.spatial._voronoi, scipy.spatial._distance_wrap, scipy.spatial._hausdorff, scipy.spatial.transform._rotation, scipy.interpolate.interpnd, scipy.interpolate._rbfinterp_pythran, scipy.ndimage._nd_image, _ni_label, scipy.ndimage._ni_label, scipy.sparse.linalg._isolve._iterative, scipy.sparse.linalg._dsolve._superlu, scipy.sparse.linalg._eigen.arpack._arpack, scipy.optimize._minpack2, scipy.optimize._group_columns, scipy.optimize._trlib._trlib, scipy.optimize._lbfgsb, _moduleTNC, scipy.optimize._moduleTNC, scipy.optimize._cobyla, scipy.optimize._slsqp, scipy.optimize._minpack, scipy.optimize._lsq.givens_elimination, scipy.optimize._zeros, scipy.optimize.__nnls, scipy.optimize._highs.cython.src._highs_wrapper, scipy.optimize._highs._highs_wrapper, scipy.optimize._highs.cython.src._highs_constants, scipy.optimize._highs._highs_constants, scipy.linalg._interpolative, scipy.optimize._bglu_dense, scipy.optimize._lsap_module, scipy.integrate._odepack, scipy.integrate._quadpack, scipy.integrate._vode, scipy.integrate._dop, scipy.integrate._lsoda, scipy.special.cython_special, scipy.stats._stats, beta_ufunc, scipy.stats._boost.beta_ufunc, binom_ufunc, scipy.stats._boost.binom_ufunc, nbinom_ufunc, scipy.stats._boost.nbinom_ufunc, hypergeom_ufunc, scipy.stats._boost.hypergeom_ufunc, scipy.stats._biasedurn, scipy.stats._hypotests_pythran, scipy.stats._statlib, scipy.stats._mvn, scipy.stats._sobol, scipy.stats._qmc_cy, scipy.stats._unuran.unuran_wrapper, statsmodels.robust._qn, scipy.signal._sigtools, scipy._lib._uarray._uarray, scipy.signal._max_len_seq_inner, scipy.signal._upfirdn_apply, scipy.signal._spline, scipy.signal._sosfilt, scipy.signal._spectral, scipy.signal._peak_finding_utils, statsmodels.tsa._innovations, statsmodels.nonparametric._smoothers_lowess, statsmodels.nonparametric.linbin, statsmodels.tsa.statespace._tools, statsmodels.tsa.statespace._representation, statsmodels.tsa.statespace._initialization, statsmodels.tsa.statespace._filters._conventional, statsmodels.tsa.statespace._filters._univariate, statsmodels.tsa.statespace._filters._univariate_diffuse, statsmodels.tsa.statespace._filters._inversions, statsmodels.tsa.statespace._kalman_filter, statsmodels.tsa.statespace._smoothers._conventional, statsmodels.tsa.statespace._smoothers._univariate, statsmodels.tsa.statespace._smoothers._univariate_diffuse, statsmodels.tsa.statespace._smoothers._classical, statsmodels.tsa.statespace._smoothers._alternative, statsmodels.tsa.statespace._kalman_smoother, statsmodels.tsa.statespace._simulation_smoother, statsmodels.tsa.statespace._cfa_simulation_smoother, statsmodels.tsa.innovations._arma_innovations, statsmodels.tsa.exponential_smoothing._ets_smooth, scipy.fftpack.convolve, statsmodels.tsa._stl, statsmodels.tsa.holtwinters._exponential_smoothers, statsmodels.tsa.regime_switching._hamilton_filter, statsmodels.tsa.regime_switching._kim_smoother, PyQt5.QtWebKit, PyQt5.QtWebKitWidgets, PyQt5.QtQml, PyQt5.QtDBus, PyQt5.QtDesigner, PyQt5.QtHelp, PyQt5.QtMultimedia, PyQt5.QtMultimediaWidgets, PyQt5.QtOpenGL, PyQt5.QtLocation, PyQt5.QtQuick, PyQt5.QtQuickWidgets, PyQt5.QtRemoteObjects, PyQt5.QtSensors, PyQt5.QtSerialPort, PyQt5.QtTextToSpeech, PyQt5.QtWebChannel, PyQt5.QtWebSockets, PyQt5.QtXmlPatterns, qgis._analysis, yaml._yaml, psycopg2._psycopg, qgis._3d (total: 228)

Stack Trace
No stack trace is available.

QGIS Info
QGIS Version: 3.27.0-Master
QGIS code revision: 8f5c1cf288
Compiled against Qt: 5.15.4
Running against Qt: 5.15.4
Compiled against GDAL: 3.5.1
Running against GDAL: 3.5.1

System Info
CPU Type: x86_64
Kernel Type: linux
Kernel Version: 5.18.0-4-amd64

and this in the terminal:

QGIS died on signal 11Extra Info File: /tmp/qgis-crash-info-107655
QTextCursor::setPosition: Position '1' out of range
QTextCursor::setPosition: Position '1' out of range

and this is the message with a new profile:


Warning: WARNING Qt AtSpiAdaptor: Accessible invalid:  QAccessibleInterface(0x55a6c3271450 invalid) "/org/a11y/atspi/accessible/2147484519"
Warning: WARNING Qt AtSpiAdaptor: Accessible invalid:  QAccessibleInterface(0x55a6c3271450 invalid) "/org/a11y/atspi/accessible/2147484519"
Warning: Sending TextCaretMoved from object that does not implement text interface:  QAccessibleInterface(0x55a6c898c780 name="Using prepared APIs file" role=Client obj=QLineEdit(0x55a6c8989b90, name = "lineEdit")"focusable|invisible")
malloc(): unaligned fastbin chunk detected
Aborted

Steps to reproduce the issue

Just write some code in the python editor (or console) and soon or later it crashes

Versions

QGIS 3.22 installed from repositories, QGIS 3.24 compiled and QGIS master compiled.

Supported QGIS version

New profile

Additional context

No response

elpaso commented 2 years ago

Without a way to reproduce have no choice but to close this issue.

ghtmtt commented 2 years ago

@elpaso I made a dist-upgrade and recompiled QGIS and it seems working now. Apparently some python versions were making some noise. I'm closing the issue. Thanks for the feedback

adamgis2022 commented 2 years ago

Mine crashes all the time. So annoying. Crashes like 20 times a day when I write code in the python script editor. There is definitely a bug

wdossett commented 1 year ago

@ghtmtt I'm trying to learn how to use Python in Q and it crashes so often as to make it almost impossible to work. I'm using Windows. Is there a way to do an equivalent to a dist-upgrade or recompiling that might solve the problem?

dtiger10 commented 4 months ago

@elpaso I made a dist-upgrade and recompiled QGIS and it seems working now. Apparently some python versions were making some noise. I'm closing the issue. Thanks for the feedback

Hi, thanks for solving this issue. what is "dist-upgrade". I am having the same issue on 3.36.3