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

koreader crashes with a segfault #1675

Closed
Markismus opened this issue Oct 16, 2015 · 32 comments
Closed

koreader crashes with a segfault #1675

Markismus opened this issue Oct 16, 2015 · 32 comments

Comments

@Markismus
Copy link
Member

@Markismus Markismus commented Oct 16, 2015

Every time I try to open this book, I get a segmentation fault. This is the debug log.

I've update to the latest version and now I get a segfault as soon as koreader starts and tries to open the last book read.

Any ideas of what could be done to fix this? Is it a problem with my ereader or with koreader?

@NiLuJe
Copy link
Member

@NiLuJe NiLuJe commented Oct 16, 2015

On which device?

@NiLuJe
Copy link
Member

@NiLuJe NiLuJe commented Oct 16, 2015

Reproduced on a PW2.

Program received signal SIGSEGV, Segmentation fault.
0x414d4cfa in LVFormatter::processParagraph () from /mnt/us/koreader/./libs/libcrengine.so
(gdb) bt full
#0  0x414d4cfa in LVFormatter::processParagraph () from /mnt/us/koreader/./libs/libcrengine.so
No symbol table info available.
#1  0xbeb936e2 in ?? ()
No symbol table info available.
Cannot access memory at address 0xffffffff

Ping @chrox ;).

@Markismus
Copy link
Member Author

@Markismus Markismus commented Oct 16, 2015

Ah, nice. My device is a Kobo Aura H2O

@Markismus
Copy link
Member Author

@Markismus Markismus commented Oct 16, 2015

I've converted the original epub with calibre. So this is the calibre validated epub. It works like a charm in calibre and Kobo Nickel.

@NiLuJe
Copy link
Member

@NiLuJe NiLuJe commented Oct 16, 2015

On the off-chance that it matters, how does the original ePub fare?

@Markismus
Copy link
Member Author

@Markismus Markismus commented Oct 16, 2015

The same. Sigil generated that many errors on validation, that I thought it would be safer to convert epub to epub with calibre. The converted one generated a lot of errors, too.

I think the original is a retail epub. But I found it on MyAnonaMouse, so it could have been reformatted.

@houqp houqp added the bug label Feb 29, 2016
@houqp
Copy link
Member

@houqp houqp commented Feb 29, 2016

Hm... I am not able to reproduce this on emulator anymore. @Markismus can you give the latest version a try?

@Markismus
Copy link
Member Author

@Markismus Markismus commented Feb 29, 2016

On version v2015.11-183-g03d7b7d it still generates a segmentation fault on Kobo Aura H2O.

@Markismus
Copy link
Member Author

@Markismus Markismus commented Feb 29, 2016

On a side note, why can't it register those fonts (see log in previous post). Some are evidently encrypted by Kobo, so that's no surprise, but others are koreader's right?

@NiLuJe
Copy link
Member

@NiLuJe NiLuJe commented Feb 29, 2016

Huh, especially since they (noto, droid & co) don't trigger an error for the first book opened... :?

@Markismus
Copy link
Member Author

@Markismus Markismus commented Feb 29, 2016

Yes, could it be tied in with the segmentation fault that book is generating?

@NiLuJe
Copy link
Member

@NiLuJe NiLuJe commented Feb 29, 2016

No idea, I'll try to replicate it and get a coredump (ulimit -c 0), but I don't remember if Kobo ships a gdb binary, so I'll have to whip one up... Oh, joy.

Don't hold your breath, it may annoy me too much to actually look into it ;p.

@NiLuJe
Copy link
Member

@NiLuJe NiLuJe commented Feb 29, 2016

Just for the record, are those with an SD card installed? And are the crashers stored on the SD card or not?

@Markismus
Copy link
Member Author

@Markismus Markismus commented Feb 29, 2016

These crashes are with one 64GB microSD in the internal, and none in the external bay. The koreader files and the library are on the FAT partition. (I think this is likely to become evident as a mistake. I think I will end up with a 4GB FAT partition for Kobo Nickel and a 59GB ext2 for koreader and the library.)

@NiLuJe
Copy link
Member

@NiLuJe NiLuJe commented Feb 29, 2016

Great, that means I don't have to dig out an sd card to test this ;p.

NB: ext2 is also unjournaled, so maybe go with ext4?

@NiLuJe
Copy link
Member

@NiLuJe NiLuJe commented Feb 29, 2016

Can't reproduce so far...

What I can reproduce though, is broken input when coming back from screensaver...
EDIT: Which also happens with nickel, so I'm guessing USBnet is confusing the kernel...

Note that, as usual, I'm not using KSM and launching koreader via SSH over USBNet...

@NiLuJe
Copy link
Member

@NiLuJe NiLuJe commented Feb 29, 2016

Okay, I just had to post "can't reproduce" to get a segfault :D.

@NiLuJe
Copy link
Member

@NiLuJe NiLuJe commented Feb 29, 2016

... And of course I can't get this stupid kernel to generate core dumps automatically. yay.

@NiLuJe
Copy link
Member

@NiLuJe NiLuJe commented Feb 29, 2016

Theeeere. Had to attach to the running process w/ gdb, but I got one. Of course that's not a debug build, so nothing terribly informative there, but, still.

(If someone needs a Kobo gdb build, poke me).

FWIW, I enabled the time autorefresh thing after about 10 minutes of nothing eventful happening ;).

And I was happily switching terminals on my desktop when this happened, so, device (H2O) untouched.

Program received signal SIGSEGV, Segmentation fault.
0x2bed0f14 in LVDocView::checkRender() () from /mnt/onboard/.custom/koreader/./libs/libcrengine.so
(gdb) bt full
#0  0x2bed0f14 in LVDocView::checkRender() () from /mnt/onboard/.custom/koreader/./libs/libcrengine.so
No symbol table info available.
#1  0x2bed20c2 in LVDocView::checkPos() () from /mnt/onboard/.custom/koreader/./libs/libcrengine.so
No symbol table info available.
#2  0x2bed338c in LVDocView::getCurPage() () from /mnt/onboard/.custom/koreader/./libs/libcrengine.so
No symbol table info available.
#3  0x2bdffb64 in ?? () from ./libs/libkoreader-cre.so
No symbol table info available.
#4  0x000456ac in ?? ()
No symbol table info available.
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

@Markismus
Copy link
Member Author

@Markismus Markismus commented Feb 29, 2016

I just found a new way to generate a segfault. When I enable usb with KSM (not USBnet), copy a file to the ereader, sync on PC, opening it in koreader gives an error, closing to KSM, starting koreader gives a segfault. I really like segmentation faults, no idea how to resolve them, though!

@NiLuJe
Copy link
Member

@NiLuJe NiLuJe commented Mar 1, 2016

I'll hopefully be able to fire up a debug build once I manage to get the buildsystem changes to behave in my own env (with a bit of luck, base#387 should do the trick) ;).

Not familiar with how KSM handles USBMS, but I'm just going to assume it's doing something wrong and horribleness ensue. Not that that should necessarily cause KOReader to crash, but, still ;p.
See if you can reproduce that when doing the USBMS step from nickel, after a fresh reboot... But then you can't run KSM without rebooting once again. Aaaaaaarrrrgh. >_<".

@NiLuJe
Copy link
Member

@NiLuJe NiLuJe commented Mar 3, 2016

If anyone can reproduce on >= 214, fire away.

Personally, my crengine build segfaults right on book opening and completely trashes the stack, so gdb is useless.
Swapping simply libcrengine.so with the one from the buildbot lets me turn a couple of pages before it implodes (w/ the same backtrace as my previous comment).

Don't have enough Lua crap on my host to see if the emulator behaves the same way.

@houqp
Copy link
Member

@houqp houqp commented Mar 3, 2016

@Markismus I think your system probably got into a read-only state. At least that what happened to me last time. I connected to usb, synced a file, forgot to turn it off and opened koreader with a crash. When I poked around with usbnet, I found the /mnt was mounted as ro. A reboot got everything back into a good state.

Are you still experience the issue after reboot?

@Markismus
Copy link
Member Author

@Markismus Markismus commented Mar 5, 2016

Nope, but it kind of defeats the purpose. It seemed a fast way to get an ebook in koreader: enable usb, sideload a book, disable usb and open it in filemanager.

If you're right, I would only need a trigger or a button to remount the SDcard rw.I had hoped that I would be able to get rid of all read-only mountings by putting a 64GB SDcard in the internal slot! Too bad.

@houqp
Copy link
Member

@houqp houqp commented Mar 5, 2016

@Markismus for me, it's not the SDcard got mounted as RO, but the whole kobo filesystem. If you unplug and disable usb before opening koreader, then it should be fine since i do it all the time.

It's a pain in the ass to load files into KOReader on kobo right now. I am hoping to work on the new network manager soon so everything can be transferred through wifi without any plugging/unplugging ;)

@Markismus
Copy link
Member Author

@Markismus Markismus commented Mar 5, 2016

Wouldn't USBnet be a nice solution? I plug koreader in, open the ftp directory, copy, close directory, unplug, done. I just wonder whether the file is actually synced to disk in my ereader and whether I can force that.

@houqp
Copy link
Member

@houqp houqp commented Mar 5, 2016

It's a improvement, but you still need to plug the device in, which is an extra step. I am lazy, I just want to click a button on my phone or PC and have the book ready in my ereader ;)

@Markismus
Copy link
Member Author

@Markismus Markismus commented Mar 6, 2016

@chrox Wouldn't this be possible with zsync? Install a koreader version on your PC and export a book? I never did get that to work between my Glo and AuraH2O, though.

@houqp Shouldn't the builld-in ftp-server also work over WiFi? And what about Calibre for publishing your ebooks. I thought I heard something about that way back.

@KenMaltby
Copy link

@KenMaltby KenMaltby commented Mar 6, 2016

I just use KSM's USBMS implementation (the not USBnet) and drag&drop in my Win7 PC. Doing it there lets me use the PC's capabilities to edit file names and work on my device's file system.

I have used calibre's Content Server and KOReader's OPDS function to wirelessly add books to my devices, not exactly a "one button click", but not too hard. I haven't made much use of the other wireless connection between calibre and KOReader, but I have tested it out and it works.

@houqp
Copy link
Member

@houqp houqp commented Mar 6, 2016

@Markismus the problem right now is it's not easy to manage wifi in kobo. Once you put the device online, there are many ways to transfer the files over. zsync requires another running koreader instance, which is a little bit heavy, we can definitely write a thin client to do the work though. Like @KenMaltby said, there are many other solutions out there. I believe the difference between 3 clicks and 1 click is huge in terms of user experience, and the latter is definitely what we should aim to achieve in the long term.

Anyway, back to the topic, is this still an issue in the latest build?

@houqp houqp added this to the next stable release milestone Mar 8, 2016
@Markismus
Copy link
Member Author

@Markismus Markismus commented Mar 12, 2016

@houpq OTA-update consistently gave an error message, so it took me a while before I had time to test.

On version v2015.11-175-g7b11491 it still generates a segmentation fault. A full log is here.

@Markismus
Copy link
Member Author

@Markismus Markismus commented Mar 13, 2016

Yes, it works on 251-g511147a! Thanks!

@Markismus Markismus closed this Mar 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants