Skip to content

Providing custom AutomationPeer when deriving from RangeBase can crash app on value change #3467

@marcelwgn

Description

@marcelwgn

Describe the bug

When creating a custom control that is derived from RangeBase, providing an AutomationPeer (by overriding OnCreateAutomationPeer) can crash the application when the value property changes while narrator is on.

See following demo project:

RangeBaseCrash.zip

Switching the base class of the peer to RangeBaseAutomationPeer fixes the crash, however not using that peer shouldn't flat out crash the app in my opinion.

Steps to reproduce the bug

Steps to reproduce the behavior:

  1. Create Control derived from RangeBase
  2. Provide custom automation peer
  3. Start narrator
  4. Change value property of custom control

Repro steps app:

  1. Start Narrator
  2. Start app and focus CustomControl1
  3. Hit arrow key right
  4. Observe app crashing

Expected behavior

App should not crash
Screenshots

Version Info

NuGet package version:

WinUI 2.4.3

Windows app type:

UWP Win32
Windows 10 version Saw the problem?
Insider Build (20236) Yes
May 2020 Update (19041)
November 2019 Update (18363)
May 2019 Update (18362)
October 2018 Update (17763)
April 2018 Update (17134)
Fall Creators Update (16299)
Creators Update (15063)
Device form factor Saw the problem?
Desktop Yes
Xbox
Surface Hub
IoT

Additional context

Found while investigating a crash with WCT RadialGauge control.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions