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

[Bug]: Crash: free(): invalid next size (fast) #3267

Open
1 task done
Jonny007-MKD opened this issue Jan 25, 2023 · 15 comments
Open
1 task done

[Bug]: Crash: free(): invalid next size (fast) #3267

Jonny007-MKD opened this issue Jan 25, 2023 · 15 comments

Comments

@Jonny007-MKD
Copy link

Jonny007-MKD commented Jan 25, 2023

What did you do?

I wrote some query using some left joins, then clicked on the "Browse Data" tab. In this moment, DB4S crashes

What did you expect to see?

No crash

What did you see instead?

The only output on the console:

free(): invalid next size (fast)

DB4S Version

Today's master (496d39d)

What OS are you seeing the problem on?

Linux

OS version

Linux Mint LMDE Bullseye

Relevant log output

No response

Prevention against duplicate issues

  • I have searched for similar issues
@chrisjlocke
Copy link
Member

Not had a report of this before. Is it reproducable? ie, if you did it again, does it occur again?
Is the database local, or in some wacky filesystem?

@Jonny007-MKD
Copy link
Author

No, I couldn't reproduce it in the last 20 minutes. Can I start the app with some verbose logging or stack traces or something?
The database is local on my Ext4 filesystem.

@chrisjlocke
Copy link
Member

chrisjlocke commented Jan 26, 2023

No. There is only the logging in the 'Log' panel, showing commands sent to sqlite and the return results.
We've not had reports of this before, so I'd lean towards it being an odd-ball case.
Typing in the execute SQL window has no bearing on the 'browse data' tab, unless of course the SQL amends the schema (add, delete tables, etc) but not in the middle of typing.
Linux is a weird beast, and you've done the right thing compiling from master. Thats a slightly different codebase than the 3.12.2 release (or earlier) that some distros have in their packages. 3.12.2 is getting quite old now...

@Jonny007-MKD
Copy link
Author

Jonny007-MKD commented Jan 27, 2023

Yes, and I faced a crash in 3.12.2 that was fixed on master ;)
I think I'm going to run DB4S in gdb for the next time. Maybe it at least reveals some stack or so.

@justinclift
Copy link
Member

Yeah, the "need to be able to trigger it again" thing is kind of a pain. Not much choice though. 😉

@Jonny007-MKD
Copy link
Author

Again, I had an error in my custom SQL query and wanted to switch to the data tab:

Thread 1 "sqlitebrowser" received signal SIGSEGV, Segmentation fault.
0x00007ffff67075e3 in QHashData::free_helper(void (*)(QHashData::Node*)) ()
   from /lib/x86_64-linux-gnu/libQt5Core.so.5

(gdb) bt
#0  0x00007ffff67075e3 in QHashData::free_helper(void (*)(QHashData::Node*)) ()
    at /lib/x86_64-linux-gnu/libQt5Core.so.5
#1  0x00007ffff761d5f0 in  () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#2  0x00007ffff7604f25 in  () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#3  0x00007ffff7605014 in  () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#4  0x00007ffff7605014 in  () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#5  0x00007ffff760514c in  () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#6  0x000055555579ff81 in TableBrowserDock::setFocusStyle(bool) (this=<optimized out>, on=on@entry=false)
    at build/sqlitebrowser/src/TableBrowserDock.cpp:62
#7  0x000055555567776a in MainWindow::changeTableBrowserTab(TableBrowserDock*)
    (this=0x555555dfc950, dock=0x555556392c90) at build/sqlitebrowser/src/MainWindow.cpp:3906
#8  0x000055555567798a in MainWindow::dataTableSelectionChanged(QModelIndex const&) (this=0x555555dfc950, index=...)
    at build/sqlitebrowser/src/MainWindow.cpp:1083
