microsoft / microsoft/calculator

Calculator.exe is setting selected index to an invalid value

Open
#98 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area: Reliability Bug Pri: 3 triage approved
Dominant language
C#
Stars
31.1k
Forks
5.8k
PR merge metrics
No merged PRs in 30d

Description

We're seeing from crash dumps that Calculator is setting selected index on a selector-derived type to a value that is outside the valid range.

The actual failure occurs in the XAML code, where the call stack looks like this:
0 Windows_UI_Xaml!DirectUI::Selector::OnSelectedIndexChanged
1 Windows_UI_Xaml!DirectUI::Selector::OnPropertyChanged2
2 Windows_UI_Xaml!DirectUI::ComboBox::OnPropertyChanged2
3 Windows_UI_Xaml!DirectUI::DependencyObject::NotifyPropertyChanged
4 Windows_UI_Xaml!CDependencyObject::NotifyPropertyChanged
5 Windows_UI_Xaml!CDependencyObject::SetEffectiveValue
6 Windows_UI_Xaml!CDependencyObject::UpdateEffectiveValue
7 Windows_UI_Xaml!CDependencyObject::SetValue
8 Windows_UI_Xaml!CUIElement::SetValue
9 Windows_UI_Xaml!CFrameworkElement::SetValue
10 Windows_UI_Xaml!CControl::SetValue
11 Windows_UI_Xaml!CItemsControl::SetValue
12 Windows_UI_Xaml!DirectUI::DependencyObject::SetValueCore
13 Windows_UI_Xaml!DirectUI::DependencyObject::SetValueCore
14 Windows_UI_Xaml!DirectUI::DependencyObject::SetValueByKnownIndex_int_
15 Windows_UI_Xaml!DirectUI::ComboBox::OnClose
16 Windows_UI_Xaml!DirectUI::ComboBox::OnIsDropDownOpenChanged
17 Windows_UI_Xaml!DirectUI::ComboBox::OnPropertyChanged2
18 Windows_UI_Xaml!DirectUI::DependencyObject::NotifyPropertyChanged
19 Windows_UI_Xaml!CDependencyObject::NotifyPropertyChanged
20 Windows_UI_Xaml!CDependencyObject::SetEffectiveValue
21 Windows_UI_Xaml!CDependencyObject::UpdateEffectiveValue
22 Windows_UI_Xaml!CDependencyObject::SetValue
23 Windows_UI_Xaml!CUIElement::SetValue
24 Windows_UI_Xaml!CFrameworkElement::SetValue
25 Windows_UI_Xaml!CControl::SetValue
26 Windows_UI_Xaml!CItemsControl::SetValue
27 Windows_UI_Xaml!DirectUI::DependencyObject::SetValueCore
28 Windows_UI_Xaml!DirectUI::DependencyObject::SetValueByKnownIndex_unsigned char_
29 Windows_UI_Xaml!DirectUI::ComboBox::FocusChanged
30 Windows_UI_Xaml!DirectUI::ComboBox::OnElementPopupChildLostFocus

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the provided crash stack, especially DirectUI::ComboBox::OnClose, OnIsDropDownOpenChanged, and Selector::OnSelectedIndexChanged, then locate the corresponding Calculator UI code. Determine which selector-derived control assigns the out-of-range index and add regression coverage that verifies the selected index remains valid.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.