Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on ePub3 lib - missing authors #72

Open
nikolay-atanasov opened this issue Oct 2, 2015 · 6 comments
Open

Crash on ePub3 lib - missing authors #72

nikolay-atanasov opened this issue Oct 2, 2015 · 6 comments

Comments

@nikolay-atanasov
Copy link

The ePub3 lib caches if I tried to open a book with sample application and the book does not have authors

@danielweck
Copy link
Member

First of all, crashing is not good. The ReadiumSDK C++ library includes a "error handler" API, and each native launcher app (iOS, OSX, Android) contains the necessary plumbing to notify EPUB parsing problems via the GUI (e.g. popup dialog).

So, assuming that by "authors" you mean dc:creator, dc:contributor or dc:publisher, then this metadata is optional so your EPUB should be valid.
http://www.idpf.org/epub/301/spec/epub-publications.html#sec-opf-dcmes-optional
By the way, is your ebook EPUB2 or EPUB3?

Are you able / allowed to share the ebook so we can run some tests at our end?
Thanks!

@nikolay-atanasov
Copy link
Author

Hello,

When I try to open this book (http://www.imeon-soft.com/Users_Guide.epub) with SDKLauncher-Android, the fatal error occurs and Android kills the application. Here, I copy the output from LogCat

10-02 14:41:22.838: A/libc(13479): !@fatal signal 11, thread 13479
10-02 14:41:22.838: A/libc(13479): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 13479 (ndroid.launcher)

This book has been created with old version of calibre. I have tried to create a new book with missing author('s) filed but the latest version of calibre manages this field properly and SDKLauncher does not crashes.

How can I use "error handler" API to avoid such crashes? Is there any example snipped in the SDKLauncher-Android

@TienHai
Copy link

TienHai commented Oct 6, 2015

@nikolay-atanasov
Hello,

I get your epub file example.
First your epub is not epubcheck, tags "dc:title" and "dc:language" are missing.
But you are right Readium should not crash.

@danielweck
Hello,

Readium seems to crash when it calls method "EPub3.openBook", this method calls jni method in file "readium-sdk/Platform/Android/jni/epub3.cpp", and the method seems to crash at line 455.
But we have some warnings before crash, due to missing tags in metadata of ePub file, it seems to come from the method "LauncherErrorHandler" line 222 of the same file.

If we replace line 235 => return (bool)b; in "LauncherErrorHandler" method
by => return !isSevereEpubError;

Readium don't crash, and in "SDKLauncher-Android" we see alert dialog created in "popSdkErrorHandlerMessage" method in file "ContainerList.java" when we open the book.

@danielweck
Copy link
Member

@TienHai thank you for your investigation. Any EPUB3 parsing error (including the ones marked as "severe" in the Readium SDK) should be processed by the error handler, giving the user some feedback, and providing an option to ignoring errors or cancelling the ebook loading process. We will look into this. Crashing behaviour is ; without any doubt ; a bug.

However, please bear in mind that at this stage, the "application launchers" are barebones pieces of software that are not production-ready, they are not designed for a polished user experience. They demonstrate how to integrate the Readium SDK at its most basic level. So please do not expect a completely smooth, off-the-shelf commercial-grade product. Feel free to propose improvements too (pull requests are welcome).

@rkwright
Copy link
Member

Marking critical both because of the crash and because we are weak in general with respect to handling "bad" content.

@rkwright rkwright changed the title Crash on ePub3 lib - missing ahthors Crash on ePub3 lib - missing authors May 13, 2016
@danielweck
Copy link
Member

Related issue: #137

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants