Closed livarcocc closed 4 years ago
Moved it here because this is something that the host should honor. I published the app and ran it using dotnet and still did not get the disassembly printout, and in this case, there is no CLI involved.
@gkhanna79 any insight here? @steveharter to take a look. Corehost is used for development of the runtime itself, my assumption is we didn't necessarily plumb all the same options through to the .NET Core App model.
Do you see the output when corehost_trace=1 is enabled @livarcocc ?
Thanks @livarcocc!
@gkhanna79, yes I can see the output dump when setting corehost_trace: $env:COREHOST_TRACE=1;dotnet run
. Can the other CoreCLR knobs be honored by setting the documented COMPLUS_*
variables in a similar fashion?
my assumption is we didn't necessarily plumb all the same options through to the .NET Core App model
@Petermarcu, if the environment values are transparently propagated by host to the runtime, would it still involve lots of plumbing?
Alternatively, would it make sense to introduce a switch in CLI, say --jit-debug <comma separated list of knob IDs without COMPLUS_ prefix>
, without requiring environment variables propagation from host to runtime?
So if output works with corehost_trace=1
+ dotnet run
then it appears stdout is being redirected to stderr?
Also here's some additional doc with information including that a debug version of CoreClr is required: https://github.com/dotnet/coreclr/blob/38a2a69c786e4273eb1339d7a75f939c410afd69/Documentation/building/viewing-jit-dumps.md#setting-configuration-variables
Correct.
@gkhanna79 correct on which comment? :)
I'll debug this soon to see what exactly is going on.
At least for 2.0, I think the biggest factor here is that in order to get the Jit output, CoreClr needs to be compiled in Debug mode. Provided a Debug version is used, and the appropriate COMPlus_JitDump is set, the Jit output should appear in stdout. You can use corehost_trace=1
to see where the CLR is being loaded from.
On 2.0, I verified success under various configurations:
1) With and without a RID
2) Running via dotnet exec
, dotnet run
and [myapp].exe directly (with a RID)
With a RID, you can use robocopy as mentioned in https://github.com/dotnet/coreclr/blob/38a2a69c786e4273eb1339d7a75f939c410afd69/Documentation/building/viewing-jit-dumps.md#setting-configuration-variables to copy the locally build Debug CoreClr to the appropriate bin folder so it is picked up and used. I don't think we have an official\public Debug version available, so you must build it yourself.
Without a RID, there is more\different work to do to ensure the Debug build is found, as the bin folder is not considered as a CoreClr location for portable apps.
Closing; Debug mode is currently required
From @am11 on July 4, 2017 17:34
Description
The CLR configuration knobs documentation suggests that if we set the environment variables, the knobs variables set by the environment shall be abided.
https://github.com/dotnet/coreclr/blob/38a2a69/Documentation/project-docs/clr-configuration-knobs.md
This holds if we build CoreCLR and run the app via corerun, but not when running with dotnet.exe/corehost.exe.
Steps to reproduce
Expected behavior
Dumps the disassembly for method
Main
on stdout as per the documentation.Seems like corehost or CLI are clearing output emitted by CoreCLR.
Actual behavior
Only
Hello World!
is emitted on stdout.Environment data
dotnet --info
output:Copied from original issue: dotnet/cli#7072