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

Rapidly playing Youtube videos results in crash #15688

Open
1 of 7 tasks
candrews opened this issue Mar 6, 2019 · 3 comments · Fixed by #6296
Open
1 of 7 tasks

Rapidly playing Youtube videos results in crash #15688

candrews opened this issue Mar 6, 2019 · 3 comments · Fixed by #6296
Labels
Component: Add-ons Triage: Confirmed issue has been reproduced by a team member v18 Leia

Comments

@candrews
Copy link
Contributor

candrews commented Mar 6, 2019

Bug report

Use a remote like Kore or Yatse to play a Youtube video. While the blue spinner is still displayed in Kodi, use the remote to tell another video to play.
Kodi will then crash.

Describe the bug

Here is a clear and concise description of what the problem is:

  • Use Yatse to play a Youtube video
  • While Kodi is displaying the spinner, use Yatse to play another Youtube video

If the Yatse addon from https://yatse.tv/wiki/yatse-kodi-addon is installed, the issue is easier to reproduce. I believe that's because the spinner is displayed for longer.

The spinner seems to have to be spinning to get the crash to happen.

Expected Behavior

Here is a clear and concise description of what was expected to happen:

Kodi shouldn't crash :)

Actual Behavior

Kodi crashes.

Possible Fix

To Reproduce

Steps to reproduce the behavior:

  1. Use Yatse to play a Youtube video
  2. While Kodi is displaying the spinner, use Yatse to play another Youtube video

Debuglog

The debuglog can be found here:
Crash log (including debug log): https://paste.kodi.tv/leqexikeho.kodi

Screenshots

Here are some links or screenshots to help explain the problem:

n/a

Additional context or screenshots (if appropriate)

Here is some additional context or explanation that might help:

n/a

Your Environment

Used Operating system:

  • Android

  • iOS

  • Linux

  • OSX

  • Raspberry-Pi

  • Windows

  • Windows UWP

  • Operating system version/name: Gentoo Linux

  • Kodi version: master, commit 1a261cf

note: Once the issue is made we require you to update it with new information or Kodi versions should that be required.
Team Kodi will consider your problem report however, we will not make any promises the problem will be solved.

@enen92 enen92 added Component: Add-ons Triage: Confirmed issue has been reproduced by a team member v18 Leia labels Apr 12, 2019
@candrews
Copy link
Contributor Author

candrews commented Oct 4, 2019

I ran Kodi in gdb, here's a full backtrace: https://pastebin.com/0NVvM9VM

#7  0x0000555556a27dea in XFILE::CPluginDirectory::WaitOnScriptResult(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool) (this=0x7fffffffa800, scriptPath=..., scriptId=0x10, scriptName="YouTube", retrievingDir=<optimized out>) at /usr/src/debug/media-tv/kodi-9999/kodi-9999/xbmc/filesystem/PluginDirectory.cpp:515
        scriptObs = {<CThread> = {_vptr.CThread = 0x555556f92e68 <vtable for XFILE::CPluginDirectory::CScriptObserver+16>, m_bStop = {_M_base = {static _S_alignment = 0x1, _M_i = 0x0}}, m_bAutoDelete = 0x0, m_StopEvent = {manualReset = 0x1, signaled = 0x0, numWaits = 0x1, groupListMutex = {<XbmcThreads::CountingLockable<XbmcThreads::CRecursiveMutex>> = {mutex = {m_mutex = {__data = {__lock = 0x0, __count = 0x0, __owner = 0x0, __nusers = 0x0, __kind = 0x21, __spins = 0x0, __elision = 0x0, __list = {__prev = 0x0, __next = 0x0}}, __size = '\000' <repeats 16 times>, "!", '\000' <repeats 22 times>, __align = 0x0}}, count = 0x0}, <No data fields>}, groups = std::unique_ptr<class std::vector<XbmcThreads::CEventGroup*, std::allocator<XbmcThreads::CEventGroup*> >> = {get() = 0x0}, actualCv = {cond = {_M_cond = {_M_cond = {__data = {{__wseq = 0x16, __wseq32 = {__low = 0x16, __high = 0x0}}, {__g1_start = 0x0, __g1_start32 = {__low = 0x0, __high = 0x0}}, __g_refs = {0x2, 0x0}, __g_size = {0xfffffff6, 0x0}, __g1_orig_size = 0x0, __wrefs = 0x8, __g_signals = {0x0, 0x0}}, __size = "\026", '\000' <repeats 15 times>, "\002\000\000\000\000\000\000\000\366\377\377\377\000\000\000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000", __align = 0x16}}, _M_mutex = std::shared_ptr<class std::mutex> (use count 2, weak count 0) = {get() = 0x555559c96b50}}}, condVar = {cond = @0x7fffffff9e80, predicate = @0x7fffffff9e41}, mutex = {<XbmcThreads::CountingLockable<XbmcThreads::CRecursiveMutex>> = {mutex = {m_mutex = {__data = {__lock = 0x0, __count = 0x0, __owner = 0x0, __nusers = 0x0, __kind = 0x21, __spins = 0x0, __elision = 0x0, __list = {__prev = 0x0, __next = 0x0}}, __size = '\000' <repeats 16 times>, "!", '\000' <repeats 22 times>, __align = 0x0}}, count = 0x0}, <No data fields>}}, m_StartEvent = {manualReset = 0x1, signaled = 0x1, numWaits = 0x0, groupListMutex = {<XbmcThreads::CountingLockable<XbmcThreads::CRecursiveMutex>> = {mutex = {m_mutex = {__data = {__lock = 0x0, __count = 0x0, __owner = 0x0, __nusers = 0x0, __kind = 0x21, __spins = 0x0, __elision = 0x0, __list = {__prev = 0x0, __next = 0x0}}, __size = '\000' <repeats 16 times>, "!", '\000' <repeats 22 times>, __align = 0x0}}, count = 0x0}, <No data fields>}, groups = std::unique_ptr<class std::vector<XbmcThreads::CEventGroup*, std::allocator<XbmcThreads::CEventGroup*> >> = {get() = 0x0}, actualCv = {cond = {_M_cond = {_M_cond = {__data = {{__wseq = 0x3, __wseq32 = {__low = 0x3, __high = 0x0}}, {__g1_start = 0x1, __g1_start32 = {__low = 0x1, __high = 0x0}}, __g_refs = {0x0, 0x0}, __g_size = {0x0, 0x0}, __g1_orig_size = 0x4, __wrefs = 0x0, __g_signals = {0x0, 0x0}}, __size = "\003\000\000\000\000\000\000\000\001", '\000' <repeats 23 times>, "\004", '\000' <repeats 14 times>, __align = 0x3}}, _M_mutex = std::shared_ptr<class std::mutex> (use count 1, weak count 0) = {get() = 0x555559dad2c0}}}, condVar = {cond = @0x7fffffff9f40, predicate = @0x7fffffff9f01}, mutex = {<XbmcThreads::CountingLockable<XbmcThreads::CRecursiveMutex>> = {mutex = {m_mutex = {__data = {__lock = 0x0, __count = 0x0, __owner = 0x0, __nusers = 0x0, __kind = 0x21, __spins = 0x0, __elision = 0x0, __list = {__prev = 0x0, __next = 0x0}}, __size = '\000' <repeats 16 times>, "!", '\000' <repeats 22 times>, __align = 0x0}}, count = 0x0}, <No data fields>}}, m_CriticalSection = {<XbmcThreads::CountingLockable<XbmcThreads::CRecursiveMutex>> = {mutex = {m_mutex = {__data = {__lock = 0x0, __count = 0x0, __owner = 0x0, __nusers = 0x0, __kind = 0x21, __spins = 0x0, __elision = 0x0, __list = {__prev = 0x0, __next = 0x0}}, __size = '\000' <repeats 16 times>, "!", '\000' <repeats 22 times>, __align = 0x0}}, count = 0x0}, <No data fields>}, m_pRunnable = 0x0, m_iLastUsage = 0x0, m_iLastTime = 0x40e6d670, m_fLastUsage = 0, m_ThreadName = "scriptobs", m_thread = 0x555559da3a60, m_future = {<std::__basic_future<bool>> = {<std::__future_base> = {<No data fields>}, _M_state = std::shared_ptr<class std::__future_base::_State_baseV2> (use count 2, weak count 0) = {get() = 0x555558d33560}}, <No data fields>}, m_lwpId = 0xbd9e9}, m_scriptId = 0x10, m_event = @0x7fffffffa860}
        progress = <optimized out>
        wm = Python Exception <class 'IndexError'> list index out of range: 
Python Exception <class 'ValueError'> Cannot find type class std::__cxx11::list<std::pair<CGUIMessage*, int>, std::allocator<std::pair<CGUIMessage*, int> > >::_Node: 
@0x5555571471d0: {<KODI::MESSAGING::IMessageTarget> = {_vptr.IMessageTarget = 0x555556f35af8 <vtable for CGUIWindowManager+16>}, m_mapWindows = std::unordered_map with 126 elements, m_vecCustomWindows = std::vector of length 8, capacity 8 = {0x55555894b730, 0x55555894bbe0, 0x55555894e6e0, 0x555558950510, 0x55555894eb00, 0x55555894ef20, 0x5555589538b0, 0x55555895b800}, m_activeDialogs = std::vector of length 1, capacity 2 = {0x555557766140}, m_deleteWindows = std::vector of length 0, capacity 1, m_windowHistory = std::deque with 1 element = {0x2710}, m_pCallback = 0x555557035e10, m_vecThreadMessages = empty std::__cxx11::list, m_critSection = {<XbmcThreads::CountingLockable<XbmcThreads::CRecursiveMutex>> = {mutex = {m_mutex = {__data = {__lock = 0x0, __count = 0x0, __owner = 0x0, __nusers = 0x0, __kind = 0x21, __spins = 0x0, __elision = 0x0, __list = {__prev = 0x0, __next = 0x0}}, __size = '\000' <repeats 16 times>, "!", '\000' <repeats 22 times>, __align = 0x0}}, count = 0x0}, <No data fields>}, m_vecMsgTargets = std::vector of length 4, capacity 4 = {0x555557035e30, 0x5555570d76f0, 0x555557037bf0, 0x5555575a7748}, m_iNested = 0x1, m_initialized = 0x1, m_touchGestureActive = 0x0, m_inhibitTouchGestureEvents = 0x0, m_dirtyregions = std::vector of length 4, capacity 1024 = {{<CRectGen<float>> = {x1 = -79.9999237, y1 = -216, x2 = 4224, y2 = 2376}, m_age = 0x0}, {<CRectGen<float>> = {x1 = 1831.98279, y1 = 991.98291, x2 = 2008.01721, y2 = 1168.01709}, m_age = 0x0}, {<CRectGen<float>> = {x1 = 1864.98938, y1 = 1024.98926, x2 = 1975.01086, y2 = 1135.01074}, m_age = 0x0}, {<CRectGen<float>> = {x1 = 1831.98279, y1 = 991.98291, x2 = 2008.01721, y2 = 1168.01709}, m_age = 0x0}}, m_tracker = {m_markedRegions = std::vector of length 7, capacity 1024 = {{<CRectGen<float>> = {x1 = -79.9999237, y1 = -216, x2 = 4224, y2 = 2376}, m_age = 0x2}, {<CRectGen<float>> = {x1 = 1840, y1 = 1000, x2 = 1999.99988, y2 = 1160}, m_age = 0x2}, {<CRectGen<float>> = {x1 = 1870, y1 = 1030.00012, x2 = 1969.99988, y2 = 1130}, m_age = 0x2}, {<CRectGen<float>> = {x1 = -79.9999237, y1 = -216, x2 = 4224, y2 = 2376}, m_age = 0x1}, {<CRectGen<float>> = {x1 = 1831.98279, y1 = 991.98291, x2 = 2008.01721, y2 = 1168.01709}, m_age = 0x1}, {<CRectGen<float>> = {x1 = 1864.98938, y1 = 1024.98926, x2 = 1975.01086, y2 = 1135.01074}, m_age = 0x1}, {<CRectGen<float>> = {x1 = 1831.98279, y1 = 991.98291, x2 = 2008.01721, y2 = 1168.01709}, m_age = 0x1}}, m_buffering = 0x3, m_solver = 0x5555575a02b0}}
        __FUNCTION__ = "WaitOnScriptResult"
#8  0x0000555556a2b337 in XFILE::CPluginDirectory::StartScript(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, bool) (this=<optimized out>, strPath=..., retrievingDir=<optimized out>, resume=<optimized out>) at /usr/src/debug/media-tv/kodi-9999/kodi-9999/xbmc/filesystem/PluginDirectory.cpp:173
        scriptName = "YouTube"
        url = Python Exception <class 'ValueError'> Cannot find type CUrlOptions::UrlOptions::_Rep_type: 
Python Exception <class 'ValueError'> Cannot find type CUrlOptions::UrlOptions::_Rep_type: 
{_vptr.CURL = 0x555556f3c2e8 <vtable for CURL+16>, m_iPort = 0x0, m_strHostName = "plugin.video.youtube", m_strShareName = "uri2addon", m_strDomain = "", m_strUserName = "", m_strPassword = "", m_strFileName = "uri2addon/", m_strProtocol = "plugin", m_strFileType = "", m_strOptions = "", m_strProtocolOptions = "", m_options = {_vptr.CUrlOptions = 0x555556f32ca0 <vtable for CUrlOptions+16>, m_options = std::map with 0 elements, m_strLead = ""}, m_protocolOptions = {_vptr.CUrlOptions = 0x555556f32ca0 <vtable for CUrlOptions+16>, m_options = std::map with 0 elements, m_strLead = ""}}
        options = "?uri=https://youtu.be/FttJh-FCG7k"
        basePath = "plugin://plugin.video.youtube/uri2addon/"
        handle = <optimized out>
        strHandle = "2"
        argv = std::vector of length 4, capacity 4 = {"plugin://plugin.video.youtube/uri2addon/", "2", "?uri=https://youtu.be/FttJh-FCG7k", "resume:false"}
        strResume = "resume:false"
        __FUNCTION__ = "StartScript"
        success = 0x0
        file = "/home/mythtv/.kodi/addons/plugin.video.youtube/resources/lib/default.py"
        reuseLanguageInvoker = 0x1
        id = 0x10

@candrews
Copy link
Contributor Author

candrews commented Oct 4, 2019

The crash is at

throw std::logic_error("busy dialog already running");

which is called at
else if (!CGUIDialogBusy::WaitOnEvent(m_fetchComplete, 200))

is g_application.IsCurrentThread() returning true when it should be false?

@jmbreuer
Copy link
Contributor

I regularly run into this, too / still - typical use case: One YouTube video is coming to an end, I share the next one to watch from my phone via Yatse. There is a race condition that when this "crosses paths" with the original video naturally ending and there's a next item in the playlist, i.e. a loading spinner is popping up, Kodi will crash.

(Kodi 19.0 with YouTube 6.8.10+matrix.1 / LibreELEC 9.95.1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Add-ons Triage: Confirmed issue has been reproduced by a team member v18 Leia
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants