GNOME Bugzilla – Bug 711266
EvinceDocument-CRITICAL **: ev_document_get_n_pages: assertion 'EV_IS_DOCUMENT (document)' failed
Last modified: 2018-05-22 15:22:02 UTC
See detailed report in launchpad bug #1247208 https://bugs.launchpad.net/ubuntu/+source/evince/+bug/1247208
Please paste useful details here so they can be found when searching for them in Bugzilla. Please also attach a testcase.
Created attachment 258773 [details] evince_n_pages.py script for reproduce and generate a buggy pdf for evince
Created attachment 258774 [details] hello_world_buggy.pdf a buggy pdf file 100% reproducible with the bug
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.
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.
FWIW, I tried both methods: opening the PDF and a generated PDF using the script.
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.
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.
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
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.
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.
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
+ Trace 232701
Thread 3 (Thread 0xb52ffb40 (LWP 11692))
A debugging session is active. Inferior 1 [process 11687] will be killed. Quit anyway? (y or n) y
---Type <return> to continue, or q <return> to quit---q You truncated the trace here, the most interesting info (thread 1) is therefore missing.
See: EvinceDocument-CRITICAL **: ev_document_get_n_pages: assertion 'EV_IS_DOCUMENT (document)' failed May be related.
*** Bug 727209 has been marked as a duplicate of this bug. ***
-- 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.