Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 250719 - app-text/evince-2.22.2-r1: will crash when displaying djvu if app-text/djvu is built without threads
Summary: app-text/evince-2.22.2-r1: will crash when displaying djvu if app-text/djvu i...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GNOME (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL: https://sourceforge.net/tracker/?func...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-12 17:37 UTC by David Radice
Modified: 2009-03-17 08:13 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Radice 2008-12-12 17:37:41 UTC
Evince was crashing most of the time when displaying a djvu document until I rebuilt djvu with USE=threads. Now it works perfectly, but it took me a lot of time to fix this... would you mind to add a warning or something in the evince ebuild?

Reproducible: Sometimes

Steps to Reproduce:
1. Open a djvu document
2. Scroll up and down for some time
3.

Actual Results:  
Evince crashes most of the time (depending also on the open document).

Expected Results:  
Evince should not crash.

Sorry but I can't legally attach any of the offending djvu to this bug.
Comment 1 Daniel Gryniewicz (RETIRED) gentoo-dev 2008-12-15 20:12:09 UTC
I'm unable to see this with any djvu I have.  (I have -threads).  I don't suppose there's any chance you could find one that you could legally attach?
Comment 2 David Radice 2008-12-15 20:39:24 UTC
I found another djvu which has this issue at:

http://www.archive.org/details/treatiseonphysic00bassrich

direct link:

http://ia331338.us.archive.org/1/items/treatiseonphysic00bassrich/treatiseonphysic00bassrich.djvu

it's an old book whose copyright is expired. I can't attach it because it's too large for bugzilla. Most of the times evince segfaults while rendering the first page here with -threads, but works perfectly with +threads.

I was able to reproduce this bug on three different computer running Gentoo: one x86, and two amd64.
Comment 3 Daniel Gryniewicz (RETIRED) gentoo-dev 2008-12-15 23:58:52 UTC
I hate to say this, but that one works fine for me too.  Could you include output of:
emerge -pv evince poppler poppler-bindings djvu

Also, does re-emerging djvu with -threads cause it to break again?  I'm wondering if just rebuilding djvu was enough to fix it, or if the threads actually matters.
Comment 4 David Radice 2008-12-20 16:19:53 UTC
I am able to trigger this bug off and on simply by rebuilding djvu with or without  threads (rebuilding other packages does not seem to be necessary).

Here is the required output:

davide@kerr ~ $ emerge -pv evince poppler poppler-bindings djvu

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] app-text/poppler-0.8.7  USE="jpeg zlib -cjk" 0 kB 
[ebuild   R   ] app-text/djvu-3.5.21  USE="jpeg threads tiff xml -debug -doc -kde -nls -nsplugin -qt3" LINGUAS="en -cs -de -fr -ja -zh" 0 kB 
[ebuild   R   ] app-text/poppler-bindings-0.8.7  USE="cairo gtk -qt3 -qt4 -test" 0 kB 
[ebuild   R   ] app-text/evince-2.22.2-r1  USE="dbus djvu dvi gnome tiff -debug -doc -gnome-keyring -t1lib" 0 kB 

Total: 4 packages (4 reinstalls), Size of downloads: 0 kB
 
Comment 5 Peter Volkov (RETIRED) gentoo-dev 2009-02-24 13:10:48 UTC
David please try with djvu-3.5.21_p20090103. It has some crashers fixed. If that does not helps, could you get backtrace for us:

http://www.gentoo.org/proj/en/qa/backtraces.xml
Comment 6 David Radice 2009-02-24 20:23:29 UTC
It is still not working without "threads". I have tried to get a backtrace of it using djvu-3.5.21 using two different djvus. Here is the first one:

Starting program: /usr/bin/evince 
[Thread debugging using libthread_db enabled]
[New Thread 0x7f4414809700 (LWP 11193)]
[New Thread 0x4232c950 (LWP 11196)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x4232c950 (LWP 11196)]
0x00007f440925665b in DJVU::DjVuDocument::process_threqs ()
   from /usr/lib/libdjvulibre.so.21
#0  0x00007f440925665b in DJVU::DjVuDocument::process_threqs ()
   from /usr/lib/libdjvulibre.so.21
#1  0x00007f4409257908 in DJVU::DjVuDocument::get_thumbnail ()
   from /usr/lib/libdjvulibre.so.21
