After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 711266 - EvinceDocument-CRITICAL **: ev_document_get_n_pages: assertion 'EV_IS_DOCUMENT (document)' failed
EvinceDocument-CRITICAL **: ev_document_get_n_pages: assertion 'EV_IS_DOCUMEN...
Status: RESOLVED OBSOLETE
Product: evince
Classification: Core
Component: general
3.10.x
Other Linux
: Normal normal
: ---
Assigned To: Evince Maintainers
Evince Maintainers
: 727209 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-11-01 17:37 UTC by Ángel Guzmán Maeso (shakaran)
Modified: 2018-05-22 15:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
evince_n_pages.py script for reproduce and generate a buggy pdf for evince (727 bytes, text/x-python)
2013-11-01 18:22 UTC, Ángel Guzmán Maeso (shakaran)
Details
hello_world_buggy.pdf a buggy pdf file 100% reproducible with the bug (1.96 KB, application/pdf)
2013-11-01 18:23 UTC, Ángel Guzmán Maeso (shakaran)
Details
strace -eopen evince log (45.87 KB, text/x-log)
2013-11-01 19:30 UTC, Ángel Guzmán Maeso (shakaran)
Details
strace evince log (45.87 KB, text/plain)
2013-11-01 19:33 UTC, Ángel Guzmán Maeso (shakaran)
Details

Description Ángel Guzmán Maeso (shakaran) 2013-11-01 17:37:35 UTC
See detailed report in launchpad bug #1247208

https://bugs.launchpad.net/ubuntu/+source/evince/+bug/1247208
Comment 1 André Klapper 2013-11-01 18:17:19 UTC
Please paste useful details here so they can be found when searching for them in Bugzilla. Please also attach a testcase.
Comment 2 Ángel Guzmán Maeso (shakaran) 2013-11-01 18:22:30 UTC
Created attachment 258773 [details]
evince_n_pages.py script for reproduce and generate a buggy pdf for evince
Comment 3 Ángel Guzmán Maeso (shakaran) 2013-11-01 18:23:03 UTC
Created attachment 258774 [details]
hello_world_buggy.pdf a buggy pdf file 100% reproducible with the bug
Comment 4 Ángel Guzmán Maeso (shakaran) 2013-11-01 18:23:24 UTC
Generating a simple pdf with python and reportlab I get always the same warning opening in evince:

EvinceDocument-CRITICAL **: ev_document_get_n_pages: assertion 'EV_IS_DOCUMENT (document)' failed

The document has only 1 page, so if evince cannot properly get the number of pages with ev_document_get_n_pages, this should be a valid bug or remove the warning and report 0 pages instead.

I think that the macro EV_IS_DOCUMENT is failing in some point for detect the document mode or it is not supported. If that macro fails, should report why is not considered a valid document.

I attach a fully example python 2.7 script file for reproduce the problem with reportlab, and the pdf file generated for reproduce the problem.
Comment 5 Germán Poo-Caamaño 2013-11-01 18:32:19 UTC
I can't reproduce the bug.  I tried with 3.4.0 (from Ubuntu packages in 12.04), 3.10.0 nor master (from git.gnome.org). I also tried with poppler 0.18.0, 0.24.1 and poppler master.

I might be a local issue to that specific version of Ubuntu.
Comment 6 Germán Poo-Caamaño 2013-11-01 18:35:49 UTC
FWIW, I tried both methods: opening the PDF and a generated PDF using the script.
Comment 7 Ángel Guzmán Maeso (shakaran) 2013-11-01 19:30:07 UTC
Created attachment 258780 [details]
strace -eopen evince log

I am using Ubuntu 14.04 alpha, the version shipped currently is 3.10.0-0ubuntu2 (evince-common package).

I attach a strace log (strace -eopen evince hello_world_buggy.pdf) if helps to debug or diagnotize some local config behaviour.
Comment 8 Ángel Guzmán Maeso (shakaran) 2013-11-01 19:33:59 UTC
Created attachment 258783 [details]
strace evince log

