You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Assembly.Location returns / instead of the actual path intermittently #90657
Large internal Microsoft workload observed Assembly.Location sometimes returning / instead of the actual path after upgrading to recent .NET 8 build on Linux.
I suspect that this is a race condition caused by SString internally changing its encoding.
One thread can be changing the encoding from UTF8 to UTF16 while the other thread is operating on the string. The other thread may see encoding set to UTF8, but the actual payload can be converted to UTF16 already. It would explain how the method can return / instead of the actual path /abc/def/assembly.dll.
@AaronRobinsonMSFT@jkoritzinsky You are familiar with how SString works. Would you mind reviewing all places that access PEImage::m_path and check whether there may be a race condition like what I have described? (I have taken a cursory look, but I have not found anything obvious.)
changed the title [-]Assembly.Location returns `/` intermittently[/-][+]Assembly.Location returns `/` instead of the actual path intermittently[/+]on Aug 16, 2023
Activity
jkotas commentedon Aug 16, 2023
I suspect that this is a race condition caused by
SStringinternally changing its encoding.One thread can be changing the encoding from UTF8 to UTF16 while the other thread is operating on the string. The other thread may see encoding set to UTF8, but the actual payload can be converted to UTF16 already. It would explain how the method can return
/instead of the actual path/abc/def/assembly.dll.@AaronRobinsonMSFT @jkoritzinsky You are familiar with how SString works. Would you mind reviewing all places that access
PEImage::m_pathand check whether there may be a race condition like what I have described? (I have taken a cursory look, but I have not found anything obvious.)[-]Assembly.Location returns `/` intermittently[/-][+]Assembly.Location returns `/` instead of the actual path intermittently[/+]mangod9 commentedon Aug 16, 2023
the race wouldnt be Linux specific would it?
jkotas commentedon Aug 16, 2023
Depends. We have many Windows vs. non-Windows ifdefs in the vm. The race condition can be triggered by a code under non-Windows ifdef.
AaronRobinsonMSFT commentedon Aug 16, 2023
It is also possible, quite likely actually, this is on all platforms and the Linux workload in question was simply the first to find it.