#2  0x00007f44092acf3a in ddjvu_thumbnail_status ()
   from /usr/lib/libdjvulibre.so.21
#3  0x00007f4409514b90 in djvu_document_thumbnails_get_thumbnail (
    document=0x26ecd80, rc=0x243d400, border=1) at djvu-document.c:426
#4  0x00007f4414422e06 in ev_document_thumbnails_get_thumbnail (
    document=0x26ecd80, rc=0x243d400, border=1) at ev-document-thumbnails.c:58
#5  0x00000000004210f1 in ev_job_thumbnail_run (job=0x243d440) at ev-jobs.c:435
#6  0x000000000041e2df in handle_job (job=0x243d440) at ev-job-queue.c:129
#7  0x000000000041e880 in ev_render_thread (data=0x0) at ev-job-queue.c:264
#8  0x00007f440c3acc7e in ?? () from /usr/lib/libglib-2.0.so.0
#9  0x00007f4410048087 in start_thread () from /lib/libpthread.so.0
#10 0x00007f440c0d2ccd in clone () from /lib/libc.so.6
#11 0x0000000000000000 in ?? ()

And here is the second one:

Starting program: /usr/bin/evince 
[Thread debugging using libthread_db enabled]
[New Thread 0x7fb2e1961700 (LWP 11281)]
[New Thread 0x41b9d950 (LWP 11284)]
[New Thread 0x4239e950 (LWP 11298)]
[New Thread 0x42b9f950 (LWP 11299)]
[New Thread 0x41248950 (LWP 11300)]
[Thread 0x41248950 (LWP 11300) exited]
[Thread 0x4239e950 (LWP 11298) exited]
[New Thread 0x4239e950 (LWP 11301)]
[Thread 0x42b9f950 (LWP 11299) exited]
[New Thread 0x42b9f950 (LWP 11302)]
[Thread 0x42b9f950 (LWP 11302) exited]
[Thread 0x4239e950 (LWP 11301) exited]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x41b9d950 (LWP 11284)]
0x00007fb2d5de0880 in DJVU::GSafeFlags::operator long ()
   from /usr/lib/libdjvulibre.so.21
trace command requires an argument
Breakpoint 1 at 0x7fb2d5de0880
#0  0x00007fb2d5de0880 in DJVU::GSafeFlags::operator long ()
   from /usr/lib/libdjvulibre.so.21
#1  0x00007fb2d5e6d674 in DJVU::DjVuDocument::process_threqs ()
   from /usr/lib/libdjvulibre.so.21
#2  0x00007fb2d5e6e908 in DJVU::DjVuDocument::get_thumbnail ()
   from /usr/lib/libdjvulibre.so.21
#3  0x00007fb2d5ec3f3a in ddjvu_thumbnail_status ()
   from /usr/lib/libdjvulibre.so.21
#4  0x00007fb2d612bb90 in djvu_document_thumbnails_get_thumbnail (
    document=0x1824b00, rc=0x147ea00, border=1) at djvu-document.c:426
#5  0x00007fb2e157ae06 in ev_document_thumbnails_get_thumbnail (
    document=0x1824b00, rc=0x147ea00, border=1) at ev-document-thumbnails.c:58
#6  0x00000000004210f1 in ev_job_thumbnail_run (job=0x1451800) at ev-jobs.c:435
#7  0x000000000041e2df in handle_job (job=0x1451800) at ev-job-queue.c:129
#8  0x000000000041e880 in ev_render_thread (data=0x0) at ev-job-queue.c:264
#9  0x00007fb2d9504c7e in ?? () from /usr/lib/libglib-2.0.so.0
#10 0x00007fb2dd1a0087 in start_thread () from /lib/libpthread.so.0
#11 0x00007fb2d922accd in clone () from /lib/libc.so.6
#12 0x0000000000000000 in ?? ()

As you can see there are still things missing from the backtrace, but I had not enough time to rebuild everything with the debugging FLAGS... if something more is needed I can post other backtraces in the next days.
Comment 7 Peter Volkov (RETIRED) gentoo-dev 2009-02-25 11:58:40 UTC
You don't need to rebuild everything. Just bits you see missing in backtrace. Currently you need to rebuild djvu with debugging symbols and probably glib and glibc. Personally to build packages with debuggins symbols I added wrapper around emerge in ~/.bashrc:

