Bug 397959 - crash when searching for "Add\\." in TM
Summary: crash when searching for "Add\\." in TM
Status: RESOLVED FIXED
Alias: None
Product: lokalize
Classification: Applications
Component: general (other bugs)
Version First Reported In: 2.0
Platform: Fedora RPMs Linux
: NOR crash
Target Milestone: ---
Assignee: Simon Depiets
URL:
Keywords: drkonqi
: 400149 400354 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-08-27 22:47 UTC by Alexander Potashev
Modified: 2019-01-04 14:32 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
video (2.30 MB, video/mp4)
2018-08-29 12:04 UTC, Alexander Potashev
Details
manage TM dialog (24.82 KB, image/png)
2018-08-30 10:27 UTC, Alexander Potashev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Potashev 2018-08-27 22:47:16 UTC
Application: lokalize (2.0)

Qt Version: 5.10.1
Frameworks Version: 5.48.0
Operating System: Linux 4.17.14-202.fc28.x86_64 x86_64
Distribution: "Fedora release 28 (Twenty Eight)"

-- Information about the crash:
- What I was doing when the application crashed:

Lokalize crashed when I tried searching for "Add\\." in translation memory.

-- Backtrace:
Application: Lokalize (lokalize), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f163ff48280 (LWP 192013))]

Thread 16 (Thread 0x7f154656f700 (LWP 192054)):
#0  0x00007f164a8cc52c in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007f164c94d83b in QWaitCondition::wait(QMutex*, unsigned long) () at /lib64/libQt5Core.so.5
#2  0x00007f164c94a662 in QThreadPoolThread::run() () at /lib64/libQt5Core.so.5
#3  0x00007f164c94d11d in QThreadPrivate::start(void*) () at /lib64/libQt5Core.so.5
#4  0x00007f164a8c6594 in start_thread () at /lib64/libpthread.so.0
#5  0x00007f164bc8a0df in clone () at /lib64/libc.so.6

Thread 15 (Thread 0x7f15568e4700 (LWP 192052)):
#0  0x00007f164a8cc52c in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007f164c5b4290 in std::condition_variable::wait(std::unique_lock<std::mutex>&) () at /lib64/libstdc++.so.6
#2  0x00007f155b2d7eba in bmalloc::AsyncTask<bmalloc::Heap, void (bmalloc::Heap::*)()>::threadRunLoop() () at /lib64/libQt5WebKit.so.5
#3  0x00007f155b2d7fef in  () at /lib64/libQt5WebKit.so.5
#4  0x00007f164c5ba523 in execute_native_thread_routine () at /lib64/libstdc++.so.6
#5  0x00007f164a8c6594 in start_thread () at /lib64/libpthread.so.0
#6  0x00007f164bc8a0df in clone () at /lib64/libc.so.6

Thread 14 (Thread 0x7f15e7399700 (LWP 192051)):
#0  0x00007f164a8cc52c in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007f1650ddc9f8 in QTWTF::TCMalloc_PageHeap::scavengerThread() () at /lib64/libQt5Script.so.5
#2  0x00007f1650ddca63 in  () at /lib64/libQt5Script.so.5
#3  0x00007f164a8c6594 in start_thread () at /lib64/libpthread.so.0
#4  0x00007f164bc8a0df in clone () at /lib64/libc.so.6

Thread 13 (Thread 0x7f15eca0f700 (LWP 192048)):
#0  0x00007f164a8cc52c in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007f164c94d83b in QWaitCondition::wait(QMutex*, unsigned long) () at /lib64/libQt5Core.so.5
#2  0x00007f164c94a662 in QThreadPoolThread::run() () at /lib64/libQt5Core.so.5
#3  0x00007f164c94d11d in QThreadPrivate::start(void*) () at /lib64/libQt5Core.so.5
#4  0x00007f164a8c6594 in start_thread () at /lib64/libpthread.so.0
#5  0x00007f164bc8a0df in clone () at /lib64/libc.so.6

