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

System.Text.Json.SourceGeneration.Roslyn3.11.Tests crashes due to an assertion on linux/arm64/debug #65817

Closed
radical opened this issue Feb 24, 2022 · 7 comments
Labels
area-System.Text.Json blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' bug
Milestone

Comments

@radical
Copy link
Member

radical commented Feb 24, 2022

Hit this on #65752 .Build.

=================================================================
	Native stacktrace:
=================================================================
	0x7f9518ccbc - Unknown

Unhandled Exception:
System.Diagnostics.DebugProvider+DebugAssertException:    at System.Diagnostics.DebugProvider.Fail(String message, String detailMessage) in /_/src/libraries/System.Private.CoreLib/src/System/Diagnostics/DebugProvider.cs:line 22
   at System.Diagnostics.Debug.Fail(String message, String detailMessage) in /_/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Debug.cs:line 131
   at System.Diagnostics.Debug.Assert(Boolean condition, String message, String detailMessage) in /_/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Debug.cs:line 95
   at System.Diagnostics.Debug.Assert(Boolean condition) in /_/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Debug.cs:line 80
   at System.Text.Json.Serialization.Metadata.JsonTypeInfo.InitializePropCache() in /_/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonTypeInfo.Cache.cs:line 574
...
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Feb 24, 2022
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@radical radical added the blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' label Feb 24, 2022
@ghost
Copy link

ghost commented Feb 24, 2022

Tagging subscribers to this area: @dotnet/area-system-text-json
See info in area-owners.md if you want to be subscribed.

Issue Details

Hit this on #65752 .Build.

=================================================================
	Native stacktrace:
=================================================================
	0x7f9518ccbc - Unknown

Unhandled Exception:
System.Diagnostics.DebugProvider+DebugAssertException:    at System.Diagnostics.DebugProvider.Fail(String message, String detailMessage) in /_/src/libraries/System.Private.CoreLib/src/System/Diagnostics/DebugProvider.cs:line 22
   at System.Diagnostics.Debug.Fail(String message, String detailMessage) in /_/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Debug.cs:line 131
   at System.Diagnostics.Debug.Assert(Boolean condition, String message, String detailMessage) in /_/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Debug.cs:line 95
   at System.Diagnostics.Debug.Assert(Boolean condition) in /_/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Debug.cs:line 80
   at System.Text.Json.Serialization.Metadata.JsonTypeInfo.InitializePropCache() in /_/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonTypeInfo.Cache.cs:line 574
...
Author: radical
Assignees: -
Labels:

area-System.Text.Json, blocking-clean-ci, untriaged

Milestone: -

@eiriktsarpalis eiriktsarpalis added this to the 7.0.0 milestone Feb 28, 2022
@eiriktsarpalis eiriktsarpalis removed the untriaged New issue has not been triaged by the area owner label Feb 28, 2022
@radical
Copy link
Member Author

radical commented Mar 5, 2022

Hit this again for System.Text.Json.SourceGeneration.Roslyn4.0.Tests.

@krwq
Copy link
Member

krwq commented Mar 7, 2022

Note this is about Debug.Assert(PropertyCache == null); in InitializePropCache

I think this assert is just bogus and should be removed. I assume scenario of re-using same options on multiple threads is a valid one and that could create such problem. The worst case scenario we will double initialize PropertyCache. I'm not sure it makes sense to lock it - at least cannot immediately see anything which could break. Same goes for the similar assert in the InitializeParameterCache

@eiriktsarpalis @layomia?

@krwq krwq added the bug label Mar 7, 2022
@eiriktsarpalis
Copy link
Member

I think we should make sure that the instance is initialized before it can be shared across multiple threads.

@eiriktsarpalis
Copy link
Member

Duplicate of #60962

@eiriktsarpalis eiriktsarpalis marked this as a duplicate of #60962 Mar 28, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Apr 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Text.Json blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' bug
Projects
None yet
Development

No branches or pull requests

4 participants