#9  0x00007ffff68e45a6 in  () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#10 0x00007ffff6848ba5 in QAbstractItemModel::dataChanged(QModelIndex const&, QModelIndex const&, QVector<int> const&) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#11 0x00005555556e37d2 in SqliteTableModel::handleFinishedFetch(int, unsigned int, unsigned int)
    (this=0x5555564e1a40, life_id=<optimized out>, fetched_row_begin=0, fetched_row_end=3)
    at build/sqlitebrowser/src/sqlitetablemodel.cpp:83
#12 0x00007ffff68d9ff1 in QObject::event(QEvent*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#13 0x00007ffff756315f in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
    at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#14 0x00007ffff68adfca in QCoreApplication::notifyInternal2(QObject*, QEvent*) ()
    at /lib/x86_64-linux-gnu/libQt5Core.so.5
#15 0x00007ffff68b0a01 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) ()
    at /lib/x86_64-linux-gnu/libQt5Core.so.5
#16 0x00007ffff6905e93 in  () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#17 0x00007ffff5a5ee6b in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#18 0x00007ffff5a5f118 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#19 0x00007ffff5a5f1cf in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#20 0x00007ffff690551f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
    at /lib/x86_64-linux-gnu/libQt5Core.so.5
#21 0x00007ffff68ac98b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
    at /lib/x86_64-linux-gnu/libQt5Core.so.5
#22 0x00007ffff68b4c00 in QCoreApplication::exec() () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#23 0x00005555555f76ab in main(int, char**) (argc=<optimized out>, argv=<optimized out>)
    at build/sqlitebrowser/src/main.cpp:63

@scottfurry
Copy link
Contributor

scottfurry commented Jan 30, 2023 via email

@Jonny007-MKD
Copy link
Author

As far as i can tell (dpkg -l | grep qt) I only have Qt version 5.15.2 installed. Is there anything else I should check?

@scottfurry
Copy link
Contributor

scottfurry commented Jan 30, 2023 via email

@scottfurry
Copy link
Contributor

FWIW, Debian stable has DB4S at an old version 3.12.1. @Jonny007-MKD, Can you confirm your version of application, please?

@Jonny007-MKD
Copy link
Author

True, I am running Linux Mint LMDE which is based on Bullseye.
Due to some other bugs in 3.12.1 I built DB4S myself from current master (commit 496d39d).

@Jonny007-MKD
Copy link
Author

Another segfault when switching tabs (from Data to Execute SQL I believe)

Thread 1 "sqlitebrowser" received signal SIGSEGV, Segmentation fault.
0x00007ffff6707803 in QHashData::nextNode(QHashData::Node*) () from /lib/x86_64-linux-gnu/libQt5Core.so.5
(gdb) bt
#0  0x00007ffff6707803 in QHashData::nextNode(QHashData::Node*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#1  0x00007ffff6dc5435 in  () at /lib/x86_64-linux-gnu/libQt5Gui.so.5
#2  0x00007ffff6dc5538 in  () at /lib/x86_64-linux-gnu/libQt5Gui.so.5
#3  0x00007ffff68d9f2f in QObject::event(QEvent*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007ffff756315f in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
    at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#5  0x00007ffff68adfca in QCoreApplication::notifyInternal2(QObject*, QEvent*) ()
    at /lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007ffff69048e3 in QTimerInfoList::activateTimers() () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007ffff690519c in  () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007ffff5a5ee6b in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#9  0x00007ffff5a5f118 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#10 0x00007ffff5a5f1cf in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#11 0x00007ffff690551f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
    at /lib/x86_64-linux-gnu/libQt5Core.so.5
#12 0x00007ffff68ac98b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
    at /lib/x86_64-linux-gnu/libQt5Core.so.5
#13 0x00007ffff68b4c00 in QCoreApplication::exec() () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#14 0x00005555555f76ab in main(int, char**) (argc=<optimized out>, argv=<optimized out>)
    at build/sqlitebrowser/src/main.cpp:63

@justinclift
Copy link
Member