Thread 12 (Thread 0x7f15ed210700 (LWP 192046)):
#0  0x00007f164a8cc52c in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007f164c94d83b in QWaitCondition::wait(QMutex*, unsigned long) () at /lib64/libQt5Core.so.5
#2  0x00007f164dac6f6d in QFileInfoGatherer::run() () at /lib64/libQt5Widgets.so.5
#3  0x00007f164c94d11d in QThreadPrivate::start(void*) () at /lib64/libQt5Core.so.5
#4  0x00007f164a8c6594 in start_thread () at /lib64/libpthread.so.0
#5  0x00007f164bc8a0df in clone () at /lib64/libc.so.6

Thread 11 (Thread 0x7f161bdf5700 (LWP 192024)):
#0  0x00007f164bc7f659 in poll () at /lib64/libc.so.6
#1  0x00007f164569ebe6 in g_main_context_iterate.isra () at /lib64/libglib-2.0.so.0
#2  0x00007f164569ed10 in g_main_context_iteration () at /lib64/libglib-2.0.so.0
#3  0x00007f164cb4bc2b in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt5Core.so.5
#4  0x00007f164cafa12b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt5Core.so.5
#5  0x00007f164c9489c6 in QThread::exec() () at /lib64/libQt5Core.so.5
#6  0x00007f1652304299 in QDBusConnectionManager::run() () at /lib64/libQt5DBus.so.5
#7  0x00007f164c94d11d in QThreadPrivate::start(void*) () at /lib64/libQt5Core.so.5
#8  0x00007f164a8c6594 in start_thread () at /lib64/libpthread.so.0
#9  0x00007f164bc8a0df in clone () at /lib64/libc.so.6

Thread 10 (Thread 0x7f1621a29700 (LWP 192023)):
#0  0x00007f164a8cc52c in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007f1629ff15c3 in thread_function () at /usr/lib64/dri/swrast_dri.so
#2  0x00007f1629ff150b in impl_thrd_routine () at /usr/lib64/dri/swrast_dri.so
#3  0x00007f164a8c6594 in start_thread () at /lib64/libpthread.so.0
#4  0x00007f164bc8a0df in clone () at /lib64/libc.so.6

Thread 9 (Thread 0x7f162222a700 (LWP 192022)):
#0  0x00007f164a8cc52c in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007f1629ff15c3 in thread_function () at /usr/lib64/dri/swrast_dri.so
#2  0x00007f1629ff150b in impl_thrd_routine () at /usr/lib64/dri/swrast_dri.so
#3  0x00007f164a8c6594 in start_thread () at /lib64/libpthread.so.0
#4  0x00007f164bc8a0df in clone () at /lib64/libc.so.6

Thread 8 (Thread 0x7f1622a2b700 (LWP 192021)):
#0  0x00007f164a8cc52c in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007f1629ff15c3 in thread_function () at /usr/lib64/dri/swrast_dri.so
#2  0x00007f1629ff150b in impl_thrd_routine () at /usr/lib64/dri/swrast_dri.so
#3  0x00007f164a8c6594 in start_thread () at /lib64/libpthread.so.0
#4  0x00007f164bc8a0df in clone () at /lib64/libc.so.6

Thread 7 (Thread 0x7f162322c700 (LWP 192020)):
#0  0x00007f164a8cc52c in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007f1629ff15c3 in thread_function () at /usr/lib64/dri/swrast_dri.so
#2  0x00007f1629ff150b in impl_thrd_routine () at /usr/lib64/dri/swrast_dri.so
#3  0x00007f164a8c6594 in start_thread () at /lib64/libpthread.so.0
#4  0x00007f164bc8a0df in clone () at /lib64/libc.so.6

Thread 6 (Thread 0x7f1623a2d700 (LWP 192019)):
#0  0x00007f164a8cc52c in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007f1629ff15c3 in thread_function () at /usr/lib64/dri/swrast_dri.so
#2  0x00007f1629ff150b in impl_thrd_routine () at /usr/lib64/dri/swrast_dri.so
#3  0x00007f164a8c6594 in start_thread () at /lib64/libpthread.so.0
#4  0x00007f164bc8a0df in clone () at /lib64/libc.so.6

Thread 5 (Thread 0x7f162422e700 (LWP 192018)):
#0  0x00007f164a8cc52c in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007f1629ff15c3 in thread_function () at /usr/lib64/dri/swrast_dri.so
#2  0x00007f1629ff150b in impl_thrd_routine () at /usr/lib64/dri/swrast_dri.so
#3  0x00007f164a8c6594 in start_thread () at /lib64/libpthread.so.0
#4  0x00007f164bc8a0df in clone () at /lib64/libc.so.6

Thread 4 (Thread 0x7f1624a2f700 (LWP 192017)):
#0  0x00007f164a8cc52c in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007f1629ff15c3 in thread_function () at /usr/lib64/dri/swrast_dri.so
#2  0x00007f1629ff150b in impl_thrd_routine () at /usr/lib64/dri/swrast_dri.so
#3  0x00007f164a8c6594 in start_thread () at /lib64/libpthread.so.0
#4  0x00007f164bc8a0df in clone () at /lib64/libc.so.6

Thread 3 (Thread 0x7f1625230700 (LWP 192016)):
#0  0x00007f164a8cc52c in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007f1629ff15c3 in thread_function () at /usr/lib64/dri/swrast_dri.so
#2  0x00007f1629ff150b in impl_thrd_routine () at /usr/lib64/dri/swrast_dri.so
#3  0x00007f164a8c6594 in start_thread () at /lib64/libpthread.so.0
#4  0x00007f164bc8a0df in clone () at /lib64/libc.so.6

Thread 2 (Thread 0x7f1631495700 (LWP 192015)):
#0  0x00007f164bc7f659 in poll () at /lib64/libc.so.6
#1  0x00007f1644d8f04f in _xcb_conn_wait () at /lib64/libxcb.so.1
#2  0x00007f1644d90caa in xcb_wait_for_event () at /lib64/libxcb.so.1
#3  0x00007f163360c4d9 in QXcbEventReader::run() () at /lib64/libQt5XcbQpa.so.5
#4  0x00007f164c94d11d in QThreadPrivate::start(void*) () at /lib64/libQt5Core.so.5
#5  0x00007f164a8c6594 in start_thread () at /lib64/libpthread.so.0
#6  0x00007f164bc8a0df in clone () at /lib64/libc.so.6

Thread 1 (Thread 0x7f163ff48280 (LWP 192013)):
[KCrash Handler]
#6  0x00007f15e7d1a673 in pcache1RemoveFromHash () at /lib64/libsqlite3.so.0
#7  0x00007f15e7d1a9a3 in pcache1FetchStage2 () at /lib64/libsqlite3.so.0
#8  0x00007f15e7d61ebd in getPageNormal () at /lib64/libsqlite3.so.0
#9  0x00007f15e7d41702 in getAndInitPage () at /lib64/libsqlite3.so.0
#10 0x00007f15e7d41911 in moveToLeftmost () at /lib64/libsqlite3.so.0
#11 0x00007f15e7d8b10f in sqlite3VdbeExec () at /lib64/libsqlite3.so.0
#12 0x00007f15e7d91940 in sqlite3_step () at /lib64/libsqlite3.so.0
#13 0x00007f15ec204c96 in QSQLiteResultPrivate::fetchNext(QVector<QVariant>&, int, bool) () at /usr/lib64/qt5/plugins/sqldrivers/libqsqlite.so
#14 0x00007f16523f42d0 in QSqlCachedResult::cacheNext() () at /lib64/libQt5Sql.so.5
#15 0x00007f16523f4480 in QSqlCachedResult::fetch(int) () at /lib64/libQt5Sql.so.5
#16 0x00007f16523def7d in QSqlQuery::seek(int, bool) () at /lib64/libQt5Sql.so.5
#17 0x00007f16523f53c8 in QSqlQueryModelPrivate::prefetch(int) () at /lib64/libQt5Sql.so.5
#18 0x00007f16523f5d8b in QSqlQueryModel::setQuery(QSqlQuery const&) () at /lib64/libQt5Sql.so.5
#19 0x0000560bc879cdf1 in TM::TMDBModel::slotQueryExecuted(TM::ExecQueryJob*) ()
#20 0x0000560bc87ec19c in TM::TMDBModel::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) [clone .part.14] ()
#21 0x00007f164cb24a26 in QObject::event(QEvent*) () at /lib64/libQt5Core.so.5
#22 0x00007f164d8ace95 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib64/libQt5Widgets.so.5
#23 0x00007f164d8b483a in QApplication::notify(QObject*, QEvent*) () at /lib64/libQt5Widgets.so.5
#24 0x00007f164cafb376 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib64/libQt5Core.so.5
#25 0x00007f164cafe09b in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /lib64/libQt5Core.so.5
#26 0x00007f164cb4bec7 in postEventSourceDispatch(_GSource*, int (*)(void*), void*) () at /lib64/libQt5Core.so.5
#27 0x00007f164569e8ad in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
#28 0x00007f164569ec78 in g_main_context_iterate.isra () at /lib64/libglib-2.0.so.0
#29 0x00007f164569ed10 in g_main_context_iteration () at /lib64/libglib-2.0.so.0
#30 0x00007f164cb4bc13 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt5Core.so.5
#31 0x00007f163369a065 in QPAEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt5XcbQpa.so.5
#32 0x00007f164cafa12b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt5Core.so.5
#33 0x00007f164cb025b6 in QCoreApplication::exec() () at /lib64/libQt5Core.so.5
#34 0x0000560bc86dcd93 in main ()

Reported using DrKonqi
Comment 1 Simon Depiets 2018-08-29 02:15:18 UTC
Hello Alexander,
Can you reproduce this bug ?
Comment 2 Alexander Potashev 2018-08-29 09:16:50 UTC
Retried it two times now, it was reproducible.
Comment 3 Alexander Potashev 2018-08-29 09:31:49 UTC
Lokalize package version: 18.04.3-1.fc28
Comment 4 Simon Depiets 2018-08-29 09:33:54 UTC
Can you send your translation memory ?
It should be in .local/share/lokalize/*.db

A screenshot of the research just before clicking the search button would also help ensure we use the same parameters
Comment 5 Alexander Potashev 2018-08-29 12:04:29 UTC
Project opened in Lokalize: svn+ssh://svn@svn.kde.org/home/kde/trunk/l10n-kf5/ru/index.lokalize


Data from .local/share/lokalize: https://mega.nz/#F!GOxlHYZL!h7O3n13F9nlSvvhcksxesQ
default.db and kde-ru.local were modified months ago, so I don't think these are used by Lokalize.
Comment 6 Alexander Potashev 2018-08-29 12:04:59 UTC
Created attachment 114676 [details]
video
Comment 7 Simon Depiets 2018-08-30 01:14:37 UTC
It's strange that you don't have any translation memory selected when you switch to the Translation Memory tab. What do you have in the "Manage Translation Memories" dialog ?
https://imgur.com/a/RDTl7To
Comment 8 Alexander Potashev 2018-08-30 10:27:55 UTC
Created attachment 114699 [details]
manage TM dialog
Comment 9 Alexander Potashev 2018-08-30 10:28:41 UTC
I can select "kde-ru" in TM, it still crashes when searching for the same.
Comment 10 Simon Depiets 2018-08-31 01:50:43 UTC
I've installed a fresh Fedora in russian on a virtual machine and can't reproduce.
Two last things to try, can you send over your .config/lokalizerc and the result of ls -l /lib64/libsqlite3.so.0 /lib64/libpthread.so.0
Comment 11 Simon Depiets 2018-08-31 01:53:20 UTC
Disregard actually I was able to reproduce with any chain
Comment 12 Simon Depiets 2018-08-31 07:37:46 UTC
I can only reproduce by spamming the Search button very quickly. Could you launch lokalize from the console and send over the log messages ?
Comment 13 Simon Depiets 2018-09-14 03:24:43 UTC
I think I was able to fix my issue which was slightly different (only triggered randomly or when spamming) but probably related. I suspect the problem is the multithreading access to the database provider between the thread that launches the queries and the thread that reads the result. I added some mutexes and cleanup of previous queries and I'm not able to make it crash anymore. It seems the rework done on QSqlQueryModel in Qt 5.10 and Qt 5.11 might be the cause.

https://github.com/KDE/lokalize/commit/2b183be33e93ffd30d4d9238704051c971ede0b4
Comment 14 Alexander Potashev 2018-09-14 10:04:27 UTC
Cannot reproduce anymore with the current git master. Thanks!
Comment 15 Simon Depiets 2018-10-22 15:19:17 UTC
*** Bug 400149 has been marked as a duplicate of this bug. ***
Comment 16 Freek de Kruijf 2018-10-23 09:29:17 UTC
Lokalize 2.0
KDE Frameworks 5.50.0
Qt 5.11.2
Distribution: openSUSE Tumbleweed 20181018
packet version: 18.08.2-1.1

Yesterday a new version of lokalize became available and was installed.

Same search as in 400149

> LC_ALL=C lokalize --project=vertalingen/KF5trunk.lokalize
QStatusBar::insertWidget: Index out of range (5), appending widget
Trying to convert empty KLocalizedString to QString.
org.kde.kross.core: Action::setInterpreter: interpreter not found:  "python"
Segmentatiefout (geheugendump gemaakt)

I started as above. On another console I started gdb and attached to that lokalize, entered continue. I did the same search, which succeeded. I was able to repair some words, which was the objective for the search, and finally finished my work.

I got a lot of messages from gdb trying to load debuginfo files, even tried to install these, which fails because I logged in as a non-root user.

Starting lokalize again as above, not using gdb and doing again the same search results in the same error message above. So currently the problem is always reproducible.
Comment 17 Alexander Potashev 2018-10-23 09:34:16 UTC
v18.08.2 does not include the bugfix.

Simon, could you please backport the bugfix into branch "Applications/18.08" to make it available in 18.08.3?
Comment 18 Simon Depiets 2018-10-23 10:02:37 UTC
I think there's just too many changes on the master currently that are not bugfixes to do that
Comment 19 Alexander Potashev 2018-10-23 10:11:21 UTC
(In reply to Simon Depiets from comment #18)
> I think there's just too many changes on the master currently that are not
> bugfixes to do that

This is not a problem, you can still use git-cherry-pick https://git-scm.com/docs/git-cherry-pick
Comment 20 Simon Depiets 2018-10-27 01:55:02 UTC
*** Bug 400354 has been marked as a duplicate of this bug. ***
Comment 21 Simon Depiets 2018-11-30 03:36:41 UTC
I made too many modifications of the code base before that fix so I gave up on the cherry picking (especially this close to 18.12).
Comment 22 Freek de Kruijf 2018-11-30 10:34:40 UTC
Just tried to reproduce after the newest update of openSUSE Tumbleweed.
Lokalize version 2.0
KDE Frameworks 5.52.0
Qt 5.11.2 (gebouwd tegen 5.11.2)
Still reproducable.
Comment 23 Alexander Potashev 2018-11-30 11:05:54 UTC
(In reply to Freek de Kruijf from comment #22)
> Just tried to reproduce after the newest update of openSUSE Tumbleweed.
> Lokalize version 2.0
> KDE Frameworks 5.52.0
> Qt 5.11.2 (gebouwd tegen 5.11.2)
> Still reproducable.

please retest with lokalize-18.12.0 (not released yet)
Comment 24 Simon Depiets 2019-01-04 08:16:47 UTC
Can you check with 18.12 ? I'm pretty sure it's fixed there
Comment 25 Freek de Kruijf 2019-01-04 13:07:12 UTC
It's OK now. Thanks.