mate-desktop / atril

A document viewer for MATE
http://www.mate-desktop.org
GNU General Public License v2.0
197 stars 62 forks source link

Crash in page_set_function when EPUB navMap refers to missing file #599

Closed correctmost closed 5 months ago

correctmost commented 5 months ago

Expected behaviour

Atril opens the linked EPUB

Actual behaviour

Atril crashes when opening the linked EPUB

Steps to reproduce the behaviour

Backtrace
Thread 16 "EvJobScheduler" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffd2ffd6c0 (LWP 4643)]
page_set_function (Link=0x7fffbc00bbf0, contentList=0x7fffbc00b660 = {...}) at /usr/src/debug/atril/atril-1.26.1/backend/epub/epub-document.c:1617
1617            pagedata = listiter->data;                                                                                                                                                                                                    
(gdb) p listiter
$1 = 0x0
(gdb) bt
#0  page_set_function (Link=0x7fffbc00bbf0, contentList=0x7fffbc00b660 = {...}) at /usr/src/debug/atril/atril-1.26.1/backend/epub/epub-document.c:1617
#1  0x00007ffff706dcd0 in g_list_foreach (list=<optimized out>, func=func@entry=0x7fffe043ddb0 <page_set_function>, user_data=user_data@entry=0x7fffbc00b660) at ../glib/glib/glist.c:1092
#2  0x00007fffe044190d in epub_document_set_index_pages (contentList=0x7fffbc00b660 = {...}, index=<optimized out>) at /usr/src/debug/atril/atril-1.26.1/backend/epub/epub-document.c:1636
#3  epub_document_load (document=<optimized out>, uri=<optimized out>, error=0x7fffd2ffc1a0) at /usr/src/debug/atril/atril-1.26.1/backend/epub/epub-document.c:1762
#4  0x00007ffff7f71048 in ev_document_load (document=document@entry=0x7fffbc0066f0, uri=uri@entry=0x555555a03d60 "file:///home/s/Downloads/crash.epub", error=error@entry=0x7fffd2ffc210)
    at /usr/src/debug/atril/atril-1.26.1/libdocument/ev-document.c:236
#5  0x00007ffff7f71c75 in ev_document_factory_get_document (uri=0x555555a03d60 "file:///home/s/Downloads/crash.epub", error=error@entry=0x7fffd2ffc260) at /usr/src/debug/atril/atril-1.26.1/libdocument/ev-document-factory.c:235
#6  0x00007ffff7f2372d in ev_job_load_run (job=0x5555559ed7e0) at /usr/src/debug/atril/atril-1.26.1/libview/ev-jobs.c:1122
#7  0x00007ffff7f22659 in ev_job_thread (job=0x5555559ed7e0) at /usr/src/debug/atril/atril-1.26.1/libview/ev-job-scheduler.c:184
#8  ev_job_thread_proxy (data=<optimized out>) at /usr/src/debug/atril/atril-1.26.1/libview/ev-job-scheduler.c:217
#9  0x00007ffff70a4a05 in g_thread_proxy (data=0x5555559fe210) at ../glib/glib/gthread.c:831
#10 0x00007ffff6dd69eb in start_thread (arg=<optimized out>) at pthread_create.c:444
#11 0x00007ffff6e5a7cc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78

Atril can open the EPUB if I delete this code from OEBPS/toc.ncx (coverpage.xhtml does not exist):

<navPoint id="navpoint-coverpage" playOrder="0">
    <navLabel>
        <text>Cover Page</text>
    </navLabel>
    <content src="Text/coverpage.xhtml" />
</navPoint>

MATE general version

mate-desktop 1.26.2-1

Package version

atril 1.26.1-1

Linux Distribution

Arch

Link to bugreport of your Distribution (requirement)

N/A