Interesting. Would you be ok to paste the output of ldd for your compiled sqlitebrowser executable?

eg on my system here, it's:

$ ldd sqlitebrowser
        linux-vdso.so.1 (0x00007ffd1390e000)
        libsqlite3.so.0 => /lib/x86_64-linux-gnu/libsqlite3.so.0 (0x00007f2781956000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f2781933000)
        libQt5Network.so.5 => /lib/x86_64-linux-gnu/libQt5Network.so.5 (0x00007f2781772000)
        libQt5Xml.so.5 => /lib/x86_64-linux-gnu/libQt5Xml.so.5 (0x00007f2781730000)
        libqscintilla2_qt5.so.15 => /lib/libqscintilla2_qt5.so.15 (0x00007f27810f4000)
        libQt5PrintSupport.so.5 => /lib/x86_64-linux-gnu/libQt5PrintSupport.so.5 (0x00007f278107b000)
        libQt5Widgets.so.5 => /lib/x86_64-linux-gnu/libQt5Widgets.so.5 (0x00007f27809de000)
        libQt5Gui.so.5 => /lib/x86_64-linux-gnu/libQt5Gui.so.5 (0x00007f27803f3000)
        libQt5Core.so.5 => /lib/x86_64-linux-gnu/libQt5Core.so.5 (0x00007f277feaa000)
        libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f277fcc8000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f277fb79000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f277fb5e000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f277f96a000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f27820b9000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f277f964000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f277f948000)
        libGL.so.1 => /lib/x86_64-linux-gnu/libGL.so.1 (0x00007f277f8c0000)
        libpng16.so.16 => /lib/x86_64-linux-gnu/libpng16.so.16 (0x00007f277f888000)
        libharfbuzz.so.0 => /lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007f277f782000)
        libicui18n.so.66 => /lib/x86_64-linux-gnu/libicui18n.so.66 (0x00007f277f483000)
        libicuuc.so.66 => /lib/x86_64-linux-gnu/libicuuc.so.66 (0x00007f277f29d000)
        libpcre2-16.so.0 => /lib/x86_64-linux-gnu/libpcre2-16.so.0 (0x00007f277f219000)
        libdouble-conversion.so.3 => /lib/x86_64-linux-gnu/libdouble-conversion.so.3 (0x00007f277f203000)
        libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f277f0da000)
        libGLdispatch.so.0 => /lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007f277f020000)
        libGLX.so.0 => /lib/x86_64-linux-gnu/libGLX.so.0 (0x00007f277efec000)
        libfreetype.so.6 => /lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f277ef2d000)
        libgraphite2.so.3 => /lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007f277ef00000)
        libicudata.so.66 => /lib/x86_64-linux-gnu/libicudata.so.66 (0x00007f277d43f000)
        libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f277d3ca000)
        libX11.so.6 => /lib/x86_64-linux-gnu/libX11.so.6 (0x00007f277d28d000)
        libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f277d263000)
        libXau.so.6 => /lib/x86_64-linux-gnu/libXau.so.6 (0x00007f277d25d000)
        libXdmcp.so.6 => /lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f277d255000)
        libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007f277d239000)

With that, we can take a look a the paths to the Qt libraries it's using, and see if anything strange is showing up.

@Jonny007-MKD
Copy link
Author

Sure :)

