Bug 695328 - MuPDF Crash with Sample Project
Summary: MuPDF Crash with Sample Project
Status: RESOLVED INVALID
Alias: None
Product: MuPDF
Classification: Unclassified
Component: mupdf (show other bugs)
Version: master
Hardware: Android Phone Android
: P4 normal
Assignee: Matt Holgate
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-23 11:36 UTC by Alexei Roschak
Modified: 2014-07-03 10:18 UTC (History)
2 users (show)

See Also:
Customer:
Word Size: ---


Attachments
logcat debug output during test of sample project (30.85 KB, text/plain)
2014-06-23 11:36 UTC, Alexei Roschak
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexei Roschak 2014-06-23 11:36:16 UTC
Created attachment 11017 [details]
logcat debug output during test of sample project

Hello,

I'm trying to use the mupdf library in an Android project. I have everything set up, but choosing a file from the ChoosePDFLibrary, it crashes with no stacktrace I can use to debug the issue. This is my goal, but I've simply tried to compile the git repository project for Android and run it. It has the same issue, so there's something wrong with the libmupdf.so that's generated. I've followed all steps on the mupdf website without any errors.

I'm using adb logcat to test, since I can't debug this in IDEs. Attached is the output from logcat while running the Sample Project (com.artifex.mupdfdemo) that comes with the download from the git repo. I have two pdfs on my sd_card that work fine anywhere else. I choose one and it crashes.
Comment 1 Matt Holgate 2014-07-03 08:23:45 UTC
Judging by your logcat output, it looks like you are using libhoudini. I hadn't heard of this library before, but turns out that it is an ARM -> x86 translation layer (http://commonsware.com/blog/2013/11/21/libhoudini-what-it-means-for-developers.html). We don't support running the ARM code in this way.

I'm guessing that you are running on an x86 based device, like the Galaxy Tab 3 10.1?

If so, you should build the x86 version of the library rather than the ARM code by editing "platform/android/jni/Application.mk" before you call ndk-build. This will also be much more performant than using the ARM code.

Please can you try that and see if it fixes the problem for you?
Comment 2 Alexei Roschak 2014-07-03 10:07:37 UTC
Hi Matt,

Thank you for the reply. I was using Genymotion and didn't think that it was causing any issues. I tested it on the stock Android emulator and had no issues. It's a great emulator but fails with native libraries it seems.
Comment 3 Matt Holgate 2014-07-03 10:18:36 UTC
Great, thanks Alexei!