question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Crash when changes happen to the queue

See original GitHub issue

Hi,

I’ve been trying to use Stylophone on windows but the app keeps on crashing whenever I try to skip a song, or modify a playlist in a way that removes items. I’ve build a debug version to investigate and here is what happens on my system:

  1. contrary to the comment at QueueViewModel.cs:209 plchanges does not necessarily give the full list of files. For instance when skipping on my system the response always contains a single song which is the newly playing song. The logic that follows is then invalid.
  2. The removal of the chosen songs then crashes the ui. I’m not sure what could be causing this crash since the list of song is still valid from an UI perspective.

Here is the stack of the crash:

 	KernelBase.dll!RaiseFailFastException()	Unknown
 	combase.dll!RoFailFastWithErrorContextInternal2(HRESULT hrError, unsigned long cStowedExceptions, _STOWED_EXCEPTION_INFORMATION_V2 * * aStowedExceptionPointers) Line 1468	C++
 	[Inline Frame] Windows.UI.Xaml.dll!std::vector<float,std::allocator<float>>::_Xrange() Line 1728	C++
 	Windows.UI.Xaml.dll!std::vector<float,std::allocator<float>>::at(const unsigned __int64 _Pos) Line 1494	C++
 	Windows.UI.Xaml.dll!DirectUI::Components::Moco::StackingLayoutStrategyImpl::RegisterSize(int index, bool isHeader, float newSize) Line 758	C++
 	Windows.UI.Xaml.dll!DirectUI::Components::Moco::StackingLayoutStrategyImpl::GetContainerBounds(int indexInItems, int containerDesiredSize, Windows::Foundation::Size referenceInformation, Windows::UI::Xaml::Controls::LayoutReference) Line 804	C++
 	Windows.UI.Xaml.dll!DirectUI::Components::Moco::StackingLayoutStrategyImpl::GetElementBounds(Windows::UI::Xaml::Controls::ElementType elementType, int elementIndex, Windows::Foundation::Size containerDesiredSize, Windows::UI::Xaml::Controls::LayoutReference referenceInformation, Windows::Foundation::Rect pReturnValue, Windows::Foundation::Rect *) Line 105	C++
 	Windows.UI.Xaml.dll!DirectUI::StackingLayoutStrategy::GetElementBoundsImpl(Windows::UI::Xaml::Controls::ElementType elementType, int elementIndex, Windows::Foundation::Size containerDesiredSize, Windows::UI::Xaml::Controls::LayoutReference referenceInformation, Windows::Foundation::Rect pReturnValue, Windows::Foundation::Rect *) Line 79	C++
 	Windows.UI.Xaml.dll!DirectUI::StackingLayoutStrategyGenerated::GetElementBounds(Windows::UI::Xaml::Controls::ElementType elementType, int elementIndex, Windows::Foundation::Size containerDesiredSize, Windows::UI::Xaml::Controls::LayoutReference referenceInformation, Windows::Foundation::Rect windowConstraint, Windows::Foundation::Rect * pResult) Line 177	C++
 	Windows.UI.Xaml.dll!DirectUI::ModernCollectionBasePanel::OnItemRemoved(int nIndex, bool itemRemovedForGroupReset) Line 1662	C++
 	Windows.UI.Xaml.dll!DirectUI::ModernCollectionBasePanel::NotifyOfItemsChangedImpl(Windows::Foundation::Collections::IVectorChangedEventArgs * e) Line 1251	C++
 	Windows.UI.Xaml.dll!DirectUI::ModernCollectionBasePanelGenerated::NotifyOfItemsChanged(Windows::Foundation::Collections::IVectorChangedEventArgs * pE) Line 915	C++
 	Windows.UI.Xaml.dll!DirectUI::ItemsControl::OnItemsChanged(Windows::Foundation::Collections::IVectorChangedEventArgs * pArgs) Line 1111	C++
 	Windows.UI.Xaml.dll!DirectUI::Selector::OnItemsChanged(Windows::Foundation::Collections::IVectorChangedEventArgs * e) Line 1375	C++
 	Windows.UI.Xaml.dll!DirectUI::ListViewBase::OnItemsChanged(Windows::Foundation::Collections::IVectorChangedEventArgs * pArgs) Line 200	C++
 	Windows.UI.Xaml.dll!DirectUI::ItemsControl::OnItemsChangedImpl(IInspectable * e) Line 1125	C++
 	Windows.UI.Xaml.dll!DirectUI::ItemsControlGenerated::OnItemsChanged(IInspectable * pE) Line 683	C++
 	Windows.UI.Xaml.dll!DirectUI::ItemsControlGenerated::OnItemsChangedProtected(IInspectable * pE) Line 704	C++
 	[Inline Frame] Windows.UI.Xaml.dll!std::_Func_class<long,Windows::Foundation::Collections::IObservableVector<Windows::Foundation::DateTime> *,Windows::Foundation::Collections::IVectorChangedEventArgs *>::operator()(Windows::Foundation::Collections::IObservableVector<Windows::Foundation::DateTime> * <_Args_0>, Windows::Foundation::Collections::IVectorChangedEventArgs * <_Args_1>) Line 869	C++
 	Windows.UI.Xaml.dll!ctl::event_handler_base<Windows::Foundation::Collections::VectorChangedEventHandler<Windows::Foundation::DateTime>,Windows::Foundation::Collections::IObservableVector<Windows::Foundation::DateTime>,Windows::Foundation::Collections::IVectorChangedEventArgs,DirectUI::DateTimeVectorChangedTraits>::Invoke(Windows::Foundation::Collections::IObservableVector<Windows::Foundation::DateTime> * pSender, Windows::Foundation::Collections::IVectorChangedEventArgs * pArgs) Line 38	C++
 	Windows.UI.Xaml.dll!DirectUI::CEventSourceBase<DirectUI::IUntypedEventSource,Windows::Foundation::Collections::VectorChangedEventHandler<IInspectable *>,Windows::Foundation::Collections::IObservableVector<IInspectable *>,Windows::Foundation::Collections::IVectorChangedEventArgs>::Raise(Windows::Foundation::Collections::IObservableVector<IInspectable *> * pSource, Windows::Foundation::Collections::IVectorChangedEventArgs * pArgs) Line 307	C++
 	Windows.UI.Xaml.dll!DirectUI::ItemCollection::OnCollectionChanged(Windows::Foundation::Collections::IObservableVector<IInspectable *> * pSender, Windows::Foundation::Collections::IVectorChangedEventArgs * e) Line 410	C++
 	[Inline Frame] Windows.UI.Xaml.dll!DirectUI::ItemCollection::UpdateItemsSourceList::__l23::<lambda_333c454cfd67f0d9d59f18ca318bd614>::operator()(IInspectable * sender, Windows::Foundation::Collections::IVectorChangedEventArgs * args) Line 368	C++
 	[Inline Frame] Windows.UI.Xaml.dll!std::invoke(DirectUI::ItemCollection::UpdateItemsSourceList::__l23::<lambda_333c454cfd67f0d9d59f18ca318bd614> &) Line 1488	C++
 	[Inline Frame] Windows.UI.Xaml.dll!std::_Invoker_ret<long,0>::_Call(DirectUI::ItemCollection::UpdateItemsSourceList::__l23::<lambda_333c454cfd67f0d9d59f18ca318bd614> &) Line 660	C++
 	Windows.UI.Xaml.dll!std::_Func_impl_no_alloc<<lambda_333c454cfd67f0d9d59f18ca318bd614>,long,Windows::Foundation::Collections::IObservableVector<IInspectable *> *,Windows::Foundation::Collections::IVectorChangedEventArgs *>::_Do_call(Windows::Foundation::Collections::IObservableVector<IInspectable *> * && <_Args_0>, Windows::Foundation::Collections::IVectorChangedEventArgs * && <_Args_1>) Line 822	C++
 	[Inline Frame] Windows.UI.Xaml.dll!std::_Func_class<long,Windows::Foundation::Collections::IObservableVector<Windows::Foundation::DateTime> *,Windows::Foundation::Collections::IVectorChangedEventArgs *>::operator()(Windows::Foundation::Collections::IObservableVector<Windows::Foundation::DateTime> * <_Args_0>, Windows::Foundation::Collections::IVectorChangedEventArgs * <_Args_1>) Line 869	C++
 	Windows.UI.Xaml.dll!ctl::event_handler_base<Windows::Foundation::Collections::VectorChangedEventHandler<Windows::Foundation::DateTime>,Windows::Foundation::Collections::IObservableVector<Windows::Foundation::DateTime>,Windows::Foundation::Collections::IVectorChangedEventArgs,DirectUI::DateTimeVectorChangedTraits>::Invoke(Windows::Foundation::Collections::IObservableVector<Windows::Foundation::DateTime> * pSender, Windows::Foundation::Collections::IVectorChangedEventArgs * pArgs) Line 38	C++
 	Windows.UI.Xaml.dll!DirectUI::TrackerEventSource<Windows::Foundation::Collections::VectorChangedEventHandler<IInspectable *>,Windows::Foundation::Collections::IObservableVector<IInspectable *>,Windows::Foundation::Collections::IVectorChangedEventArgs>::Raise(Windows::Foundation::Collections::IObservableVector<IInspectable *> * pSource, Windows::Foundation::Collections::IVectorChangedEventArgs * pArgs) Line 572	C++
 	[Inline Frame] Windows.UI.Xaml.dll!DirectUI::BindableObservableVectorWrapper::RaiseVectorChanged(Windows::Foundation::Collections::IVectorChangedEventArgs *) Line 286	C++
 	Windows.UI.Xaml.dll!DirectUI::BindableObservableVectorWrapper::RaiseVectorChanged(Windows::Foundation::Collections::CollectionChange action, unsigned int index) Line 274	C++
 	Windows.UI.Xaml.dll!DirectUI::BindableObservableVectorWrapper::ProcessCollectionChange(Windows::UI::Xaml::Interop::INotifyCollectionChangedEventArgs * pArgs) Line 225	C++
 	[Inline Frame] Windows.UI.Xaml.dll!std::_Func_class<long,IInspectable *,Windows::UI::Xaml::Interop::INotifyCollectionChangedEventArgs *>::operator()(IInspectable * <_Args_0>, Windows::UI::Xaml::Interop::INotifyCollectionChangedEventArgs * <_Args_1>) Line 869	C++
 	Windows.UI.Xaml.dll!ctl::event_handler_base<Windows::UI::Xaml::Interop::INotifyCollectionChangedEventHandler,IInspectable,Windows::UI::Xaml::Interop::INotifyCollectionChangedEventArgs,DirectUI::CollectionChangedTraits>::Invoke(IInspectable * pSender, Windows::UI::Xaml::Interop::INotifyCollectionChangedEventArgs * pArgs) Line 38	C++
 	Windows.UI.Xaml.dll!ctl::event_handler_base<Windows::UI::Xaml::Interop::INotifyCollectionChangedEventHandler,IInspectable,Windows::UI::Xaml::Interop::INotifyCollectionChangedEventArgs,DirectUI::CollectionChangedTraits>::Invoke(IInspectable * pSender, Windows::UI::Xaml::Interop::INotifyCollectionChangedEventArgs * pArgs) Line 27	C++
 	[External Code]	
>	Stylophone.Common.dll!Stylophone.Common.ViewModels.QueueViewModel.MPDConnectionService_QueueChanged.AnonymousMethod__2() Line 217	C#

Replacing the RemoveRange with a for loop of RemoveAt seems to solve the crash.

I’ve not seen this issue reported so maybe there’s something on my setup that triggers both weird behaviors. The mpd server protocol version is 0.23.5 and it’s the android version of the app.

Issue Analytics

  • State:open
  • Created 8 months ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
hlbstdcommented, Jan 22, 2023

I think I’ve found the cause of those additional notifications, it’s the proxy database plugin, aka “satellite mode”. I’ve switched to a local db and the application now works as expected.

This issue is solved as far as I’m concerned, I’ll leave it open in case you want to handle this particular setup in app.

1reaction
hlbstdcommented, Jan 17, 2023

Skipping a song always trigger this event for me, with consume enabled or not. With consume enabled the behaviour actually matches the comment (I receive the songs remaining in the playlist). I think this is not the only instance of me receiving this event more often than intended by the app. I have another issue when playing an album for instance, the callback is triggered at least twice and is run in parallel which also messes with the list.

An easy fix on my side is to use the playlistinfo command and run ReplaceRange on the whole queue each time but it makes the ui refresh a lot more than it should I think.

Putting aside the what triggers the callback, shouldn’t the result of plchanges be handled a bit differently anyway ? Since the command gives the new offsets of the modified elements, couldn’t they be used to find out which elements have actually been removed/added/shuffled without presuming of the result and with minimal modification to the list ? I don’t know much about xaml/winui so maybe this wouldn’t be beneficial to minimizes changes to the UI.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Windows Explorer crashes when you change print queue ...
Describes an issue in which Windows Explorer crashes when you change print queue properties after Unidrv.dll is updated. Resolution is provided.
Read more >
Amazon, PLEASE fix The Queue Crashes!!!
I have crashed out of queue twice now so assuming it will just keep happening. We need to hold our queue spot on...
Read more >
IV22043: Following restart of a crashed queue manager, a ...
If the queue manager is hard-crashed immediately after the checkpoint, then on queue manager restart the queue file may contain persistent ...
Read more >
Crashing during processing of queue · Issue #1772
When processing a queue containing many (70+) raw files, Raw Therapee crashes to desktop after an apparently random number of images have ...
Read more >
Concurrency cooperative queue crash with iOS 15/16
I recently began migrating an app over to use Swift concurrency as it had a ton of issues with improperly using DispatchQueues that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found