linux-vdso.so.1 (0x00007fff7f7da000)
libsqlite3.so.0 => /lib/x86_64-linux-gnu/libsqlite3.so.0 (0x00007fe65f216000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fe65f1f4000)
libQt5Network.so.5 => /lib/x86_64-linux-gnu/libQt5Network.so.5 (0x00007fe65f06c000)
libQt5Xml.so.5 => /lib/x86_64-linux-gnu/libQt5Xml.so.5 (0x00007fe65f028000)
libQt5PrintSupport.so.5 => /lib/x86_64-linux-gnu/libQt5PrintSupport.so.5 (0x00007fe65efba000)
libQt5Widgets.so.5 => /lib/x86_64-linux-gnu/libQt5Widgets.so.5 (0x00007fe65e800000)
libQt5Gui.so.5 => /lib/x86_64-linux-gnu/libQt5Gui.so.5 (0x00007fe65e000000)
libQt5Core.so.5 => /lib/x86_64-linux-gnu/libQt5Core.so.5 (0x00007fe65da00000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fe65d833000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fe65d6ef000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fe65ef9e000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fe65d51a000)
/lib64/ld-linux-x86-64.so.2 (0x00007fe65fa67000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fe65ef96000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fe65ef79000)
libgssapi_krb5.so.2 => /lib/x86_64-linux-gnu/libgssapi_krb5.so.2 (0x00007fe65ef26000)
libGL.so.1 => /lib/x86_64-linux-gnu/libGL.so.1 (0x00007fe65ee9f000)
libpng16.so.16 => /lib/x86_64-linux-gnu/libpng16.so.16 (0x00007fe65e7c6000)
libharfbuzz.so.0 => /lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007fe65e6de000)
libmd4c.so.0 => /lib/x86_64-linux-gnu/libmd4c.so.0 (0x00007fe65ee8b000)
libdouble-conversion.so.3 => /lib/x86_64-linux-gnu/libdouble-conversion.so.3 (0x00007fe65e6c7000)
libicui18n.so.67 => /lib/x86_64-linux-gnu/libicui18n.so.67 (0x00007fe65d200000)
libicuuc.so.67 => /lib/x86_64-linux-gnu/libicuuc.so.67 (0x00007fe65d017000)
libpcre2-16.so.0 => /lib/x86_64-linux-gnu/libpcre2-16.so.0 (0x00007fe65df75000)
libzstd.so.1 => /lib/x86_64-linux-gnu/libzstd.so.1 (0x00007fe65cf3c000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fe65ce0d000)
libkrb5.so.3 => /lib/x86_64-linux-gnu/libkrb5.so.3 (0x00007fe65cd33000)
libk5crypto.so.3 => /lib/x86_64-linux-gnu/libk5crypto.so.3 (0x00007fe65cd03000)
libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007fe65df6f000)
libkrb5support.so.0 => /lib/x86_64-linux-gnu/libkrb5support.so.0 (0x00007fe65df60000)
libGLdispatch.so.0 => /lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007fe65cc4b000)
libGLX.so.0 => /lib/x86_64-linux-gnu/libGLX.so.0 (0x00007fe65cc17000)
libfreetype.so.6 => /lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007fe65cb54000)
libgraphite2.so.3 => /lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007fe65cb28000)
libicudata.so.67 => /lib/x86_64-linux-gnu/libicudata.so.67 (0x00007fe65b000000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007fe65af8d000)
libkeyutils.so.1 => /lib/x86_64-linux-gnu/libkeyutils.so.1 (0x00007fe65df57000)
libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007fe65af73000)
libX11.so.6 => /lib/x86_64-linux-gnu/libX11.so.6 (0x00007fe65ae30000)
libbrotlidec.so.1 => /lib/x86_64-linux-gnu/libbrotlidec.so.1 (0x00007fe65d50c000)
libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007fe65ae05000)
libbrotlicommon.so.1 => /lib/x86_64-linux-gnu/libbrotlicommon.so.1 (0x00007fe65ade2000)
libXau.so.6 => /lib/x86_64-linux-gnu/libXau.so.6 (0x00007fe65df50000)
libXdmcp.so.6 => /lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007fe65aa00000)
libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007fe65adcb000)
libmd.so.0 => /lib/x86_64-linux-gnu/libmd.so.0 (0x00007fe65cb1b000)

@justinclift
Copy link
Member

Hmmm, nothing looks obviously out of place there. So, doesn't seem like a mismatched Qt library (or similar) being the problem.

This is feeling like a bug, more than some kind of system configuration problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants