rschroll / beru

The Basic Epub Reader for Ubuntu
http://rschroll.github.io/beru/
GNU General Public License v3.0
25 stars 12 forks source link

Failure to run on device #56

Closed rschroll closed 10 years ago

rschroll commented 10 years ago

Currently, Beru is running fine on the desktop, but not on emulators or devices. It will run on devices when launched from the console, but when launched from the GUI or Qt Creator, it starts and then exits rapidly. It looks like it may be a clean exit, not a seg fault. No useful output results from running under debug mode.

Commenting out large sections of BookPage.qml will get it to run occasionally. But this isn't reproducible.

rschroll commented 10 years ago

@randy-jr-olive: Does this sound like the same problem you're having?

randy-jr-olive commented 10 years ago

this is absolutely the problem I've been running into, and I've also playing around with BookPage.qml to try and get it to work, no luck. I haven't gotten much output from the crashes, hard to find logs or debug info on the phone. I did get an error one time: WARNING: the use of the Ubuntu.Components.Extras.Browser namespace is deprecated, please consider updating your applications to import Ubuntu.Web instead

This is of course, vague, and just a warning, but it's the only output the device has ever given me.

randy-jr-olive commented 10 years ago

more errors I've found:

libust[18510/18513]: Error: Error opening shm /lttng-ust-wait-5 (in get_wait_shm() at lttng-ust-comm.c:886) Application started: 18510 [0813/162038:ERROR:icu_util.cc(149)] Couldn't mmap /usr/lib/arm-linux-gnueabihf/oxide-qt/icudtl.dat

look familiar at all?

randy-jr-olive commented 10 years ago

go this one too, still trying to run on phone from qt creator

Application started: 23056 /usr/lib/arm-linux-gnueabihf/qt5/bin/qmlscene: invalid option -- 'I'

rschroll commented 10 years ago

I've found some consistency. If I comment out both the BookPage and the BrowserPage in main.qml, I get it to run. (Though somewhat pointlessly.)

If I comment out only the BookPage, it usually runs, but not always. (I can't make it fail at the moment, so I can't get the error message here.) When it runs, it gives warnings about the deprecation and experimental nature of QtWebKit.

If I comment out only the BrowserPage, I get these error messages

libust[10190/10193]: Error: Error opening shm /lttng-ust-wait-5-32011 (in get_wait_shm() at lttng-ust-comm.c:886)
libust[10190/10193]: Error: Error opening shm /lttng-ust-wait-5-32011 (in get_wait_shm() at lttng-ust-comm.c:886)
libust[10190/10192]: Error: Error opening shm /lttng-ust-wait-5 (in get_wait_shm() at lttng-ust-comm.c:886)
libust[10190/10192]: Error: Error opening shm /lttng-ust-wait-5 (in get_wait_shm() at lttng-ust-comm.c:886)
/usr/lib/i386-linux-gnu/qt5/bin/qmlscene: invalid option -- 'I'
/usr/lib/i386-linux-gnu/qt5/bin/qmlscene: unrecognized option '--appargs='
[0817/171713:ERROR:icu_util.cc(149)] Couldn't mmap /usr/lib/i386-linux-gnu/oxide-qt/icudtl.dat
[0817/171713:FATAL:content_main_runner.cc(715)] Check failed: base::i18n::InitializeICU(). 

The first two libust errors and the qmlscene complaints about options also appear when the (reduced) programs runs, so I don't think they're important. My guess is that it's the icu_util.cc that's the problem. It seems to be a part of Chromium/Oxide, though, so I don't know what to do about it.

rschroll commented 10 years ago

This problem is caused by apparmor. To fix it, add the "webview" policy group, boost the version to 1.1, and move to the 14.04 framework. This is all helpfully documented in the middle of this IRC log. And apparently nowhere else. Lovely....

So after that fix, now we get

file:///opt/click.ubuntu.com/com.ubuntu.developer.rschroll.beru/0.9.6/ui/main.qml:59 Type BrowserPage unavailable
file:///opt/click.ubuntu.com/com.ubuntu.developer.rschroll.beru/0.9.6/ui/BrowserPage.qml:51 Type UbuntuWebView unavailable
file:///usr/lib/i386-linux-gnu/qt5/qml/Ubuntu/Components/Extras/Browser/UbuntuWebView01.qml:20 plugin cannot be loaded for module "QtWebKit": Cannot load library /usr/lib/i386-linux-gnu/qt5/qml/QtWebKit/libqmlwebkitplugin.so: (dlopen: cannot load any more object with static TLS)

Now the error messages are ungrammatical and confusing. (Can it not load more objects with static TLS, or can it no longer load objects with static TLS? And more importantly, why?) Progress!

rschroll commented 10 years ago

@randy-jr-olive: Can you see if you have this recent issue on the device? Some Googling suggests that it may be an i386 issue.

For my own records, here's the Stack Overflow question that I've been working off of. Sometimes it runs, sometimes it doesn't. I've tried adding -ftls-model=global-dynamic to the flags, but it doesn't seem to alter things much.

randy-jr-olive commented 10 years ago

I was working I this from the webview/oxide problem, but app armor seems just as likely, I've been following this thread locally, I'll play around some more to see what comes up.

randy-jr-olive commented 10 years ago

I still get the following error, even after including your chagnes in my local branch:

Installed com.ubuntu.developer.rschroll.beru-0.9.6.armhf (installed:click,removable=1,app_name=beru) Application installed, executing Registering hooks Start Application libust[19627/19630]: Error: Error opening shm /lttng-ust-wait-5-32011 (in get_wait_shm() at lttng-ust-comm.c:886) Application started: 19627 Received a failed event The Application exited, cleaning up

rschroll commented 10 years ago

I've noticed that the output pane in Qt Creator often misses some error messages. Look at the log in ~/.cache/upstart and see if there's any other errors. (Note that the log file will have the output from many invocations, so just look at the end.) I've seen the libust errors many times, and they don't seem to be fatal.

randy-jr-olive commented 10 years ago

I get this error on the deivce (from logs), which you've seen before:

libust[26145/26149]: Error: Error opening shm /lttng-ust-wait-5-32011 (in get_wait_shm() at lttng-ust-comm.c:886) libust[26145/26149]: Error: Error opening shm /lttng-ust-wait-5-32011 (in get_wait_shm() at lttng-ust-comm.c:886) /usr/lib/arm-linux-gnueabihf/qt5/bin/qmlscene: invalid option -- 'I' /usr/lib/arm-linux-gnueabihf/qt5/bin/qmlscene: unrecognized option '--appargs='

[0817/223916:ERROR:icu_util.cc(149)] Couldn't mmap /usr/lib/arm-linux-gnueabihf/oxide-qt/icudtl.dat [0817/223916:FATAL:content_main_runner.cc(715)] Check failed: base::i18n::InitializeICU().

What I do find weird is that I also run into problems with qmlscene saying that -I and --appargs are invalid, I wonder if that's related at all.

randy-jr-olive commented 10 years ago

This is the line of code from icu_util.cc that is giving me trouble (line 149):

if (!mapped_file.Initialize(data_path)) { LOG(ERROR) << "Couldn't mmap " << data_path.AsUTF8Unsafe(); return false; }

Could it still be a file permission thing? Maybe file permissions are still preventing the browser from loading.

rschroll commented 10 years ago

That's the error that indicates apparmor problems. I'd check that your click packages are actually building with the updated manifest and apparmor files.

rschroll commented 10 years ago

I've been able to run Beru several times on an armhf emulator without running into a TLS issue. I pretty sure that this is just an i386 issue and we can ignore it for now. But I'd like to get a confirmation from someone with a physical device.

randy-jr-olive commented 10 years ago

I've been messing around with oxide for the browserPage, but getting no-where (and probably unrelated anyways), I'll see if I can't just get it to run as is and give you some feedback from the device. I'll start with a nexus 4.

randy-jr-olive commented 10 years ago

It does run for me on the nexus 4 and 7, I get the following errors in the SDK output: qml: Error 1: Could not find a script context to deliver the message too qml: WindowSizeChanged qml: Error 1: Could not find a script context to deliver the message too qml: WindowSizeChanged

also, the bottom toolbar is useable on the desktop, but neither of my devices could open the toolbar while reading an ebook, bug I think, maybe not a whole "issue".

It is nice to see Beru running on the device, it's coming along nicely.

randy-jr-olive commented 10 years ago

https://www.youtube.com/watch?v=Tvd5QVgjBmI&list=UUO9EwdEZUnJJc0TgNXIPxhg

video of missing toolbar

rschroll commented 10 years ago

I'm going to close this bug. The TLS issues have been moved into #59, but I don't really care about them right now. I've noticed the toolbar issue on the emulator, but I was hoping that that was just emulator brokenness. No such luck, apparently, so it's bug #60.