Bug 309030 - Searching through a djvu file
Summary: Searching through a djvu file
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 0.15.2
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-26 08:57 UTC by Fixit Baby
Modified: 2012-11-02 21:25 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.9.4


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fixit Baby 2012-10-26 08:57:36 UTC
Application: okular (0.15.2)
KDE Platform Version: 4.9.2
Qt Version: 4.8.3
Operating System: Linux 3.5.0-17-generic x86_64
Distribution: Ubuntu 12.10

-- Information about the crash:
- What I was doing when the application crashed:
I was searching for a word in a djvu document. Everything work fine as I pressed "F3" to look at the proceeding occurences of the word. There was a point in time when I needed to return to a previous occurence of the word. So I pressed the "Previous" button. This is the instant when okular crashed.

-- Backtrace:
Application: Okular (okular), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f3b71cec780 (LWP 4475))]

Thread 2 (Thread 0x7f3b5e4d5700 (LWP 4479)):
#0  0x00007f3b6ef3c303 in poll () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007f3b6bb3bd84 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f3b6bb3c1e2 in g_main_loop_run () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f3b64c4a3b6 in ?? () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#4  0x00007f3b6bb5f645 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007f3b6c00ae9a in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#6  0x00007f3b6ef47cbd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#7  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f3b71cec780 (LWP 4475)):
[KCrash Handler]
#5  0x00007f3b5453acbf in text (this=0xffa1a1a1ff9b9b9b) at ../core/textpage.cpp:174
#6  stringLengthAdaptedWithHyphen (str=..., it=..., end=..., page=<optimized out>) at ../core/textpage.cpp:806
#7  0x00007f3b5453b9e0 in Okular::TextPagePrivate::findTextInternalBackward (this=0x7f3b38fab0e0, searchID=1, _query=..., caseSensitivity=<optimized out>, comparer=0x7f3b5453aac0 <CaseInsensitiveCmpFn(QStringRef const&, QStringRef const&, int*, int*)>, start=..., end=...) at ../core/textpage.cpp:995
#8  0x00007f3b5453c5d5 in Okular::TextPage::findText (this=<optimized out>, searchID=<optimized out>, query=..., direct=<optimized out>, caseSensitivity=Qt::CaseInsensitive, area=<optimized out>) at ../core/textpage.cpp:783
#9  0x00007f3b5452600e in Okular::DocumentPrivate::doContinuePrevMatchSearch (this=0x1608da0, pagesToNotifySet=0x31ab4c0, theMatch=<optimized out>, currentPage=80, searchID=1, text=..., theCaseSensitivity=0, moveViewport=true, color=..., noDialogs=false, donePages=3) at ../core/document.cpp:1325
#10 0x00007f3b54526bd8 in qt_static_metacall (_a=<optimized out>, _id=<optimized out>, _o=<optimized out>, _c=<optimized out>) at ./document.moc:143
#11 Okular::Document::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at ./document.moc:108
#12 0x00007f3b6f91e43e in QObject::event (this=0x15da960, e=<optimized out>) at kernel/qobject.cpp:1195
#13 0x00007f3b702ebe9c in QApplicationPrivate::notify_helper (this=this@entry=0x132e5e0, receiver=receiver@entry=0x15da960, e=e@entry=0x31a1880) at kernel/qapplication.cpp:4562
#14 0x00007f3b702f030a in QApplication::notify (this=0x7fff9f465970, receiver=0x15da960, e=0x31a1880) at kernel/qapplication.cpp:4423
#15 0x00007f3b70ff41d6 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#16 0x00007f3b6f90956e in QCoreApplication::notifyInternal (this=0x7fff9f465970, receiver=receiver@entry=0x15da960, event=event@entry=0x31a1880) at kernel/qcoreapplication.cpp:915
#17 0x00007f3b6f90d3f1 in sendEvent (event=0x31a1880, receiver=0x15da960) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#18 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x1302670) at kernel/qcoreapplication.cpp:1539
#19 0x00007f3b6f937a63 in sendPostedEvents () at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:236
#20 postEventSourceDispatch (s=0x132ee20) at kernel/qeventdispatcher_glib.cpp:279
#21 0x00007f3b6bb3bab5 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#22 0x00007f3b6bb3bde8 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#23 0x00007f3b6bb3bea4 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#24 0x00007f3b6f937bf6 in QEventDispatcherGlib::processEvents (this=0x1303b30, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#25 0x00007f3b70390c1e in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#26 0x00007f3b6f9082bf in QEventLoop::processEvents (this=this@entry=0x7fff9f465720, flags=...) at kernel/qeventloop.cpp:149
#27 0x00007f3b6f908548 in QEventLoop::exec (this=0x7fff9f465720, flags=...) at kernel/qeventloop.cpp:204
#28 0x00007f3b6f90d708 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1187
#29 0x00000000004079ce in main (argc=<optimized out>, argv=<optimized out>) at ../../shell/main.cpp:85

Reported using DrKonqi
Comment 1 Albert Astals Cid 2012-10-26 09:12:14 UTC
Can you reproduce the crash? (i.e. do the same again and get the crash?) If you can, can you please attach the file and describe exactly what steps you do?
Comment 2 Fixit Baby 2012-10-27 08:10:02 UTC
Please look at the video I uploaded to youtube. You will get a better idea of what's happening:
http://youtu.be/w9pPsGxU7ns

The djvu file can be found here:
http://archive.org/details/spiritoflaws01montuoft
Comment 3 Albert Astals Cid 2012-11-02 21:25:58 UTC
Git commit d59ffb4a7a34ff476997296b6e3b8df60517d899 by Albert Astals Cid.
Committed on 02/11/2012 at 22:24.
Pushed by aacid into branch 'KDE/4.9'.

Fix crash when searching backwards

When searching backwards end is not actually words.end but words.begin (since the loop goes backwards) hence we can't pass end to stringLengthAdaptedWithHyphen
I've now renamed end to loop_end to make it a bit more clear.
FIXED-IN: 4.9.4

M  +3    -3    core/textpage.cpp

http://commits.kde.org/okular/d59ffb4a7a34ff476997296b6e3b8df60517d899