Bug 379447 - Creating a query crashes
Summary: Creating a query crashes
Status: CLOSED FIXED
Alias: None
Product: KEXI
Classification: Applications
Component: Queries (show other bugs)
Version: 3.0.1
Platform: Compiled Sources Linux
: HI crash
Target Milestone: 3.1
Assignee: Jarosław Staniek
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2017-05-02 19:25 UTC by ksso
Modified: 2017-10-22 21:16 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 3.1.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ksso 2017-05-02 19:25:09 UTC
Application: kexi (3.0.1 (git 31587f2 master))
 (Compiled from sources)
Qt Version: 5.8.0
Frameworks Version: 5.33.0
Operating System: Linux 4.10.9-1 x86_64
Distribution: "KaOS"

-- Information about the crash:
- What I was doing when the application crashed: making a query
 making a query (consulta) 
and it crashes, first a table and a form

The crash can be reproduced every time.

-- Backtrace:
Application: Kexi (kexi), signal: Segmentation fault
Using host libthread_db library "/lib/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f6668b42c80 (LWP 2023))]

Thread 5 (Thread 0x7f66291bb700 (LWP 2333)):
#0  0x00007f6678c3dc79 in syscall () at /lib/libc.so.6
#1  0x00007f667145a6d4 in g_cond_wait_until () at /usr/lib/libglib-2.0.so.0
#2  0x00007f66713eada9 in  () at /usr/lib/libglib-2.0.so.0
#3  0x00007f66713eb39b in g_async_queue_timeout_pop () at /usr/lib/libglib-2.0.so.0
#4  0x00007f667143d85a in  () at /usr/lib/libglib-2.0.so.0
#5  0x00007f667143ce15 in  () at /usr/lib/libglib-2.0.so.0
#6  0x00007f6674912494 in start_thread () at /lib/libpthread.so.0
#7  0x00007f6678c426ff in clone () at /lib/libc.so.6

Thread 4 (Thread 0x7f664e622700 (LWP 2031)):
#0  0x00007f66749185cf in pthread_cond_wait@@GLIBC_2.3.2 () at /lib/libpthread.so.0
#1  0x00007f6674eee6bc in __gthread_cond_wait (__mutex=<optimized out>, __cond=<optimized out>) at /buildsys/core/gcc/src/gcc-build/x86_64-unknown-linux-gnu/libstdc++-v3/include/x86_64-unknown-linux-gnu/bits/gthr-default.h:864
#2  0x00007f6674eee6bc in std::condition_variable::wait(std::unique_lock<std::mutex>&) (this=<optimized out>, __lock=...) at /buildsys/core/gcc/src/gcc-5-20170214/libstdc++-v3/src/c++11/condition_variable.cc:53
#3  0x00007f665388b30e in  () at /usr/lib/libQt5WebKit.so.5
#4  0x00007f665388b429 in  () at /usr/lib/libQt5WebKit.so.5
#5  0x00007f6674ef3850 in std::execute_native_thread_routine(void*) (__p=<optimized out>) at /buildsys/core/gcc/src/gcc-5-20170214/libstdc++-v3/src/c++11/thread.cc:84
#6  0x00007f6674912494 in start_thread () at /lib/libpthread.so.0
#7  0x00007f6678c426ff in clone () at /lib/libc.so.6

Thread 3 (Thread 0x7f665e0e2700 (LWP 2026)):
#0  0x00007f667145a4a4 in g_mutex_unlock () at /usr/lib/libglib-2.0.so.0
#1  0x00007f6671414fb0 in g_main_context_prepare () at /usr/lib/libglib-2.0.so.0
#2  0x00007f6671415933 in  () at /usr/lib/libglib-2.0.so.0
#3  0x00007f6671415b0c in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#4  0x00007f66791beebb in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#5  0x00007f667916cbba in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#6  0x00007f6678fa1d7c in QThread::exec() () at /usr/lib/libQt5Core.so.5
#7  0x00007f6679d77975 in  () at /usr/lib/libQt5DBus.so.5
#8  0x00007f6678fa66e9 in  () at /usr/lib/libQt5Core.so.5
#9  0x00007f6674912494 in start_thread () at /lib/libpthread.so.0
#10 0x00007f6678c426ff in clone () at /lib/libc.so.6

Thread 2 (Thread 0x7f6666357700 (LWP 2025)):
#0  0x00007f6678c38ffd in poll () at /lib/libc.so.6
#1  0x00007f666cb99892 in  () at /usr/lib/libxcb.so.1
#2  0x00007f666cb9b5e7 in xcb_wait_for_event () at /usr/lib/libxcb.so.1
#3  0x00007f66688e2da9 in  () at /usr/lib/qt5/plugins/platforms/../../../libQt5XcbQpa.so.5
#4  0x00007f6678fa66e9 in  () at /usr/lib/libQt5Core.so.5
#5  0x00007f6674912494 in start_thread () at /lib/libpthread.so.0
#6  0x00007f6678c426ff in clone () at /lib/libc.so.6

