v16 Repeatable crash when viewing Photos
#46
I believe I have run into this problem on both 16.0 and 16.1 RC2. At first I thought it was a file corruption issue because some of my image folders worked and some did not. In an attempt to limit the number of unknowns, I banged out a quick little python script for use in a bash loop to generate an arbitrary number of files. This is a very simple way to reproduce this issue without having to gather up a ton of images from somewhere.

Code:
#!/usr/bin/env python

import cairo
import math
from random import random, randint

import sys
import getopt

def main(argv):
    Width, Height = 7680, 4320

    surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, Width, Height)
    ctx = cairo.Context(surface)
    solidpattern = ctx.get_source()

    pat = cairo.LinearGradient (0.0, 0.0, 0, Height * random())
    pat.add_color_stop_rgba (1, 0, 0, 0, 1)
    pat.add_color_stop_rgba (0, randint(0,1), randint(0,1),
                             randint(0,1), randint(0,0))


    ctx.rectangle (0,0,Width,Height)
    ctx.set_source (pat)
    ctx.fill ()

    try:
        opts, args = getopt.getopt(argv, "o:")
    except getopt.GetoptError:
        sys.exit(2)

    for opt, arg in opts:
        if opt == '-o':
            filename = str(arg)
            surface.write_to_png(filename)

if __name__ == "__main__":

    main(sys.argv[1:])

Change height and width to whatever you want, or if you want a random size, use randint with a range.

Generating the actual images is straight forward with a for loop in bash.

example:
Code:
for n in {1..16000}; do sudo python genimage.py -o nanoka/test/testimage_$n.png; done

Using this method I was able to determine that the issue appears to be related to the number of files rather than the type or size. On my system, I was able to get these images to load without issue with < 10k images, but with 12k images or more, you are guaranteed to crash.

Sadly, the kodi log seems to be all over the place. It's pretty inconsistent in what information it displays. Sometimes it complains about being unable to resize buffers and throws an E_OUTOFMEMORY, other times I see "exception in CApplication::FrameMove()" along with a slew of messages that say my files are the wrong format (which is completely untrue).

For what it's worth, I've uploaded one of my debug logs here: http://xbmclogs.com/pngwzrwgw

System info:
Gigabyte BRIX GB-BXA8-5545
AMD Richland Processor A8-5545M 1.7G/ 2.7GHz
8GB DDR 3 1.3v memory
Freshly installed Windows 8.1 with all the latest windows updates performed (Although the win10 update has been banned)

Hopefully this is helpful. If a fix for this is unlikely to make it into 16.1, I will go ahead and revert back to 15.2 (hopefully the database is backward compatible).
Reply
#47
I'm no programmer, but I don't think this will be fixed in 16.1 since its version is already a release candidate.
Reply
#48
(2016-04-14, 11:23)willemd Wrote: I'm no programmer, but I don't think this will be fixed in 16.1 since its version is already a release candidate.

I wouldn't worry about that based on the label alone. They're not really RC's, since additional fixes were added between different RC's.
Reply
#49
well, no dev looked into it so far, and I doubt my limited debugging skill will suffice here (I also heavily lack time atm).
Reply
#50
Just my two cents.
All test made on Raspberry Pi 1 (512 model, actually 353 MiB of available RAM), with a directory of 1800 pictures.

With Kodi 15, accessing (opening) the directory (scraping options enabled, see the picture) takes few seconds and the RAM usage goes from 21% to 29% (peak) and then to 27%.
Image
Starting the random slide-show, the RAM usage increases to 33% and during the slide-show itself I can see peaks of about 37%, but it usually stay under 30%. Everything works as expected.

With Kodi 16, opening the directory kodi.bin crashes after consuming almost all the RAM. Aborting the "extrating meta-data" dialog, opens the directory, but when I start the slide-show the crash occurs anyway. So the slide-show never starts.

To test things further, I created a 512 MiB swap file, so when the RAM get filled, the system can free it by moving data in the swap file.
Opening the directory now works, but it takes a lot of time (obviously) and 150 → 200 MiB of swap memory.
Starting the slide-show still doesn't work: after filling all the swap memory, kodi.bin crashes again.

This means (AFAIK) that, given the same options, the very same operations on Jarvis takes 5x (or even more) the amount of memory that required on Isengard.


As a side note I would like to point out that everyone should be respectful, users and developers. It's hard to find a developer that spend his spare time to write software for free, but it's not quite common that users take their time to report an issue with completeness too (I'm not saying this because of me reporting my tests).

Everyone, have a good time. Smile
Reply
#51
Is https://github.com/xbmc/xbmc/commit/9b8b...5e2e3ae303 the fix for this problem? Nice!
Reply
#52
I don't think it fixes it, but certainly it will take more image files before memory is exhausted. I will install tomorrow's nightly and see how it performs.

scott s.
.
Reply
#53
Not sure if this problem has been looked at lately, but MrMC 2.3.0 on iOS fixes the crashing issue. I was able to do a set of folders with a slideshow and it no longer crashes MrMC, which before any version of Kodi or MrMC would crash on iOS doing the same set of folders. I hope this is still being investigated, being the Kodi versions before 16 didn't have this problem on the other non iOS platforms.
Reply
#54
Any update on this? or is there any discussion elsewhere?

I'm using Krypton on two machines with an external hard drive of over 160gb of photos.
One of the machines works fine, the other with Android is crashing.

I've been trying to increase my virtual RAM on my Android TV using apps such as roehsoft ram expander with no avail.

Perhaps someone can offer some suggestions?
I'm prepared to modify the code & build it just for myself to avoid loading any exif data whatsoever.
Reply
#55
I thought it was supposed to be fixed in Krypton nightlies, what build of Krypton are you on?
Reply
#56
(2016-06-23, 11:23)jjd-uk Wrote: I thought it was supposed to be fixed in Krypton nightlies, what build of Krypton are you on?

Android kodi-20160614-44b4163
Reply
#57
Hello, I just wanted to check if this was fixed?

I don't know if this related but I can crash Kodi with a single jpeg image. From my various tests some camera types generate jpeg that just won't work.

Thanks.
Reply
#58
I couldn't tell ya. Not been keeping tabs on this issue - though I would be keen to know if there has been any developments.
Best think you can do is post your crash log (if you know how to get it) at least then we can identify if you're experiencing the same issue
Reply
#59
Sorry, did not want to cross post, but while searching for this issue, I found this thread.

You can find my issue documented here: http://forum.kodi.tv/showthread.php?tid=287441

Log: https://paste.pound-python.org/show/CgaP...epq2XmJjP/

Example image that crash kodi (would love someone else to confirm): https://picload.org/image/rolpocra/dsc00168.jpg

Thanks a lot in advance.
Reply
#60
(2017-04-27, 03:03)mgouin Wrote: Sorry, did not want to cross post, but while searching for this issue, I found this thread.

You can find my issue documented here: http://forum.kodi.tv/showthread.php?tid=287441

Log: https://paste.pound-python.org/show/CgaP...epq2XmJjP/

Example image that crash kodi (would love someone else to confirm): https://picload.org/image/rolpocra/dsc00168.jpg

Thanks a lot in advance.

I downloaded your photo and dropped into my photo album. Via Kodi, I viewed my photos, arrived at your photo and continued on. No problems. No crash. But my folders are separated into years, so only have about 1000 at most in a folder. I put it in the largest folder. Also I have a decent powered HTPC
Reply

Logout Mark Read Team Forum Stats Members Help
Repeatable crash when viewing Photos0