-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
JIT: Initialize jitstdout lazily #92123
JIT: Initialize jitstdout lazily #92123
Conversation
Avoid duplicating a handle and doing several I/O operations on the startup path. Fixes dotnet#91856 as a side effect.
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsAvoid duplicating a handle and doing several I/O operations on the startup path. Fixes #91856 as a side effect.
|
src/coreclr/jit/ee_il_dll.cpp
Outdated
|
||
FILE* jitstdout() | ||
{ | ||
if (s_jitstdout != nullptr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s_jitstdout
needs to be volatile for this to work reliably. Otherwise, the C++ compiler can compile this as:
var temp = s_jitstdout;
if (s_jitstdout != null)
return temp;
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see. Addressed
cc @dotnet/jit-contrib PTAL @EgorBo. Am going to try to see if this can also make .NET 8. Verified that the code no longer runs during startup/shutdown in release builds (unless e.g. |
/backport to release/8.0 |
Started backporting to release/8.0: https://github.com/dotnet/runtime/actions/runs/6221004616 |
@jakobbotsch backporting to release/8.0 failed, the patch most likely resulted in conflicts: $ git am --3way --ignore-whitespace --keep-non-patch changes.patch
Applying: JIT: Initialize jitstdout lazily
Using index info to reconstruct a base tree...
M src/coreclr/jit/codegencommon.cpp
M src/coreclr/jit/compiler.cpp
M src/coreclr/jit/ee_il_dll.cpp
M src/coreclr/jit/error.cpp
M src/coreclr/jit/fgdiagnostic.cpp
M src/coreclr/jit/lsra.cpp
Falling back to patching base and 3-way merge...
Auto-merging src/coreclr/jit/lsra.cpp
Auto-merging src/coreclr/jit/fgdiagnostic.cpp
Auto-merging src/coreclr/jit/error.cpp
Auto-merging src/coreclr/jit/ee_il_dll.cpp
CONFLICT (content): Merge conflict in src/coreclr/jit/ee_il_dll.cpp
Auto-merging src/coreclr/jit/compiler.cpp
Auto-merging src/coreclr/jit/codegencommon.cpp
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 JIT: Initialize jitstdout lazily
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128 Please backport manually! |
@jakobbotsch an error occurred while backporting to release/8.0, please check the run log for details! Error: git am failed, most likely due to a merge conflict. |
Avoid duplicating a handle and doing several I/O operations on the startup path. Fixes #91856 as a side effect.