demerge() {
  env USE="debug" CFLAGS="-O2 -pipe -g -ggdb" PKGDIR="/vt/binpkg-debug" FEATURES="buildpkg splitdebug collision-protect ccache noclean installsources" emerge "$@"
}

then just do demerge -1 <packages I need>.
Comment 8 Gilles Dartiguelongue (RETIRED) gentoo-dev 2009-02-25 12:37:31 UTC
using USE="debug" would be a bug (see libxslt bug for example) or useless (simply doesn't do anything) in most gnome packages though.
Comment 9 David Radice 2009-02-25 12:44:45 UTC
Thanks for the tips: actually I know I had to rebuild glib/glibc and was hoping to avoid it :)

Here is the backtrace I got with "+debug -threads" using "installsources" and "splitdebug" with djvu-3.5.21. I got two different bt with two different djvu (the same two files of the old backtrace in the same order): here is the first:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x40a53950 (LWP 1822)]
0x00007f2ce9c98a40 in GP<DjVuFile>::operator DjVuFile* (this=0x28)
    at GSmartPointer.h:435
435	GSmartPointer.h: No such file or directory.
	in GSmartPointer.h
Current language:  auto; currently c++
#0  0x00007f2ce9c98a40 in GP<DjVuFile>::operator DjVuFile* (this=0x28)
    at GSmartPointer.h:435
#1  0x00007f2ce9cd626d in DjVuDocument::process_threqs (this=0x1e458d0)
    at DjVuDocument.cpp:1109
#2  0x00007f2ce9cd7fcd in DjVuDocument::get_thumbnail (this=0x1e458d0, 
    page_num=516, dont_decode=false) at DjVuDocument.cpp:1369
#3  0x00007f2ce9d2a881 in ddjvu_thumbnail_status (document=0x1e4b8d0, 
    pagenum=516, start=1) at ddjvuapi.cpp:2479
#4  0x00007f2ce9f9eb80 in djvu_document_thumbnails_get_thumbnail (
    document=0x1e14580, rc=0x1a6ab80, border=1) at djvu-document.c:426
#5  0x00007f2cf4f06e06 in ev_document_thumbnails_get_thumbnail (
    document=0x1e14580, rc=0x1a6ab80, border=1) at ev-document-thumbnails.c:58
#6  0x00000000004210f1 in ev_job_thumbnail_run (job=0x1a6aac0) at ev-jobs.c:435
#7  0x000000000041e2df in handle_job (job=0x1a6aac0) at ev-job-queue.c:129
#8  0x000000000041e880 in ev_render_thread (data=0x0) at ev-job-queue.c:264
#9  0x00007f2cece51d91 in g_thread_create_proxy (data=0x19cc590)
    at gthread.c:635
#10 0x00007f2cf0b0d087 in start_thread (arg=<value optimized out>)
    at pthread_create.c:297
#11 0x00007f2cecb5cccd in clone () from /lib/libc.so.6
#12 0x0000000000000000 in ?? ()

here is the second:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x41a54950 (LWP 1852)]
0x00007f76cecceb6d in GSafeFlags::operator long (this=0x319)
    at GThreads.cpp:1837
1837	GThreads.cpp: No such file or directory.
	in GThreads.cpp
Current language:  auto; currently c++
(gdb) bt
#0  0x00007f76cecceb6d in GSafeFlags::operator long (this=0x319)
    at GThreads.cpp:1837
#1  0x00007f76ced4fe5e in DjVuFile::is_data_present (this=0x201)
    at DjVuFile.h:736
#2  0x00007f76ced5d298 in DjVuDocument::process_threqs (this=0x1464c60)
    at DjVuDocument.cpp:1113
#3  0x00007f76ced5efcd in DjVuDocument::get_thumbnail (this=0x1464c60, 
    page_num=82, dont_decode=false) at DjVuDocument.cpp:1369
#4  0x00007f76cedb1881 in ddjvu_thumbnail_status (document=0x1461ee0, 
    pagenum=82, start=1) at ddjvuapi.cpp:2479
#5  0x00007f76cf025b80 in djvu_document_thumbnails_get_thumbnail (
    document=0x142f580, rc=0x1129a40, border=1) at djvu-document.c:426
#6  0x00007f76d9f8de06 in ev_document_thumbnails_get_thumbnail (
    document=0x142f580, rc=0x1129a40, border=1) at ev-document-thumbnails.c:58
