-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Assembly.Location is sometimes corrupted on .NET 8 #93127
Comments
Tagging subscribers to this area: @dotnet/ncl Issue DetailsDescriptionThe Sometimes the real application also crashes with a segfault around the same point in the code somewhere in libcoreclr.so, but I have not been able to get a proper stack trace or repro the segfault. I cannot be sure if it's part of the same problem, but happy to share a core dump privately. Reproduction StepsExtract locationbug.zip, edit go.sh to set The main method code:
Expected behavior
This is the output most of the time. Actual behaviorSometimes:
Sometimes this happens on the first attempt, sometimes it takes 50 or so. Regression?Yes, worked on .NET 6.0, 3.1 and earlier. (Not tested on 7.0.) Known WorkaroundsDon't set Configuration.NET SDK 8.0.100-rc.1.23463.5 Other informationNo response
|
@jkotas I recall a report of this recently and you mentioned it was likely a UTF8 confusion. I can't find it though..? |
This sounds like #90657. Based on the commit info and the back port, I think this is fixed for RC2. |
Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov Issue DetailsDescriptionThe Sometimes the real application also crashes with a segfault around the same point in the code somewhere in libcoreclr.so, but I have not been able to get a proper stack trace or repro the segfault. I cannot be sure if it's part of the same problem, but happy to share a core dump privately. Reproduction StepsExtract locationbug.zip, edit go.sh to set The main method code:
The Mongo and HttpClient code looks bizarre, but it does not happen without those! (The real application does not use HttpClient, but actually connects to a MongoDB server using MongoClient.) Expected behavior
This is the output most of the time. Actual behaviorSometimes:
Sometimes this happens on the first attempt, sometimes it takes 50 or so. Regression?Yes, worked on .NET 6.0, 3.1 and earlier. (Not tested on 7.0.) Known WorkaroundsDon't set Configuration.NET SDK 8.0.100-rc.1.23463.5 Other informationNo response
|
Thank you for reporting this issue! Yes, this is duplicate of #90657 that is fixed in RC2. |
OK, thanks for the quick response @jkotas ! Do you expect this to have caused the segfaults, too, or is that a separate issue? When is RC2 expected to be released so we can test this? Also, do you have any idea why it only happened under such specific circumstances - especially only for that one assembly and with COMPlus_PerfMapEnabled=1? |
Yes, this issue can cause seg faults.
RC2 should be released in less than 2 weeks. If you would like to try something sooner, you can install daily build of the runtime (https://github.com/dotnet/runtime/blob/main/docs/project/dogfooding.md#daily-builds-table).
It is a race condition. Tracing makes it more likely to hit the race condition. |
@jkotas Thanks, I've downloaded daily builds of the SDK and the runtime and can still repro, though it seems to take longer now:
(took 108 attempts on the next go)
|
@AaronRobinsonMSFT Looks like your fix missed this place for some reason runtime/src/coreclr/vm/perfinfo.cpp Line 52 in 6524d17
|
Ha, so that's why it only happens with |
Confirmed fixed in 8.0.0-rtm.23513.17 - I cannot repro now even after 1000 iterations. |
Description
The
Assembly.Location
property sometimes (5%-50% of the time) returns a corrupted string (most commonly "/", but sometimes other values that appear to be a truncated version of the real path with one extra character appended). This only seems to happen for the System.Net.Sockets.dll assembly and only withCOMPlus_PerfMapEnabled=1
andLANG=sv_SE.UTF-8
. It did not happen on .NET 6.0, 3.1 or earlier versions with the same code. It does not always happen on .NET 8.Sometimes the real application also crashes with a segfault around the same point in the code somewhere in libcoreclr.so, but I have not been able to get a proper stack trace or repro the segfault. I cannot be sure if it's part of the same problem, but happy to share a core dump privately.
Reproduction Steps
Extract locationbug.zip, edit go.sh to set
DOTNET_ROOT
to your .NET 8 SDK directory, make it executable and run it.The main method code:
The Mongo and HttpClient code looks bizarre, but it does not happen without those! (The real application does not use HttpClient, but actually connects to a MongoDB server using MongoClient.)
Expected behavior
This is the output most of the time.
Actual behavior
Sometimes:
Sometimes this happens on the first attempt, sometimes it takes 50 or so.
Regression?
Yes, worked on .NET 6.0, 3.1 and earlier. (Not tested on 7.0.)
Known Workarounds
Don't set
COMPlus_PerfMapEnabled=1
orLANG=sv_SE.UTF-8
.It also seems to be very sensitive to the order of statements.
Configuration
.NET SDK 8.0.100-rc.1.23463.5
Linux x64
Reproduced on Linux Mint 20 VM (kernel 5.4.0-163-generic) and multiple Ubuntu 22.04.3 servers (kernels 5.15.0-86-generic and 6.2.0-1013-aws).
Other information
No response
The text was updated successfully, but these errors were encountered: