-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Description
Observed while enabling rt async in Libraires partition - #119432
The symptom is a number of tests failing with assert like:
Assertion failed 'callInfo.SaveAndRestoreSynchronizationContextField && (callInfo.SynchronizationContextLclNum != BAD_VAR_NUM)' in 'System.IO.Compression.Tests.ZipFile_Extract_Stream:ExtractToDirectoryRoundTrip(bool):this' during 'Transform async' (IL size 90; hash 0x550642b2; Tier0)
The actual reason is the part allInfo.SynchronizationContextLclNum != BAD_VAR_NUM
SynchronizationContextLclNum
are introduced when we walk through basic blocks in SaveAsyncContexts. When await is contained in a try, we may split the block to wrap the await in try/finally. That currently may result in not visiting the rest of the block, which may contain another await.
There is an approximate fix in:
4943578