I am using Ubuntu 14.04 alpha, the version shipped currently is 3.10.0-0ubuntu2 (evince-common package).

I attach a strace log (strace -eopen evince hello_world_buggy.pdf) if helps to debug or diagnose some local config behaviour.
Comment 9 Ángel Guzmán Maeso (shakaran) 2013-11-01 19:43:41 UTC
Sorry for double post.

The relevant part of strace (full) for EV_IS_DOCUMENT macro:

read(17, "OK a59eaa453583f094c962423252652"..., 2048) = 37
poll([{fd=17, events=POLLOUT}], 1, -1)  = 1 ([{fd=17, revents=POLLOUT}])
send(17, "NEGOTIATE_UNIX_FD\r\n", 19, MSG_NOSIGNAL) = 19
poll([{fd=17, events=POLLIN}], 1, -1)   = 1 ([{fd=17, revents=POLLIN}])
read(17, "AGREE_UNIX_FD\r\n", 2048)     = 15
poll([{fd=17, events=POLLOUT}], 1, -1)  = 1 ([{fd=17, revents=POLLOUT}])
send(17, "BEGIN\r\n", 7, MSG_NOSIGNAL)  = 7
poll([{fd=17, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=17, revents=POLLOUT}])
sendmsg(17, {msg_name(0)=NULL, msg_iov(2)=[{"l\1\0\1\0\0\0\0\1\0\0\0n\0\0\0\1\1o\0\25\0\0\0/org/fre"..., 128}, {"", 0}], msg_controllen=0, msg_flags=0}, MSG_NOSIGNAL) = 128
clock_gettime(CLOCK_MONOTONIC, {973843, 187209192}) = 0
poll([{fd=17, events=POLLIN}], 1, 25000) = 1 ([{fd=17, revents=POLLIN}])
recvmsg(17, {msg_name(0)=NULL, msg_iov(1)=[{"l\2\1\1\r\0\0\0\1\0\0\0E\0\0\0\6\1s\0\10\0\0\0:1.10400"..., 2048}], msg_controllen=0, msg_flags=MSG_CMSG_CLOEXEC}, MSG_CMSG_CLOEXEC) = 282
recvmsg(17, 0xbfee5f70, MSG_CMSG_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
epoll_ctl(14, EPOLL_CTL_ADD, 17, {0, {u32=3096549928, u64=13130526788672395816}}) = 0
epoll_ctl(14, EPOLL_CTL_MOD, 17, {EPOLLIN, {u32=3096549928, u64=13132584477439138344}}) = 0
sendmsg(17, {msg_name(0)=NULL, msg_iov(2)=[{"l\1\0\1\211\0\0\0\2\0\0\0\177\0\0\0\1\1o\0\25\0\0\0/org/fre"..., 144}, {"\204\0\0\0type='signal',sender='org.fr"..., 137}], msg_controllen=0, msg_flags=0}, MSG_NOSIGNAL) = 281
clock_gettime(CLOCK_MONOTONIC, {973843, 189149402}) = 0
poll([{fd=17, events=POLLIN}], 1, 25000) = 1 ([{fd=17, revents=POLLIN}])
recvmsg(17, {msg_name(0)=NULL, msg_iov(1)=[{"l\2\1\1\0\0\0\0\3\0\0\0=\0\0\0\6\1s\0\10\0\0\0:1.10400"..., 2048}], msg_controllen=0, msg_flags=MSG_CMSG_CLOEXEC}, MSG_CMSG_CLOEXEC) = 80
recvmsg(17, 0xbfee5fd0, MSG_CMSG_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
sendmsg(17, {msg_name(0)=NULL, msg_iov(2)=[{"l\1\0\1\0\0\0\0\3\0\0\0y\0\0\0\1\1o\0\27\0\0\0/com/can"..., 144}, {"", 0}], msg_controllen=0, msg_flags=0}, MSG_NOSIGNAL) = 144
write(16, "1", 1)                       = 1
fstat64(14, {st_mode=0600, st_size=0, ...}) = 0
fcntl64(14, F_GETFL)                    = 0x2 (flags O_RDWR)
write(4, "\1\0\0\0\0\0\0\0", 8)         = 8
write(11, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0xb86d6d98, FUTEX_WAKE_PRIVATE, 1) = 1
futex(0xb865fde8, FUTEX_WAIT_PRIVATE, 2, NULL) = -1 EAGAIN (Resource temporarily unavailable)
futex(0xb865fde8, FUTEX_WAKE_PRIVATE, 1) = 0
write(2, "\n(evince:9783): EvinceDocument-C"..., 114
(evince:9783): EvinceDocument-CRITICAL **: ev_document_get_n_pages: assertion 'EV_IS_DOCUMENT (document)' failed
) = 114
Comment 10 Germán Poo-Caamaño 2013-11-01 19:52:11 UTC
I know what the macros does. I meant to say that the bug is likely to be in Ubuntu build of evince or any of its dependencies.  Not in upstream Evince.
Comment 11 Christian Persch 2013-11-01 20:22:12 UTC
Need a stack trace, not a strace, from when the critical warning is emitted. See https://wiki.gnome.org/GettingTraces/Details#obtain-a-stacktrace for more info.
Comment 12 Ángel Guzmán Maeso (shakaran) 2013-11-01 23:29:58 UTC
Hi Cristian and Germán, this stack trace should help a bit. I create the breakpoint for ev_document_get_n_pages function, let me know if I should use another function more useful (note that I have debug symbols installed, that is, evince-dbg package).

$ LANGUAGE=en_US.UTF-8 gdb evince
GNU gdb (GDB) 7.6.1-1ubuntu1
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/evince...Reading symbols from /usr/lib/debug/usr/bin/evince...done.
done.
(gdb) break ev_document_get_n_pages
Breakpoint 1 at 0x144d0
(gdb) run hello_world_buggy.pdf
Starting program: /usr/bin/evince hello_world_buggy.pdf
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
[New Thread 0xb5cd1b40 (LWP 11691)]
[New Thread 0xb52ffb40 (LWP 11692)]
[New Thread 0xb48ffb40 (LWP 11693)]
[New Thread 0xac20ab40 (LWP 11697)]

Breakpoint 1, ev_document_get_n_pages (document=document@entry=0x0) at /build/buildd/evince-3.10.0/./libdocument/ev-document.c:587
587	/build/buildd/evince-3.10.0/./libdocument/ev-document.c: No such file or directory.
(gdb)  thread apply all bt

Thread 3 (Thread 0xb52ffb40 (LWP 11692))

  • #0 __kernel_vsyscall
  • #1 write
    at ../sysdeps/unix/syscall-template.S line 81
  • #2 g_wakeup_signal
    at /build/buildd/glib2.0-2.38.1/./glib/gwakeup.c line 238
  • #3 g_source_attach
    at /build/buildd/glib2.0-2.38.1/./glib/gmain.c line 1176
  • #4 schedule_writing_unlocked
    at /build/buildd/glib2.0-2.38.1/./gio/gdbusprivate.c line 1604
A debugging session is active.

	Inferior 1 [process 11687] will be killed.

Quit anyway? (y or n) y
Comment 13 Christian Persch 2013-12-30 18:30:19 UTC
---Type <return> to continue, or q <return> to quit---q

You truncated the trace here, the most interesting info (thread 1) is therefore missing.
Comment 14 suokunlong 2014-01-26 03:06:06 UTC
See:
EvinceDocument-CRITICAL **: ev_document_get_n_pages: assertion 'EV_IS_DOCUMENT (document)' failed

May be related.
Comment 15 Germán Poo-Caamaño 2014-03-28 05:56:04 UTC
*** Bug 727209 has been marked as a duplicate of this bug. ***
Comment 16 GNOME Infrastructure Team 2018-05-22 15:22:02 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/evince/issues/403.