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

beru crashes after downloading epub book ubuntu touch utopic v113 #52

Closed halucigenia closed 10 years ago

halucigenia commented 10 years ago

Hi, I just found beru and tested it on my nexus 4 ubuntu touch trusty v303. It worked well.

I have just upgraded to utopic v113 and it installs OK from the app store but crashes out once a book is downloaded from gutenberg. I have tried getting around the application confinement with the link method and found that ln -s /home/phablet/.local/share/com.ubuntu.developer.rschroll.beru/Books/ /home/phablet/Books creates a valid link but that did not help.

I have uninstalled, removed the link, the downloaded book and the /home/phablet/.local/share/com.ubuntu.developer.rschroll.beru/ directory and re-installed but it still crashes once a book is downloaded.

Should the version from the app store work in utopic?

rschroll commented 10 years ago

Should the version from the app store work in utopic?

I don't know. I've been unable to get a utopic image working on the emulator yet, so I haven't been able to test. It's entirely possible that something's changed in the libraries such that there's a crash when Beru tries to use it. (For some reason, Ubuntu has abandoned Debian's tried-and-true method of building binaries on dedicated machines, and is instead relying on me to keep them up-to-date. Which, knowing me, is a very bad idea.) But it's odd that that would happen only when you try to download a book.

I think there should be a crash log in /var/crash. It may not be named anything useful, so check the modification time to find the right one if there are several. If you can send that to me, I'll do my best to figure out what it means. (I don't think you can attach files here at Github, so feel free to email it to me: rschroll at gmail.)

halucigenia commented 10 years ago

no crash log appears in /var/crash. after Beru crashes.

It consistently crashes after downloading a book, and keeps on crashing when run after this, but when /home/phablet/.local/share/com.ubuntu.developer.rschroll.beru is removed the application runs again.

I will try getting around the application confinement using the other methods and see if I can load a book from another location.

halucigenia commented 10 years ago

OK I have now tried "/opt/click.ubuntu.com/com.ubuntu.developer.rschroll.beru/current/apparmor/, rename the file beru.access.json to beru.json" and successfully created a directory /home/phablet/Documents/Books, copied an epub book to that location rather than downloading and the same thing happened, Beru crashes each time it is run until /home/phablet/.local/share/com.ubuntu.developer.rschroll.beru is removed.

rschroll commented 10 years ago

I didn't appreciate that it would crash every time it's restarted after downloading the book. Just to make sure I understand correctly: Beru can download a book, but crashes as soon as the download is completed.
It also crashes each time it is started afterwards until the configuration directory is cleared. Is that correct?

The next time this happens, please try moving all the files in ~/.local/share/com.ubuntu.developer.rschroll.beru/Databases/ to somewhere else and restarting. Let me know if that helps anything. If you don't mind sending me those files, I'll take a look and see if I notice anything wrong.

I'm also in the process of creating a new, up-to-date build environment. We'll see if a newly-compiled package does any better.

halucigenia commented 10 years ago

Yes Beru can download a book, but crashes as soon as the download is completed. It also crashes each time it is started afterwards until the configuration directory is cleared. I can also copy a previously downloaded epub book into the directory selected after removing the application confinement and it still crashes. Removing the Databases directory does not help as if there is a book in the relevant directory each time Beru is opened it immediately crashes, I guess on finding a book and/or creating the database. I will send you a copy of the databases directory after a crash.

rschroll commented 10 years ago

The databases look fine. I didn't appreciate that it was crashing regardless of how the book was added. That actually makes more sense.

My current suspicion is that there's a binary incompatibility between trusty and utopic, and Beru is crashing into that when you load a book in. Once I get a new build environment working, I'll make a new click package and get it to you for testing.

Thanks for the help!

halucigenia commented 10 years ago

Good luck. I have tried the emulator and can't even get the trusty images to work.

I have the SDK installed but have not managed to get very far with it at all.

If you need to get me to do anything with the SDK let me know.

rschroll commented 10 years ago

I've finally managed to get a build based on utopic. The binary files are different, so hopefully that'll fix things. Get the click package here: http://rschroll.github.io/beru/assets/com.ubuntu.developer.rschroll.beru_0.9.6_armhf.utopic.click

Note that it's still using the same version number. I think you can install it directly over the existing version, but if it complains, you main need to uninstall the existing version.

Please let me know if this fixes things.

halucigenia commented 10 years ago

I had to put the device into read write mode before the package you made would install, is that normal for a manually installed click package?

No luck though, when I install over the top the problem persists, when I un-install the original and install from the package you made I get no Beru icon in my apps list.

the messages I got on installing were:-

(Reading database ... 73 files and directories currently installed.) Preparing to unpack com.ubuntu.developer.rschroll.beru_0.9.6_armhf.utopic.click ... Unpacking com.ubuntu.developer.rschroll.beru (0.9.6) over (0.9.6) ... Setting up com.ubuntu.developer.rschroll.beru (0.9.6) ...