Thread 1 (Thread 0x7f6668b42c80 (LWP 2023)):
[KCrash Handler]
#5  0x00007f66778edeb0 in KDbConnection::driver() const () at /usr/lib/libKDb3.so.3
#6  0x00007f66778ce7fa in KDbOrderByColumn::toSQLString(bool, KDbConnection*, KDb::IdentifierEscapingType) const () at /usr/lib/libKDb3.so.3
#7  0x00007f66778cee6d in KDbOrderByColumnList::toSQLString(bool, KDbConnection*, KDb::IdentifierEscapingType) const () at /usr/lib/libKDb3.so.3
#8  0x00007f667793fca2 in  () at /usr/lib/libKDb3.so.3
#9  0x00007f663cca2e46 in  () at /usr/lib/qt5/plugins/kexi/kexi_queryplugin.so
#10 0x00007f663ccaf33d in  () at /usr/lib/qt5/plugins/kexi/kexi_queryplugin.so
#11 0x00007f667824ebef in KexiWindow::storeNewData(QFlags<KexiView::StoreNewDataOption>) () at /usr/lib/libkexicore.so.15
#12 0x00007f6679a46ddd in KexiMainWindow::saveObject(KexiWindow*, QString const&, QFlags<KexiMainWindowIface::SaveObjectOption>) () at /usr/lib/libkeximain.so.15
#13 0x00007f6679a4600e in KexiMainWindow::slotProjectSave() () at /usr/lib/libkeximain.so.15
#14 0x00007f6679aa339d in  () at /usr/lib/libkeximain.so.15
#15 0x00007f66791975d1 in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/libQt5Core.so.5
#16 0x00007f66795125d2 in QAction::triggered(bool) () at /usr/lib/libQt5Widgets.so.5
#17 0x00007f6679514a70 in QAction::activate(QAction::ActionEvent) () at /usr/lib/libQt5Widgets.so.5
#18 0x00007f6679514f9f in  () at /usr/lib/libQt5Widgets.so.5
#19 0x00007f66791975d1 in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/libQt5Core.so.5
#20 0x00007f66795f9132 in QAbstractButton::clicked(bool) () at /usr/lib/libQt5Widgets.so.5
#21 0x00007f66795f9324 in  () at /usr/lib/libQt5Widgets.so.5
#22 0x00007f66795faec7 in  () at /usr/lib/libQt5Widgets.so.5
#23 0x00007f66795fb01c in QAbstractButton::mouseReleaseEvent(QMouseEvent*) () at /usr/lib/libQt5Widgets.so.5
#24 0x00007f66796bb5da in QToolButton::mouseReleaseEvent(QMouseEvent*) () at /usr/lib/libQt5Widgets.so.5
#25 0x00007f667955c918 in QWidget::event(QEvent*) () at /usr/lib/libQt5Widgets.so.5
#26 0x00007f66796bb6a9 in QToolButton::event(QEvent*) () at /usr/lib/libQt5Widgets.so.5
#27 0x00007f66795186ec in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#28 0x00007f667952054d in QApplication::notify(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#29 0x00007f667916e648 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
#30 0x00007f667951f19f in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () at /usr/lib/libQt5Widgets.so.5
#31 0x00007f6679576316 in  () at /usr/lib/libQt5Widgets.so.5
#32 0x00007f6679578c4b in  () at /usr/lib/libQt5Widgets.so.5
#33 0x00007f66795186ec in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#34 0x00007f667951fb56 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#35 0x00007f667916e648 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
#36 0x00007f66755811e0 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () at /usr/lib/libQt5Gui.so.5
#37 0x00007f6675582f85 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () at /usr/lib/libQt5Gui.so.5
#38 0x00007f667556003b in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Gui.so.5
#39 0x00007f666893f6b0 in  () at /usr/lib/qt5/plugins/platforms/../../../libQt5XcbQpa.so.5
#40 0x00007f6671415837 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#41 0x00007f6671415a68 in  () at /usr/lib/libglib-2.0.so.0
#42 0x00007f6671415b0c in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#43 0x00007f66791bee9f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#44 0x00007f667916cbba in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#45 0x00007f6679174be4 in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
#46 0x0000000000400956 in  ()
#47 0x00007f6678b7a4f0 in __libc_start_main () at /lib/libc.so.6
#48 0x00000000004009ba in _start ()

Reported using DrKonqi
Comment 1 Jarosław Staniek 2017-05-02 19:50:24 UTC
Thanks for the report. 
I've marked the bug as possible duplicate of a class of bugs -- #377578 and #377579, and I'm waiting for some feedback.

A fix will go to 3.0.2 nevertheless. Because it's not released, maybe you can try 3.1 Alpha release to test: 

Universal Kexi "AppImage" for Linux - a new version from April 29 is
now linked at https://community.kde.org/Kexi/Snapshots. 

You've mentioned you use compiled sources of Kexi (by you), if this is true and you want to compile, you can - 3.0 branch of kexi.git for Kexi 3.0.2-pre. Or master branch for 3.1-pre.

*** This bug has been marked as a duplicate of bug 377578 ***
Comment 2 Jarosław Staniek 2017-10-05 16:54:54 UTC
Confirmed, for Kexi 3.0.2. 

1. In a query design set sorting for any column
2. Save the design.
3. Crash.
Comment 3 Jarosław Staniek 2017-10-05 20:17:22 UTC
Git commit 898d26a6247903e1d43718a5eb4d0955a34b798a by Jaroslaw Staniek.
Committed on 05/10/2017 at 19:13.
Pushed by staniek into branch 'master'.

SqlParserTest: also test generating statements in KDbSQL dialect, clearly mention if there's error in parsing or generating

This test would catch case from bug #379447 for example, i.e. crash on saving some query in Designer.

M  +31   -36   autotests/parser/SqlParserTest.cpp
M  +1    -2    autotests/parser/SqlParserTest.h

https://commits.kde.org/kdb/898d26a6247903e1d43718a5eb4d0955a34b798a
Comment 4 Jarosław Staniek 2017-10-05 20:17:23 UTC
Git commit 9fb605c7e00d56eaf9a22fb3c2d6807017150e1f by Jaroslaw Staniek.
Committed on 05/10/2017 at 19:37.
Pushed by staniek into branch 'master'.

Add COLLATION keywords when generated statements are native, otherwise KDbSQL string is invalid

M  +2    -2    src/KDbOrderByColumn.cpp

https://commits.kde.org/kdb/9fb605c7e00d56eaf9a22fb3c2d6807017150e1f