microsoft / microsoft/AdaptiveCards
Carousel element throws STOWED_EXCEPTION during XAML layout pass
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2k
- Forks
- 595
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 1
Description
The Carousel renderer in AdaptiveCarouselRenderer.cpp has multiple unguarded code paths that cause crashes:
-
SelectionChanged handler —
FlipView.SelectionChangedfires withSelectedIndex = -1duringItems().Append(). Handler callspipsPager.SelectedPageIndex(-1)→InvalidOperationException. -
SetFlipViewMaxHeight — Called from
LayoutUpdatedevent (outside the Render try-catch).GetAt(SelectedIndex())called without bounds check (SelectedIndexcan be -1).try_as<FrameworkElement>()result used without null check before.Measure(). -
Render loop —
try_as<FrameworkElement>()result chained directly into.LayoutUpdated()without null check. -
InitialPage — Index not validated against
Items().Size().
Watson callstack (crash point)
- Frame 0: CLayoutManager::UpdateLayout (layoutmanager.cpp:469)
- Frame 1: CCoreServices::NWDrawTree
- Frame 2: CCoreServices::NWDrawMainTree
- Frame 3: CWindowRenderTarget::Draw
Repro steps
- Build and run
source/uwp/winui3/SimpleVisualizer/SimpleVisualizer.sln - Click "Show Adaptive Card" (loads Clipchamp-style Carousel template)
- App crashes with
InvalidOperationException
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in AdaptiveCarouselRenderer.cpp and trace the SelectionChanged handler, SetFlipViewMaxHeight from LayoutUpdated, the Render loop, and InitialPage validation. Build source/uwp/winui3/SimpleVisualizer/SimpleVisualizer.sln and reproduce the carousel flow; done means the listed invalid selections, null elements, and out-of-range initial index no longer crash layout.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100