segfault when "Find previous" tries to wrap.

Bug #1223588 reported by bdjnk
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
qpdfview
Fix Released
Critical
Adam Reichold

Bug Description

As the title says, attempting to "Find previous" when there are no results to be found earlier in the document causes qpdfview to immediately crash with the output:

Segmentation fault (core dumped)

I tested on several PDF files (no PS nor DjVu) with various settings and experienced this issue every time.

Here's some additional information:

$ pacman -Qi qpdfview
Name : qpdfview
Version : 0.4.5-2

$ uname -a
Linux nc10y 3.10.10-1-ARCH #1 SMP PREEMPT Fri Aug 30 12:11:59 CEST 2013 i686 GNU/Linux

$ systemd-coredumpctl
No coredumps found

bdjnk (bdjnks)
description: updated
Changed in qpdfview:
importance: Undecided → Critical
status: New → Incomplete
assignee: nobody → Adam Reichold (adamreichold)
milestone: none → 0.4.6
Revision history for this message
Adam Reichold (adamreichold) wrote :

Hello bdjnk,

thanks for taking the time to report this! Sadly, I could not reproduce your bug running openSUSE 12.3 and using Qt4. From the helpful information that you use the Arch Linux current stable package, I infer that you use Qt5.

Do you feel confident to try to build the program from source using Qt4 to isolate the problem? Or could you try to give me a step by step procedure by which to reproduce this? (E.g. did you use the edit menu entries or the search dock buttons? (I shouldn't matter, but one nether knows.)) (I guess attaching a document doesn't help if you say it happens independently of the document. :-\)

Best regards, Adam.

P.S.: Maybe Benjamin finds a minute to try to reproduce this using Ubuntu? Thanks!

Revision history for this message
bdjnk (bdjnks) wrote :

Hey Adam,

You guessed correctly; I am indeed using qt5.

Though I didn't test it previously, the problem occurs using the edit menu entries as well.

Anyway, I grabbed the source and ran:

$ qmake-qt4 CONFIG+="without_djvu without_ps" qpdfview.pro
$ make
# make install

which worked great and eliminated the bug in all my tests. Presumably the issue is related to qt5.

Revision history for this message
bdjnk (bdjnks) wrote :

Oh, also, I found the core dumps. I thought I had set the regular user up to handle these things, but I guess not.

The trouble is the size. I don't know if it's okay to dump 120 M as an attachment to launchpad, or even if it would help you to have it.

If it is (potentially) useful, just let me know how you want it sent.

Revision history for this message
Adam Reichold (adamreichold) wrote :

Indeed, I could immediately reproduce the problem using Qt5. Hence I can debug this properly and there is no need to upload the core dumps. It seems something about the behavior of iterators into a QMultiMap changed which I'll have to investigate...

Changed in qpdfview:
status: Incomplete → Triaged
Revision history for this message
Adam Reichold (adamreichold) wrote :

Well, that was an interesting one: I was depending on the undefined behavior that decrementing the begin() iterator gave the end() or invalid iterator, but it really is just undefined and hence I have to set it to end() resp. invalid myself in that case.

Hopefully this now fixes the problem in trunk revision 1267. Maybe you could try to build the latest source from trunk, e.g. using the "qpdfview-bzr" package from AUR, and verify that the problem is indeed solved? Thanks!

Regards, Adam.

Changed in qpdfview:
status: Triaged → Fix Committed
Revision history for this message
bdjnk (bdjnks) wrote :

I've installed qpdfview-bzr and wrapping now works properly in all my tests. It seems completely taken care of. Well done :)

Changed in qpdfview:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.