mdeguzis / RetroRig

(discontinued) Repository for XBMC Retro gaming on x86_64 Linux systems
Other
74 stars 12 forks source link

XBMC hangs sometimes upon exit/start #45

Closed beaumanvienna closed 10 years ago

beaumanvienna commented 10 years ago

Last words from ~/.xbmc/temp/xbmc.log http://slexy.org/view/s20Yf2NDdL

at line 123: 13:27:15 T:139868193769408 NOTICE: unload skin and next line 13:27:15 T:139868193769408 WARNING: Cleanup: Having to cleanup texture colors/selected.png

Looks like it can't unload the skin.

beaumanvienna commented 10 years ago

I still have this bug, it's not very often, and it doesn't hang thereafter. I can reproduce it by switching between my two screens very often, most time it doesn't take more then three or four times, then it breaks.

I don't plan to release a new patch level for xbmc before my business trip next week. I'll take care of it when I'm back.

What about you? The hanging upon exit is fixed now, right? Does your play button break sometimes?

mdeguzis commented 10 years ago

It's intermittant for me as well. I just hope until I or you can find a fix, it won't turn off people from using the project. You did work around the exit hang, which is a huge* step forward. Let's allow this to just sit for a while. To be honest, I think we are near-ready to release the planned features into master.

https://github.com/ProfessorKaos64/RetroRig/wiki/Development-and-Features#nextup

beaumanvienna commented 10 years ago

I've reset my Ubuntu install to a plain Ubuntu install and installed the latest beta branch from https://github.com/ProfessorKaos64/RetroRig.

I'm picking up my work on tracking down the broken Play button now.

mdeguzis commented 10 years ago

Coincidently, that is what I just started to look at, but of course I don't have the Cpp expertise you have. In that sense, your help is again, highly invaluable. I merely check strace logs, system processes, internal programs logs and the like. If you join IRC today, we can chit chat. I need to set a banner in IRC to remind me about World UTC times :)

beaumanvienna commented 10 years ago

I did a fair amount of work today, even though suspending my other tasks took longer then anticipated.

This is what I got so far: http://slexy.org/view/s2D0TMAO6K

The first paragraph shows how it should look like. Here's a backtrace made when CApplication::OnMessage receives message 11: http://i.imgur.com/hDusX2L.jpg This corresponds to line 18 back to line line 12 in the slexy paste.

The second paragraph shows, that all the functions shown in the backtrace do not get called at all. It does not reach what would be line 12. So CApplicationMessenger::ProcessMessages is what I currently investigate. It's a loop that processes a queue of events. I got to find out which part of the program is putting events into this queue (or not putting in our case).

mdeguzis commented 10 years ago

Great work! I hope someday I can get better at cpp and following the backtraces. I feel dumb when sometimes doing cpp work. Thank you very much.

beaumanvienna commented 10 years ago

You must place a breack point at the right position, gdb will stop the program there. Maybe you noticed that CApplication::OnMessage is called with message id 20 before. So I inserted a small if statement that checks for 11 and allows me to set the right break point. ;-)

beaumanvienna commented 10 years ago

* Status Update *

For Science

One reason why XBMC does not launch the RCB Pyhton script, and why it is later on not able to terminate it, was an interference with a different python thread named service xbmc.versioncheck. In general, XBMC implements one Pyhton interpreter, that handles multiple threads. To perform an action on one of its threads, such as starting or stopping them, XBMC needs to get a global lock on the Pyhton interpreter. If this lock is not released by one of the python threads, all other threads will be blocked.

The actual hanging on exit occurred on PyEval_ReleaseLock. The broken play button was caused by PyEval_AcquireLock. (see https://github.com/python-git/python/blob/master/Include/ceval.h#L128 ff)

Next steps

To disable service xbmc.version in the settings, a file named ".retrorig/.xbmc/userdata/addon_data/service.xbmc.versioncheck/settings.xml" must created during install, which should look like this: http://slexy.org/view/s204jkv2uA A script to replace service xbmc.version by a dummy can be found in the dropbox or here: http://slexy.org/view/s20aQvNGmb.

After the above described steps have been taken, this issue needs to be observed for a while. I propose that we discuss the closure of this ticket when I'm back from my trip in two weeks.

mdeguzis commented 10 years ago

Hahaha I love For Science.

To disable service xbmc.version in the settings, a file named ".retrorig/.xbmc/userdata/addon_data/service.xbmc.versioncheck/settings.xml" must created during install, which should look like this: http://slexy.org/view/s204jkv2uA

This is already committed to beta, as of last night UTC -5 , my time. I will run the build script on my test machine, as it seems that is what you intended, not to make a new pkg at the moment and upload it.

beaumanvienna commented 10 years ago

I am currently working on patch level four. Found the icon bug :-D http://forum.xbmc.org/showthread.php?tid=199677

mdeguzis commented 10 years ago

Awesome!! I replied. I found this error of mine in that pl3b script:

[sudo] password for test: 
rm: cannot remove ‘xbmc-bin_Gotham_V13.1_patched_for_RetroRig.deb’: Permission denied
rm: cannot remove ‘xbmc-bin_Gotham_V13.1_patched_for_RetroRig_patchlevel_2.deb’: Permission denied
rm: cannot remove ‘xbmc-bin_Gotham_V13.1_patched_for_RetroRig_patchlevel_3.deb’: Permission denied
rm: cannot remove ‘xbmc-bin_original.deb’: Permission denied
dpkg-deb: building package `xbmc-bin' in `xbmc-bin_Gotham_V13.1_patched_for_RetroRig_patchlevel_3b.deb'.

I forgot sudo :) There are other corrections needed. I'll find them soon.

mdeguzis commented 10 years ago

Wait, why are we doing this when I disabled this in the addon via pre-placing the file? I will test my method, like I said yesterday, I'd like to avoid the dirty way of doing this if possible. Test out your method though, since it might be pertinent to have a backup solution to mine.

I just checked from a fresh install, Enable XBMC version check is off.

beaumanvienna commented 10 years ago

Don't do anything, I'm in final testing for pl4. Just started from scratch 1 minute ago. It will be all fine in beaumanviennas repro. You'll get the pull request soon.

About my dummy for xbmc.versioncheck, you can uncomment it after my pull request, ok?

mdeguzis commented 10 years ago

Could you hook on IRC just for a second? better than messages

mdeguzis commented 10 years ago

I think this can be confirmed squashed