Deadlock during start/end of playback
#1
Hello,

There seems to be some kind of deadlock problem with multipart RAR archives. With library mode the UI doesn't freeze until you press stop, from the videos view the UI freezes instantly. I've provided a log file and a sample.

Log: http://minus.com/dcOSOEO2y2lt5.log
Sample: http://minus.com/db1WYNqyXKbTXu.zip
(Album in case direct links do not work: http://minus.com/mLvDy4kCt)

Notes about the log file:
It doesn't freeze always so I had to run the video a few times.
Not the cleanest one, but you can spot the problem, eg:
22:07:29 T:5348 ERROR: XFILE::CFileRar::Seek - Timeout waiting for buffer to empty

Notes about the sample:
As said, the problem is with multipart rar archives. I zipped it once, please unzip Videos.zip first, so you'll get many 2-0_Ronaldo.r* files. To reproduce, just try to play the archive multiple times again and again. (Took me 5 times? Bigger multipart files seem to be more problematic I think.)

Also, this bug appeared somewhere between July 3rd and August 3rd. Plus here's the callstack of cdvdplayer:
Code:
    ntdll.dll!76f0f8c1()     
    [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]    
    ntdll.dll!76f0f8c1()     
    KernelBase.dll!74de0a91()     
    kernel32.dll!74651194()     
    XBMC.exe!FairMonitor::Wait(unsigned long dwMillisecondsTimeout=4294967295, int bAlertable=0)  Line 141 + 0x12 bytes    C++
    XBMC.exe!XbmcThreads::ConditionVariable::wait(CCriticalSection & lock={...})  Line 124    C++
    XBMC.exe!XbmcThreads::TightConditionVariable<CEvent * &>::wait<CCriticalSection>(CCriticalSection & lock={...})  Line 50 + 0x25 bytes    C++
    XBMC.exe!XbmcThreads::CEventGroup::wait(unsigned int milliseconds=4294967295)  Line 131    C++
    XBMC.exe!XbmcThreads::CEventGroup::wait()  Line 92    C++
    XBMC.exe!CThread::AbortableWait(CEvent & event={...})  Line 105 + 0xb bytes    C++
>    XBMC.exe!XFILE::CFileRarExtractThread::~CFileRarExtractThread()  Line 58    C++
    XBMC.exe!XFILE::CFileRarExtractThread::`scalar deleting destructor'()  + 0x14 bytes    C++
    XBMC.exe!XFILE::CFileRar::OpenInArchive()  Line 675 + 0x38 bytes    C++
    XBMC.exe!XFILE::CFileRar::Seek(__int64 iFilePosition=5477, int iWhence=0)  Line 422 + 0x8 bytes    C++
    XBMC.exe!XFILE::CFile::Seek(__int64 iFilePosition=5477, int iWhence=0)  Line 522 + 0x21 bytes    C++
    XBMC.exe!CDVDInputStreamFile::Seek(__int64 offset=5477, int whence=0)  Line 107 + 0x1a bytes    C++
    XBMC.exe!dvd_file_seek(void * h=0x11932ea0, __int64 pos=5477, int whence=0)  Line 202    C++
    avformat-52.dll!64950248()     
    avformat-52.dll!6496621f()     
    avformat-52.dll!649aafa0()     
    XBMC.exe!DllAvFormat::av_open_input_stream(AVFormatContext * * p1=0x11859204, ByteIOContext * p2=0x065b1c80, const char * p3=0x113141d8, AVInputFormat * p4=0x649c3660, AVFormatParameters * p5=0x00000000)  Line 235 + 0x3b bytes    C++
    XBMC.exe!CDVDDemuxFFmpeg::Open(CDVDInputStream * pInput=0x11932ea0)  Line 426 + 0x37 bytes    C++
    XBMC.exe!CDVDFactoryDemuxer::CreateDemuxer(CDVDInputStream * pInputStream=0x11932ea0)  Line 66 + 0x13 bytes    C++
    XBMC.exe!CDVDPlayer::OpenDemuxStream()  Line 532 + 0xf bytes    C++
    XBMC.exe!CDVDPlayer::Process()  Line 910 + 0xb bytes    C++
    XBMC.exe!CThread::staticThread(void * * data=0x05ea0048)  Line 178    C++
    XBMC.exe!_callthreadstartex()  Line 314 + 0xf bytes    C
    XBMC.exe!_threadstartex(void * ptd=0x112bee20)  Line 297    C
    kernel32.dll!7465339a()     
    ntdll.dll!76f29ed2()     
    ntdll.dll!76f29ea5()
Reply
#2
No one else uses multipart RARs? Or am I the only one with the problem? That seems weird, because the problem appears every day I watch something.
Reply
#3
Jani, I think I have a fix for this if you're willing to try it. If so, please take this:

https://github.com/jimfcarroll/xbmc/tree...onitor-fix

Thanks. Let me know if that fixes your problem.
Reply
#4
jfcarroll Wrote:Jani, I think I have a fix for this if you're willing to try it. If so, please take this:

https://github.com/jimfcarroll/xbmc/tree...onitor-fix

Thanks. Let me know if that fixes your problem.
I finally managed to compile the installer after numerous problems with the libraries build with mingw. Despite those problems, it's working almost perfect now, thanks a lot!

I still managed to confuse it tho. Furiously pressing stop and play many times, the GUI froze for like 30s, but continued working after. Then after another 30s, the video started playing. Nothing like before where I could press stop and the whole program wouldn't quit without force killing it. I couldn't reproduce this under debugger, because it runs too slow. Anyway, I'm very happy with the current condition and I would consider it fixed, because the temporary freezing seems like another issue.

I'll be reporting here if I have any problems in "production," ie. my own usage Smile
Reply
#5
Thanks. This will be in shortly:

436 (PR)
Reply
#6
That reminds me, I also observed these weird pauses from time to time before xbmc would start playback. I don't have rars.
Sometimes it also happened while browsing through the library.
I think I saw it with the fairmonitor as well but less.
Always read the Kodi online-manual, the FAQ and search the forum before posting.
Do not e-mail Kodi Team members directly asking for support. Read/follow the forum rules (wiki).
For troubleshooting and bug reporting please make sure you read this first.
Reply
#7
Just an FYI: the PR is now merged.
Reply

Logout Mark Read Team Forum Stats Members Help
Deadlock during start/end of playback0