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

Switch component causes a crash when using particular color styles #3922

Closed
roederw opened this issue Jan 21, 2020 · 3 comments
Closed

Switch component causes a crash when using particular color styles #3922

roederw opened this issue Jan 21, 2020 · 3 comments
Labels
Area: Borders and Brushes Area: Switch bug Recommend: Not Planned Recommend that issue should be given Not Planned milestone.
Milestone

Comments

@roederw
Copy link

roederw commented Jan 21, 2020

Environment

  1. react-native -v:

react-native-cli: 2.0.1
react-native: 0.60.0-microsoft.35

  1. react-native run-windows --info:

System:
OS: Windows 10 10.0.18362
CPU: (12) x64 Intel(R) Xeon(R) CPU E5-1650 v4 @ 3.60GHz
Memory: 53.90 GB / 63.90 GB
Binaries:
Node: 10.16.3 - C:\Program Files\nodejs\node.EXE
Yarn: 1.17.3 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD
npmPackages:
react-native: https://github.com/microsoft/react-native/archive/v0.60.0-microsoft.35.tar.gz => 0.60.0-microsoft.35
react-native-windows: 0.60.0-vnext.115 => 0.60.0-vnext.115
rnpm-plugin-windows: ^0.4.0 => 0.4.0
Installed UWP SDKs:
10.0.18362.0

Then, specify:

  • Target Platform Version(s): 10.0.18362
  • Target Device(s): Desktop.
  • Visual Studio Version: Microsoft Visual Studio Enterprise 2019 Version 16.4.2
  • Build Configuration: All configurations crash. Although, primarily using Debug/x64

Steps to Reproduce

Playground example code added below. Simply add the color "#11100f" to the thumbColor/TrackColor Switch prop.

image

Expected Behavior

Properly style the Switch component. On/off coloring, etc.

Actual Behavior

Application crashes. See below for stack.

KernelBase.dll!00007ff94d32a839() Unknown
vcruntime140d_app.dll!00007ff92e6582f7() Unknown
React.UWP.dll!winrt::throw_hresult(const winrt::hresult result) Line 4367 C++
React.UWP.dll!winrt::check_hresult(const winrt::hresult result) Line 4413 C++
React.UWP.dll!winrt::impl::consume_Windows_Foundation_Collections_IMapwinrt::Windows::UI::Xaml::ResourceDictionary,winrt::Windows::Foundation::IInspectable,winrt::Windows::Foundation::IInspectable::Insert(const winrt::Windows::Foundation::IInspectable & key, const winrt::Windows::Foundation::IInspectable & value) Line 115 C++
React.UWP.dll!react::uwp::UpdateResourceBrush(const winrt::Windows::UI::Xaml::FrameworkElement & element, const std::wstring & resourceName, const winrt::Windows::UI::Xaml::Media::Brush brush) Line 26 C++
React.UWP.dll!react::uwp::UpdateToggleSwitchTrackResourceBrushes(const winrt::Windows::UI::Xaml::Controls::ToggleSwitch & toggleSwitch, const winrt::Windows::UI::Xaml::Media::Brush onTrackBrush, const winrt::Windows::UI::Xaml::Media::Brush offTrackBrush) Line 121 C++
React.UWP.dll!react::uwp::SwitchShadowNode::UpdateTrackColor() Line 79 C++
React.UWP.dll!react::uwp::SwitchShadowNode::updateProperties(const folly::dynamic && props) Line 101 C++
React.UWP.dll!facebook::react::UIManager::createView(__int64 tag, std::string && className, __int64 __formal, folly::dynamic && props) Line 261 C++
React.UWP.dll!facebook::react::UIManagerModule::getMethods::__l2::(folly::dynamic args) Line 451 C++
[External Code]
React.UWP.dll!facebook::react::CxxNativeModule::invoke::__l2::() Line 144 C++
[External Code]
React.UWP.dll!react::uwp::BatchingUIMessageQueueThread::onBatchComplete::__l5::() Line 57 C++
React.UWP.dll!winrt::impl::delegate<winrt::Windows::UI::Core::DispatchedHandler,void (void)>::Invoke() Line 1275 C++
[External Code]

@ghost ghost added the Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) label Jan 21, 2020
@roederw roederw changed the title Switch component crashes when using particular colors Switch component causes a crash when using particular colors Jan 21, 2020
@roederw roederw changed the title Switch component causes a crash when using particular colors Switch component causes a crash when using particular color styles Jan 21, 2020
@chrisglein
Copy link
Member

There's some caching happening of SolidColorBrushes, which might be the cause here.

@chrisglein chrisglein added Area: Switch Area: Borders and Brushes and removed Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) labels Jan 23, 2020
@chrisglein chrisglein added this to the MVP+ (vNext M5) milestone Jan 23, 2020
@roederw
Copy link
Author

roederw commented Jan 23, 2020

Forgot to mention that. Removing the cache solves the problem but I can't for the life of me figure out why (and I don't want to just drop the cache). ARGB values look fine. The Color comparator looked fine to me as well. Calling for some backup/fresh eyes.

@roederw roederw closed this as completed Jan 23, 2020
@roederw roederw reopened this Jan 23, 2020
@chrisglein chrisglein removed the vnext label Mar 18, 2020
@chrisglein chrisglein modified the milestones: 0.62 (M5), Backlog May 12, 2020
@chrisglein chrisglein added the Recommend: Not Planned Recommend that issue should be given Not Planned milestone. label Aug 30, 2023
@chrisglein
Copy link
Member

Not something we plan to address on the Paper renderer as we move towards Fabric.
Fabric API completion is tracked here: #11163

@chrisglein chrisglein closed this as not planned Won't fix, can't repro, duplicate, stale Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Borders and Brushes Area: Switch bug Recommend: Not Planned Recommend that issue should be given Not Planned milestone.
Projects
None yet
Development

No branches or pull requests

3 participants