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

Make ParseUtil::JsonToString thread safe #4654

Merged
merged 3 commits into from
Aug 27, 2020

Conversation

chriche-ms
Copy link
Member

@chriche-ms chriche-ms commented Aug 25, 2020

Related Issue

Resolves #4653

Description

After updating the Cortana in Windows app from version 1.2.0 to 2.0.0 of the UWP adaptive cards renderer repeated crashes in ParseUtil::JsonToString were observed. It has been speculated that one thread is modifying the static Json::StreamWriterBuilder instance's properties while another is using it to construct a new stream writer. Updating the code so that the static instance is const and thread_local appears to resolve the issue.

How Verified

Manual testing of the Cortana in Windows application.

Microsoft Reviewers: Open in CodeFlow

@chriche-ms chriche-ms self-assigned this Aug 25, 2020
Copy link
Contributor

@RebeccaAnne RebeccaAnne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@chriche-ms chriche-ms merged commit 5c55950 into microsoft:main Aug 27, 2020
@chriche-ms chriche-ms deleted the chriche/uwp_jsontostring_crash branch August 27, 2020 15:22
rankush pushed a commit to rankush/AdaptiveCards that referenced this pull request May 8, 2024
…uilder instance const and thread_local. (microsoft#4654)

Co-authored-by: RebeccaAnne <rebecch@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[UWP] Crash observed in ParseUtil::JsonToString
2 participants