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

[PVR] Guide window: Prevent concurrent updates. #14242

Merged
merged 2 commits into from Jul 30, 2018

Conversation

@ksooo
Copy link
Member

commented Jul 29, 2018

Fixes a crash while fast switching channel groups in the guide window.

Thread 1 (Thread 0x7f235bc958c0 (LWP 1382)):
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007f235823140c in __GI_abort () at abort.c:79
#2  0x00007f2357f14723 in ?? () from /usr/lib/libstdc++.so.6
#3  0x00007f2357f1a766 in ?? () from /usr/lib/libstdc++.so.6
#4  0x00007f2357f1a7a1 in std::terminate() () from /usr/lib/libstdc++.so.6
#5  0x00007f2357f1a9d3 in __cxa_throw () from /usr/lib/libstdc++.so.6
#6  0x00000000009cac64 in CGUIDialogBusy::WaitOnEvent(CEvent&, unsigned int, bool) ()
#7  0x0000000000b1993a in PVR::CGUIWindowPVRGuideBase::GetDirectory(std::string const&, CFileItemList&) ()
#8  0x00000000008eb53c in CGUIMediaWindow::Update(std::string const&, bool) ()
#9  0x0000000000b1a38a in PVR::CGUIWindowPVRBase::Update(std::string const&, bool) ()
#10 0x0000000000b1a421 in PVR::CGUIWindowPVRGuideBase::Update(std::string const&, bool) ()
#11 0x00000000008c640b in CGUIMediaWindow::Refresh(bool) ()
#12 0x0000000000b285dc in PVR::CGUIWindowPVRGuideBase::OnMessage(CGUIMessage&) ()
#13 0x00000000009c633d in CGUIWindowManager::SendMessage(CGUIMessage&) ()
#14 0x00000000009cde89 in CGUIWindowManager::OnApplicationMessage(KODI::MESSAGING::ThreadMessage*) ()
#15 0x000000000091675d in KODI::MESSAGING::CApplicationMessenger::ProcessMessage(KODI::MESSAGING::ThreadMessage*) ()
#16 0x0000000000916803 in KODI::MESSAGING::CApplicationMessenger::ProcessWindowMessages() ()
#17 0x0000000000a74960 in CApplication::Process() ()
#18 0x00000000009ad13e in CGUIWindowManager::ProcessRenderLoop(bool) ()
#19 0x00000000009cacaa in CGUIDialogBusy::WaitOnEvent(CEvent&, unsigned int, bool) ()
#20 0x0000000000b1993a in PVR::CGUIWindowPVRGuideBase::GetDirectory(std::string const&, CFileItemList&) ()
#21 0x00000000008eb53c in CGUIMediaWindow::Update(std::string const&, bool) ()
#22 0x0000000000b1a38a in PVR::CGUIWindowPVRBase::Update(std::string const&, bool) ()
#23 0x0000000000b1a421 in PVR::CGUIWindowPVRGuideBase::Update(std::string const&, bool) ()
#24 0x0000000000b0ef70 in PVR::CGUIWindowPVRBase::SetChannelGroup(std::shared_ptr&&, bool) ()
#25 0x0000000000b1a9f6 in PVR::CGUIWindowPVRBase::OnAction(CAction const&) ()
#26 0x00000000009cd1c4 in CGUIWindowManager::HandleAction(CAction const&) const ()
#27 0x00000000009cd230 in CGUIWindowManager::OnAction(CAction const&) const ()
#28 0x0000000000a71865 in CApplication::OnAction(CAction const&) ()
#29 0x0000000000917a18 in CInputManager::HandleKey(CKey const&) ()
#30 0x0000000000918aa1 in CInputManager::ProcessPeripherals(float) ()
#31 0x0000000000918acf in CInputManager::Process(int, float) ()
#32 0x0000000000a73011 in CApplication::FrameMove(bool, bool) ()
#33 0x0000000000aa8669 in CXBApplicationEx::Run(CAppParamParser const&) ()
#34 0x00000000008ff1cf in XBMC_Run ()
#35 0x00000000006bccf2 in main ()

@FernetMenta mind taking a look?

@ksooo ksooo added this to the Leia 18.0-alpha3 milestone Jul 29, 2018

@ksooo ksooo requested a review from FernetMenta Jul 29, 2018

@ksooo ksooo force-pushed the ksooo:pvr-guidewindow-prevent-concurrent-update branch from 394cd15 to eaaf26f Jul 29, 2018

if (m_vecItemsUpdating)
{
// Prevent concurrent updates. Instead, let the timeline items refresh thread pick it up later.
CSingleLock lock(m_critSection);

This comment has been minimized.

Copy link
@FernetMenta

FernetMenta Jul 30, 2018

Member

why do you need the lock? m_bRefreshTimelineItems is atomic

This comment has been minimized.

Copy link
@ksooo

ksooo Jul 30, 2018

Author Member

Good point. Will have to check other places as well I guess.

@ksooo

This comment has been minimized.

Copy link
Member Author

commented Jul 30, 2018

@FernetMenta I added a second commit that removes unneeded locking before accessing std::atomic<bool> members.

@FernetMenta

This comment has been minimized.

Copy link
Member

commented Jul 30, 2018

looks good as far as I can tell

@ksooo

This comment has been minimized.

Copy link
Member Author

commented Jul 30, 2018

jenkins build this please

@ksooo ksooo merged commit 63df173 into xbmc:master Jul 30, 2018

1 check passed

default You're awesome. Have a cookie
Details

@ksooo ksooo deleted the ksooo:pvr-guidewindow-prevent-concurrent-update branch Jul 30, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.