Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
Kodi GIT library cleaning freeze/lockup when playing nfs video
#1
I'm not sure if this is Linux-specific or OS independent so I'm posting here in hopes a non-Linux user can test and report back.

So someone was watching a tv show when I accidentally sent a `kodi-send.py --action='CleanLibrary(video)'`. The library cleaning pop-up window appeared to a very displeased audience. I said, `oops my bad, just cancel it` but rather that selecting the cancel button in the popup, the "stop" button on the remote was pressed. The video stopped, along with the library cleaning, and kodi itself. Kodi had to unceremoniously be restarted while I hung my head in shame.

So, to reproduce... Start playing your favorite tv show, movie, or home video. Send a kodi-send.py --action='CleanLibrary(video)' command, probably via ssh like I do. Lastly, press the "stop" button on your remote control. You should now have a frozen Kodi. If not, then god is punishing me.

No, I didn't get the log because the WAF was decreasing too quickly and the priority was get Kodi back up. But yes, I can reproduce this and copy the log later when the tv is not in use if it's deemed necessary. For the record, I'm running self-compiled git (19.0-ALPHA1-git+97fe0eba17 amd64) on Debian Sid Linux, on an Intel NUC, with media served via nfs on a gigabit lan, and it's currently 81°F right now and I'm eating BBQ pork ribs, trying not to get sauce on the keyboard. Questions are welcome, complaints may be directs towards the nearest trash bin as this has caused me enough suffering already.

Thanks!
Reply
#2
I can at least reproduce that issue while using Ubuntu 18.04.

It would be nice if you could open an issue at: https://github.com/xbmc/xbmc/issues

So it won't get forgotten.

Thanks
Reply
#3
I debugged it a bit more and found out that Kodi will not crash if:

- clean video library and music playback
- clean music library and video playback
- clean music library and music playback

So, I would probably not call it a fix, but at least that prevents Kodi from cleaning the video library by using kodi-send -a "CleanLibrary(video)" during video playback:

https://github.com/DaVukovic/xbmc/commit...a17923e468
Reply
#4
DaVu, thanks for having a quick look at this and writing a solution to prevent it from happening. Blocking actions that result in a crash/freeze/lockup is better than not addressing them at all! I forgot that library cleaning is done in the main loop rather than its' own thread so the potential for problems there is baked in. I'm not sure what logic that design decision was based on but as I understand things, that won't be addressed in the foreseeable future. So, if the best we can hope for is band-aids then so be it - whatever helps keep the WAF at reasonable levels. Wink
Reply
#5
I PRd it. I don't think it will be accepted because it doesn't fix the root cause (hence I said it's not a fix...that's more a workaround). But that's something for one of our core-devs which I'm not. Wink

Let's see what happens. But if you are able to compile Kodi from source, then feel free to use this patch as it doesn't hurt anything imprtant AFAICT.
Reply
#6
It might have a better change of being accepted if the text was added to strings.po for translation.
Reply
#7
True.Will change that.
Reply
#8
Hopefully it will be merged considering the root issue likely won't be addressed. Although it may be more of a workaround than a fix, it prevents a known reproducible condition that results in a completely lockedup up Kodi. Something to address that is better than nothing. Generally it seems like the more stable Kodi is for the users, the better for everyone. I've already applied the patch and recompiled here but I don't know how many of the millions of Kodi users have that as an option. Whatever the result of the PR, the quick fix is greatly appreciated!
Reply
#9
@teriyaki 

I forced pushed some changes to that PR and did the changes @MrTarantula suggested. It will work for you as it was, but in case your native language isn't english and you want to see that translated, I would suggest to use the update.

I'm not sure how many users will trigger a "stop video" during a video library cleanup Wink. I could imagine that this bug exists since a VERY long time and noone ever noticed it.  So not really sure how much we might need this PR. I'm glad if it will be accepted and if not, then you have at least something to work with Wink.
Reply
#10
I'm a native English speaker but will replace my local patch with the updated version.  I agree that it's uncommon for someone to trigger a library clean and then a `stop video`, but I managed to do it completely by accident. Another thing to consider too is that typically the vast majority of users don't participate in forums or mailing lists. For example, I hung out in a group of about 50 people who all used the same software.  Collectively we were constantly running into bugs/problems but I was the only one who took the initiative and engaged the community & developers to get things fixed. Everyone else basically would just deal with it via restarts. Kodi has millions & millions of users so even though things like this may be uncommon, I'd bet it has happened to a lot more than just me, just the other day. I dunno how many people are registered here, and of those, how many are active but it's got to be just a tiny sliver of the Kodi user base.
Reply
#11
I've been having this problem without knowing it. In my setup when videos are automatically added to my NAS a Kodi video database update is triggered. I have the clean database on library update option turned on in advanced settings, so I have automatic library updates and cleans happening when I watch videos without user intervention. I've been getting crashes during library updates from time to time without knowing why, usually when I pause or stop. 

If a clean library is a blocking action, cleanonupdate in advancedsettings.xml and any automated library update addon, timer or external service is likely to cause problems for many users.
Reply
#12
Normally (at least from I know) the crash shouldn't be triggered while pausing a video. Only if you perform a library cleanup and stop a currently playing video at the same time the cleanup happens.

But I have to admit that I haven't thought about the "cleanonupdate" option the advancedsettings.xml provides. So my suggestion above might also avoid using that function which would be a bad idea. I'm currently re-building and see what happens.

I'm also not too sure how "cleanonupdate" works. Will have to look for that as well. As it might be important to know if both tasks are somewhat ran at the same time or if a library update is done first and if that has finished a library clean is triggered. But I'll see. Thanks for that pointer
Reply
#13
I don't know for sure that I'm having the same crash, I'm just noticing crashes during library updates but it mostly seems to happen when I'm not paying that much attention, especially since my updates are automated. There's never anything in the kodi.log. If it happens again I'll try and grab the crash dumps. Considering how much happens during that process, it might be a scraper or add-on and have nothing to do with what you're looking into so... I also came across this issue which is also about crashes during library updates but not related to stopping video.

With the cleanonupdate setting, the clean library happens after the update. If that option is part of the issue I'd update the wiki but I don't seem to be able to. I find that option useful since I try as much as possible to have a hands-off setup and never have to do any manual library management.
Reply

Logout Mark Read Team Forum Stats Members Help
Kodi GIT library cleaning freeze/lockup when playing nfs video0