After un-installing Beru and deleting the configuration directory I see the folders Books and Databases have re-appeared in the configuration directory, so it must be installing those at least after reinstalling the new package. Is there a way to run Beru from the terminal or create an icon for it?

rschroll commented 10 years ago

On Mon, Jul 7, 2014 at 3:18 AM, halucigenia notifications@github.com wrote:

I had to put the device into read write mode before the package you made would install, is that normal for a manually installed click package?

No luck though, when I install over the top the problem persists, when I un-install the original and install from the package you made I get no Beru icon in my apps list.

I would have thought that you wouldn't need to switch to read-write mode, since the install should happen in the same place as it would if you had installed from the apps scope. But I'm not sure about that.

Given the problems you were having, I suspect that the new version never got installed properly. What command were you using?

As an alternative, you could try installing the version from the store, unpacking the click I sent you (dpkg -x com.blahblah.click unpack-dir), and copying the .so files from this version into the installed copy at /opt/click.ubuntu.com/com.ubuntu.developer.rschroll.beru/0.9.6/ (or whatever it is - I typed that from memory). There should be four, one each in the directories Epub, File, FontList, and HttpServer. These are the only change, so replacing them would be the equivalent of installing the new version.

I'll keep trying to get an emulator working.

halucigenia commented 10 years ago

I used the command that you recommended from http://rschroll.github.io/beru/install.html#click

sudo click install --force-missing-framework --user=$USER *.click

Though I did run it from an adb shell, maybe that's wrong.

I have also now tried running sudo pkcon install-local *.click from the terminal on the phablet but that has not helped.

I will reinstall utopic 113 with ubuntu-device-flash --channel=ubuntu-touch/utopic --wipe

and try again, this time I will get ssh running as well as this should be better than adb shell.

I will report back after I have done this.

halucigenia commented 10 years ago

OK, I have run sudo click install --force-missing-framework --user=$USER *.click from an ssh session, after reinstalling utopic 113, it did install and there was an icon, but still no luck it still crashes after downloading a book. What next?

halucigenia commented 10 years ago

Oh, and I did try copying the .so files after installing the app from the store but to no avail.

rschroll commented 10 years ago

Well, I'm stymied. I can't get an arm emulator past the setup pages, so I can't reproduce it.

I'll ask about this on the ubuntu-phone mailing list, and relay their suggestions on to you. (Unless you read that list.)

Thanks for all the help; sorry we haven't gotten you any result.

penk commented 10 years ago

Hi, have you tested against Qt 5.3? Could be a regression like the split method..

rschroll commented 10 years ago

I have not. I tried running it from inside the chroot, but it failed with some GLES error.

rschroll commented 10 years ago

Ok, I think I have this under control now. I managed to reproduce this problem on an i386 emulator, and catch the seg fault under gdb. (For the record, you can run Beru under gdb like so:

phablet@ubuntu-phablet:/opt/click.ubuntu.com/com.ubuntu.developer.rschroll.beru/0.9.6$ gdb --args qmlscene -I ./ ui/main.qml --appargs="" --desktop_file_hint=/usr/share/applications/webbrowser-app.desktop

It'll show up as the Browser on your app page, as a work around for https://bugs.launchpad.net/ubuntu/+source/unity8/+bug/1325984.) It looks like the problem is that pointers are no longer created NULL. I don't know if that's a change in utopic or Qt5.3, but it broke some code that I had that assumed new pointers would be NULL.

Anyway, a one-line fix has solved the problem on the i386 emulator.
I've make a new arm click: http://rschroll.github.io/beru/assets/com.ubuntu.developer.rschroll.beru_0.9.6_armhf.quazip.click Please give that a spin and let me know if it works. (BTW, the pkcon install line is working for me on the emulator. I'd try that first, since people smarter than I recommend it.)

halucigenia commented 10 years ago

Great stuff. I downloaded your new arm click and ran sudo pkcon install-local com.ubuntu.developer.rschroll.beru_0.9.6_armhf.quazip.click to install it from the device terminal app itself but this fresh install did not work, no app icon again. However, I reinstalled from the ubuntu store and ran the same install command again, this time from an ssh session to install over the store version and voilà it's now working.

Thanks, I have been looking for an ebook reader ever since testing with ubuntu touch on my nexus 4 to replace an old linux based hand held device and I was only missing this functionality. I am always wanting to keep OS and software up to date so was so disappointed when I upgraded to utopic that it did not work. I have come to expect this when upgrading too soon but it's nice to know that contacting the developer directly can produce such quick results. :)

rschroll commented 10 years ago

So glad to hear that! I'll push out a new version with this fix shortly. Thanks for all your help in figuring this out!