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

qgis crashes at random. python segfault unable to open database file #59717

Open
2 tasks done
a-random-lemurian opened this issue Dec 3, 2024 · 4 comments
Open
2 tasks done
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter!

Comments

@a-random-lemurian
Copy link

What is the bug or the crash?

I have no idea. QGIS just dies on signal 11.

[1]    185690 IOT instruction (core dumped)  QGIS_DEBUG=9 QGIS_LOG_FILE=/tmp/qgis.log qgis
ERROR 1: In ExecuteSQL(): sqlite3_step(SELECT COUNT(*) FROM (SELECT 1 FROM "table1" LIMIT 100000)):
  unable to open database file
ERROR 1: In ExecuteSQL(): sqlite3_step(SELECT COUNT(*) FROM (SELECT 1 FROM "table2" LIMIT 100000)):
  unable to open database file
Warning 1: GPKG: bad application_id=0x00000000 on '/home/user/Documents/maps/qgis/DATA/data.gpkg'
ERROR 1: In ExecuteSQL(): sqlite3_step(SELECT COUNT(*) FROM (SELECT 1 FROM "table3" LIMIT 100000)):
  unable to open database file
  • My actual username has been removed
  • There was nothing in /tmp/qgis.log
  • The table names have been changed, because sensitive data.
  • The bad application_id is probably because in an attempt to rectify the issue, I dumped the old gpkg file and then had sqlite create a new gpkg file based on the dump and the application id didn't transfer over. No, it did not solve the problem.

Also, Python segfaulted.

Fatal Python error: Segmentation fault

Thread 0x00007a66ce5ba2c0 (most recent call first):
  <no Python frame>

Extension modules: PyQt5.QtCore, PyQt5.QtXml, PyQt5.QtNetwork, PyQt5.QtGui, PyQt5.QtWidgets, PyQt5.QtSql, PyQt5.QtPrintSupport, PyQt5.QtPositioning, PyQt5.QtSerialPort, qgis._core, PyQt5.QtMultimedia, PyQt5.Qsci, qgis._gui, numpy.core._multiarray_umath, numpy.core._multiarray_tests, 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, osgeo._gdal, osgeo._gdalconst, osgeo._ogr, osgeo._osr, osgeo._gdal_array, osgeo._gnm, qgis._analysis, yaml._yaml, psycopg2._psycopg, lxml._elementpath, lxml.etree, _brotli, markupsafe._speedups (total: 39)
Fatal Python error: Aborted

Thread 0x00007a66ce5ba2c0 (most recent call first):
  <no Python frame>

Extension modules: PyQt5.QtCore, PyQt5.QtXml, PyQt5.QtNetwork, PyQt5.QtGui, PyQt5.QtWidgets, PyQt5.QtSql, PyQt5.QtPrintSupport, PyQt5.QtPositioning, PyQt5.QtSerialPort, qgis._core, PyQt5.QtMultimedia, PyQt5.Qsci, qgis._gui, numpy.core._multiarray_umath, numpy.core._multiarray_tests, 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, osgeo._gdal, osgeo._gdalconst, osgeo._ogr, osgeo._osr, osgeo._gdal_array, osgeo._gnm, qgis._analysis, yaml._yaml, psycopg2._psycopg, lxml._elementpath, lxml.etree, _brotli, markupsafe._speedups (total: 39)

I had QGIS 3.34 Prizren, so I tried to upgrade to 3.40.1 Bratislava to see if the bug got fixed, and no, the same crash behavior still happened.

Steps to reproduce the issue

I'm working with some sensitive data that does crash. It is old, it was last modified in 2023.

When I create completely new projects from scratch it is somehow impossible to reproduce.

But with the old data, it can happen at any of:

  1. I open the offending qgz file and it crashes before any data is loaded.
  2. I turn on edit on a layer and.. it crashes.
  3. I try to place a point and.. it crashes.

Versions

QGIS version3.40.1-Bratislava
QGIS code revision989853a7a31
 
Libraries
Qt version5.15.13
Python version3.12.3
GDAL/OGR version3.8.4
PROJ version9.4.0
EPSG Registry database versionv11.004 (2024-02-24)
GEOS version3.12.1-CAPI-1.18.1
SQLite version3.45.1 (Compiled)
3.47.0 (Running)
PostgreSQL client version16.4 (Ubuntu 16.4-0ubuntu0.24.04.2)
SpatiaLite version5.1.0
QWT version6.1.4
QScintilla2 version2.14.1
OS versionUbuntu 24.04 LTS
 
Active Python plugins
consolidate_networks1.7
searchlayers3.1.1
BezierEditingversion 1.3.8
db_manager0.1.20
processing2.12.99
grassprovider2.12.99
MetaSearch0.3.6

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

As this is my first issue, I would like help in making QGIS output more logs so I can at least try to provide something that will help with the crash. Thanks.

@a-random-lemurian a-random-lemurian added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Dec 3, 2024
@a-random-lemurian
Copy link
Author

P.S. Regarding SQLite: Is a mismatching compiled/running version a bad thing?

@a-random-lemurian
Copy link
Author

Okay.. debugging with GDB, I find that when I ctrl c when qgis lags and starts polling like crazy (as I see in strace), that SQLite might be a problem. ulimit -n returns 1024, so let's see what happens if I set it to unlimited, at around 1048576.

Thread 1 "qgis.bin" received signal SIGINT, Interrupt.
0x00007fffec0461d0 in findReusableFd () from /usr/local/lib/libsqlite3.so.0

@a-random-lemurian
Copy link
Author

I had another crash after saving and I can definitively say that it is not sqlite.

^C
Thread 1 "qgis.bin" received signal SIGINT, Interrupt.
Download failed: Invalid argument.  Continuing without source file ./nptl/./nptl/futex-internal.c.
0x00007ffff1498d61 in __futex_abstimed_wait_common64 (private=32767, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x7fffffffbe58) at ./nptl/futex-internal.c:57
warning: 57	./nptl/futex-internal.c: No such file or directory
(gdb) bt
#0  0x00007ffff1498d61 in __futex_abstimed_wait_common64 (private=32767, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x7fffffffbe58) at ./nptl/futex-internal.c:57
#1  __futex_abstimed_wait_common (cancel=true, private=32767, abstime=0x0, clockid=0, expected=0, futex_word=0x7fffffffbe58) at ./nptl/futex-internal.c:87
#2  __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x7fffffffbe58, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at ./nptl/futex-internal.c:139
#3  0x00007ffff149b7dd in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x5555557fda08, cond=0x7fffffffbe30) at ./nptl/pthread_cond_wait.c:503
#4  ___pthread_cond_wait (cond=cond@entry=0x7fffffffbe30, mutex=mutex@entry=0x5555557fda08) at ./nptl/pthread_cond_wait.c:627
#5  0x00007fffe3de3f73 in _xcb_conn_wait (count=0x0, vector=0x0, cond=0x7fffffffbe30, c=0x5555557fd9f0) at ../../src/xcb_conn.c:476
#6  wait_for_reply (c=c@entry=0x5555557fd9f0, request=43289, e=e@entry=0x0) at ../../src/xcb_in.c:522
#7  0x00007fffe3de4e6e in xcb_wait_for_reply (c=0x5555557fd9f0, request=43289, e=0x0) at ../../src/xcb_in.c:538
#8  0x00007fffdeed4996 in QXcbConnection::sync (this=0x5555557fb2b0) at /usr/src/qtbase-opensource-src-5.15.13 dfsg-1ubuntu1/src/plugins/platforms/xcb/qxcbconnection_basic.h:71
#9  0x00007fffdeeef67c in QXcbBackingStoreImage::preparePaint (this=0x55555a22b8e0, region=...) at qxcbbackingstore.cpp:763
#10 0x00007fffdeeef9f8 in QXcbBackingStore::beginPaint (this=this@entry=0x555559a41070, region=...) at qxcbbackingstore.cpp:802
#11 0x00007ffff4b27467 in QBackingStore::beginPaint (this=0x555557f66b20, region=...) at painting/qbackingstore.cpp:138
#12 0x00007ffff517dbc8 in QWidgetRepaintManager::paintAndFlush (this=0x55555a094f00) at kernel/qwidgetrepaintmanager.cpp:989
#13 0x00007ffff51b146c in QWidget::event (this=0x5555562d58b0, event=0x7fff9c00e6b0) at kernel/qwidget.cpp:8990
#14 0x00007ffff516bd45 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x5555562d58b0, e=0x7fff9c00e6b0) at kernel/qapplication.cpp:3640
#15 0x00007ffff2ac46e2 in QgsApplication::notify(QObject*, QEvent*) () at /lib/libqgis_core.so.3.40.1
#16 0x00007ffff44d8118 in QCoreApplication::notifyInternal2 (receiver=0x5555562d58b0, event=0x7fff9c00e6b0) at kernel/qcoreapplication.cpp:1064
#17 0x00007ffff44d8332 in QCoreApplication::sendEvent (receiver=<optimized out>, event=<optimized out>) at kernel/qcoreapplication.cpp:1462
#18 0x00007ffff44db94b in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x5555555ffe10) at kernel/qcoreapplication.cpp:1821
#19 0x00007ffff44dbebd in QCoreApplication::sendPostedEvents (receiver=<optimized out>, event_type=<optimized out>) at kernel/qcoreapplication.cpp:1680
#20 0x00007ffff4535c0f in postEventSourceDispatch (s=0x555555926850) at kernel/qeventdispatcher_glib.cpp:277
#21 0x00007fffea6075b5 in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#22 0x00007fffea666717 in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#23 0x00007fffea606a53 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#24 0x00007ffff4535279 in QEventDispatcherGlib::processEvents (this=0x555555904eb0, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#25 0x00007ffff44d6a7b in QEventLoop::exec (this=this@entry=0x7fffffffc790, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#26 0x00007ffff44df3e8 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#27 0x0000555555563ca1 in ??? ()
#28 0x00007ffff142a1ca in __libc_start_call_main (main=main@entry=0x555555560fa0, argc=argc@entry=1, argv=argv@entry=0x7fffffffd4e8) at ../sysdeps/nptl/libc_start_call_main.h:58
#29 0x00007ffff142a28b in __libc_start_main_impl (main=0x555555560fa0, argc=1, argv=0x7fffffffd4e8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffd4d8) at ../csu/libc-start.c:360
#30 0x00005555555667f5 in ??? ()
(gdb) c
Continuing.
^C
Thread 1 "qgis.bin" received signal SIGINT, Interrupt.
Download failed: Invalid argument.  Continuing without source file ./io/../sysdeps/unix/sysv/linux/poll.c.
0x00007ffff151b4cd in __GI___poll (fds=0x555557e76080, nfds=9, timeout=9) at ../sysdeps/unix/sysv/linux/poll.c:29
warning: 29	../sysdeps/unix/sysv/linux/poll.c: No such file or directory
(gdb) bt
#0  0x00007ffff151b4cd in __GI___poll (fds=0x555557e76080, nfds=9, timeout=9) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007fffea66666e in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fffea606a53 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff4535279 in QEventDispatcherGlib::processEvents (this=0x555555904eb0, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#4  0x00007ffff44d6a7b in QEventLoop::exec (this=this@entry=0x7fffffffc790, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#5  0x00007ffff44df3e8 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#6  0x0000555555563ca1 in ??? ()
#7  0x00007ffff142a1ca in __libc_start_call_main (main=main@entry=0x555555560fa0, argc=argc@entry=1, argv=argv@entry=0x7fffffffd4e8) at ../sysdeps/nptl/libc_start_call_main.h:58
#8  0x00007ffff142a28b in __libc_start_main_impl (main=0x555555560fa0, argc=1, argv=0x7fffffffd4e8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffd4d8) at ../csu/libc-start.c:360
#9  0x00005555555667f5 in ??? ()
(gdb) c
Continuing.
^C
Thread 1 "qgis.bin" received signal SIGINT, Interrupt.
0x00007ffff151b4cd in __GI___poll (fds=0x555557e76080, nfds=9, timeout=16) at ../sysdeps/unix/sysv/linux/poll.c:29
29	in ../sysdeps/unix/sysv/linux/poll.c
(gdb) bt
#0  0x00007ffff151b4cd in __GI___poll (fds=0x555557e76080, nfds=9, timeout=16) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007fffea66666e in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fffea606a53 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff4535279 in QEventDispatcherGlib::processEvents (this=0x555555904eb0, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#4  0x00007ffff44d6a7b in QEventLoop::exec (this=this@entry=0x7fffffffc790, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#5  0x00007ffff44df3e8 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#6  0x0000555555563ca1 in ??? ()
#7  0x00007ffff142a1ca in __libc_start_call_main (main=main@entry=0x555555560fa0, argc=argc@entry=1, argv=argv@entry=0x7fffffffd4e8) at ../sysdeps/nptl/libc_start_call_main.h:58
#8  0x00007ffff142a28b in __libc_start_main_impl (main=0x555555560fa0, argc=1, argv=0x7fffffffd4e8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffd4d8) at ../csu/libc-start.c:360
#9  0x00005555555667f5 in ??? ()
(gdb) c
Continuing.
[Thread 0x7fff2d2006c0 (LWP 2418539) exited]
[Thread 0x7fff395006c0 (LWP 2418224) exited]
[Thread 0x7fff696006c0 (LWP 2418218) exited]
[Thread 0x7fff6b4006c0 (LWP 2418217) exited]
[Thread 0x7fff52a006c0 (LWP 2418222) exited]
[Thread 0x7fff534006c0 (LWP 2418221) exited]
[New Thread 0x7fff534006c0 (LWP 2420107)]
[New Thread 0x7fff52a006c0 (LWP 2420108)]
[New Thread 0x7fff6b4006c0 (LWP 2420109)]
[New Thread 0x7fff395006c0 (LWP 2420110)]
[New Thread 0x7fff2d2006c0 (LWP 2420111)]

@a-random-lemurian
Copy link
Author

Updating SQLite to 3.47.1 may have fixed the problem, but I'm not confident enough yet.

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!
Projects
None yet
Development

No branches or pull requests

1 participant