#7  0x00000000004210f1 in ev_job_thumbnail_run (job=0x11076c0) at ev-jobs.c:435
#8  0x000000000041e2df in handle_job (job=0x11076c0) at ev-job-queue.c:129
#9  0x000000000041e880 in ev_render_thread (data=0x0) at ev-job-queue.c:264
#10 0x00007f76d1ed8d91 in g_thread_create_proxy (data=0xfe7590)
    at gthread.c:635
#11 0x00007f76d5b94087 in start_thread (arg=<value optimized out>)
    at pthread_create.c:297
#12 0x00007f76d1be3ccd in clone () from /lib/libc.so.6
#13 0x0000000000000000 in ?? ()

Hope this helps.
Comment 10 David Radice 2009-02-25 12:47:28 UTC
Sorry fore the double post, but I should also say that I have built this with:

CFLAGS="-pipe -g -ggdb"
CXXFLAGS="-pipe -g -ggdb"

without any optimization so that I think that the pointed lines in the code are actually the ones in which it segfaults.
Comment 11 Peter Volkov (RETIRED) gentoo-dev 2009-03-16 15:10:33 UTC
David. But as I already asked you, could you reproduce this bug and gather backtrace with djvu-3.5.21_p20090103? Some crashes are already fixed there so, before reporting upstream or further investigation of this issue I want to be sure that this problem is reproducible with the most recent codebase available in the tree. Thanks for getting backtrace though.
Comment 12 David Radice 2009-03-16 16:54:36 UTC
Here it is djvu-3.5.21_p20090103 & evince, USE and FLAGS are the same as the ones used for the other backtraces:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x4180f950 (LWP 30472)]
0x00007f7840e29b1d in GSafeFlags::operator long (this=0x179)
    at GThreads.cpp:1837
1837	GThreads.cpp: No such file or directory.
	in GThreads.cpp
Current language:  auto; currently c++
#0  0x00007f7840e29b1d in GSafeFlags::operator long (this=0x179)
    at GThreads.cpp:1837
#1  0x00007f7840eaae0e in DjVuFile::is_data_present (this=0x61)
    at DjVuFile.h:736
#2  0x00007f7840eb8248 in DjVuDocument::process_threqs (this=0x192de10)
    at DjVuDocument.cpp:1113
#3  0x00007f7840eb9f7d in DjVuDocument::get_thumbnail (this=0x192de10, 
    page_num=9, dont_decode=false) at DjVuDocument.cpp:1369
#4  0x00007f7840f0c5cd in ddjvu_thumbnail_status (document=0x192b1a0, 
    pagenum=9, start=1) at ddjvuapi.cpp:2479
#5  0x00007f784118090b in djvu_document_thumbnails_get_thumbnail (
    document=0x123e800, rc=0x1924860, border=1) at djvu-document.c:538
#6  0x00007f784c0b99ca in ev_document_thumbnails_get_thumbnail (
    document=0x123e800, rc=0x1924860, border=1) at ev-document-thumbnails.c:58
#7  0x000000000042385f in ev_job_thumbnail_run (job=0x122d700) at ev-jobs.c:665
#8  0x00000000004223c2 in ev_job_run (job=0x122d700) at ev-jobs.c:203
#9  0x0000000000421454 in ev_job_thread (job=0x122d700)
    at ev-job-scheduler.c:183
#10 0x0000000000421561 in ev_job_thread_proxy (data=0x0)
    at ev-job-scheduler.c:213
#11 0x00007f7846e378d1 in g_thread_create_proxy (data=0x1220c90)
    at gthread.c:635
#12 0x00007f784aae7087 in start_thread (arg=<value optimized out>)
    at pthread_create.c:297
#13 0x00007f7846b41ccd in clone () from /lib/libc.so.6
#14 0x0000000000000000 in ?? ()

I can produce more bt if needed.
Comment 13 Peter Volkov (RETIRED) gentoo-dev 2009-03-17 08:13:46 UTC
Thank you for report and backtraces David. I've contacted upstream and they suggested to disable threads completely, since it's was supposed as debugging feature only. Probably this bug will be fixed properly in future, but currently I've removed threads USE flag in 3.5.21_p20090103 (and I doubt threads implementation does not exist anywhere in Gentoo, so threads should be enabled everywhere now). FIXED for now.