Bug 694967 - MuPDF crashes after pressing the Back Button while it renders a specific PDF
Summary: MuPDF crashes after pressing the Back Button while it renders a specific PDF
Status: RESOLVED FIXED
Alias: None
Product: MuPDF
Classification: Unclassified
Component: mupdf (show other bugs)
Version: 1.3
Hardware: Android Phone Android
: P4 major
Assignee: MuPDF bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-22 02:31 UTC by Shiva
Modified: 2014-06-17 03:41 UTC (History)
3 users (show)

See Also:
Customer:
Word Size: ---


Attachments
PDF that takes more time in rendering and then crashes (1.43 MB, application/pdf)
2014-01-22 02:31 UTC, Shiva
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Shiva 2014-01-22 02:31:43 UTC
Created attachment 10606 [details]
PDF that takes more time in rendering and then crashes

Good Morning,

I have a specific PDF to be rendered and MuPDF is able to render it properly, but it takes long time though in rendering this PDF. The real problem comes, when I give few flips and press the back button while it renders, the App crashes. I attached the PDF with this note. Please look into this and help us.

Thanks!
Comment 1 Shiva 2014-01-22 02:50:29 UTC
java.lang.NullPointerException
at com.artifex.mupdfdemo.PageView.addHq in PageView.java on Line 606
at com.artifex.mupdfdemo.MuPDFReaderView.onSettle in MuPDFReaderView.java on Line 243
at com.artifex.mupdfdemo.ReaderView$2.run in ReaderView.java on Line 781
at android.os.Handler.handleCallback in Handler.java on Line 725
at android.os.Handler.dispatchMessage in Handler.java on Line 92
at android.os.Looper.loop in Looper.java on Line 176
at android.app.ActivityThread.main in ActivityThread.java on Line 5279
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke in Method.java on Line 511
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run in ZygoteInit.java on Line 1102
at com.android.internal.os.ZygoteInit.main in ZygoteInit.java on Line 869
at dalvik.system.NativeStart.main(Native Method)
Comment 2 Robin Watts 2014-01-22 03:12:05 UTC
That backtrace is not from the current version of the code. Please post a backtrace from the current version.
Comment 3 Shiva 2014-01-22 04:17:01 UTC
That was the crash report from the earlier version, but now I am not getting the crash. But the App silently exits.

(In reply to comment #2)
> That backtrace is not from the current version of the code. Please post a
> backtrace from the current version.
Comment 4 Matt Holgate 2014-06-16 09:12:58 UTC
I'm not sure if this is the same problem as was originally reported, but I can certainly make it crash. Here is a backtrace, this time in the native code:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 26907]
Java_com_artifex_mupdfdemo_MuPDFCore_gotoPageInternal (env=<optimized out>, thiz=<optimized out>, page=0) at jni/mupdf.c:518
518		fz_context *ctx = glo->ctx;
(gdb) bt
#0  Java_com_artifex_mupdfdemo_MuPDFCore_gotoPageInternal (env=<optimized out>, thiz=<optimized out>, page=0) at jni/mupdf.c:518
#1  0x77177142 in Java_com_artifex_mupdfdemo_MuPDFCore_getAnnotationsInternal (env=0x7713fff0, thiz=0x27500001, pageNumber=0) at jni/mupdf.c:1869
#2  0x41544bd0 in ?? ()
#3  0x41544bd0 in ?? ()
Comment 5 Matt Holgate 2014-06-17 03:36:42 UTC
Hopefully fixed in d5a22b7c76c7c0f67f9350b2a7a5dc030b212421.
Comment 6 Paul Gardiner 2014-06-17 03:41:14 UTC
commit d5a22b7c76c7c0f67f9350b2a7a5dc030b212421
Author: Matt Holgate <matt@emobix.co.uk>
Date:   Tue Jun 17 11:14:39 2014 +0100

    Fix for bug #694967 - MuPDF crashes after pressing the Back Button while it renders a specific PDF

    Some async tasks were still trying to access the globals pointer, which had
    been nulled during shutdown, leading to a crash.

    Check for NULL and return cleanly in this case.

    Possibly we should also be calling AsyncTask.get() to wait for the tasks to
    finish, before nulling the global pointer?