-
Notifications
You must be signed in to change notification settings - Fork 820
GetProjectOptionsFromScript raises Internal CLR error #15970
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
Comments
Is there a smaller repro which does not involve the FCS? Also, does it change the behaviour if language version is set to 7? |
Also, does this fail on older runtime, but same FCS package? |
Looks similar to dotnet/runtime#90962 and dotnet/runtime#90485 |
open System
open System.Diagnostics
type 'T MaybeNull when 'T: null and 'T: not struct = 'T
let inline (|Null|NonNull|) (x: 'T) : Choice<unit, 'T> =
match x with
| null -> Null
| v -> NonNull v
let executeProcess pathToExe arguments (workingDir: string option) (timeout: int) =
if not (String.IsNullOrEmpty pathToExe) then
let errorsList = ResizeArray()
let outputList = ResizeArray()
let mutable errorslock = obj
let mutable outputlock = obj
let outputDataReceived (message: string MaybeNull) =
match message with
| Null -> ()
| NonNull message -> lock outputlock (fun () -> outputList.Add(message))
let errorDataReceived (message: string MaybeNull) =
match message with
| Null -> ()
| NonNull message -> lock errorslock (fun () -> errorsList.Add(message))
let psi = ProcessStartInfo()
psi.FileName <- pathToExe
if workingDir.IsSome then
psi.WorkingDirectory <- workingDir.Value
psi.RedirectStandardOutput <- true
psi.RedirectStandardError <- true
psi.Arguments <- arguments
psi.CreateNoWindow <- true
psi.EnvironmentVariables.Remove("MSBuildSDKsPath") // Host can sometimes add this, and it can break things
psi.UseShellExecute <- false
use p = new Process()
p.StartInfo <- psi
p.OutputDataReceived.Add(fun a -> outputDataReceived a.Data)
p.ErrorDataReceived.Add(fun a -> errorDataReceived a.Data)
try
if p.Start() then
p.BeginOutputReadLine()
p.BeginErrorReadLine()
if not (p.WaitForExit(timeout)) then
// Timed out resolving throw a diagnostic.
raise (TimeoutException(sprintf "Timeout executing command '%s' '%s'" psi.FileName psi.Arguments))
else
p.WaitForExit()
p.ExitCode, outputList.ToArray(), errorsList.ToArray()
with ex ->
ignore errorsList
raise ex
else
-1, Array.empty, Array.empty
executeProcess @"C:\Program Files\dotnet\dotnet.exe" "--version" None 3000
|> printfn "%A"
What do I need to do for that? |
I can't reproduce it on my machine on rc1 |
Yes, this is a duplicate.
This crash will only reproduce if you have active ETW or EventPipe trace session that is capturing method IL. Code alone is not enough to hit the crash. |
Got it, thanks, Jan. @nojaf I presume, it should be fixed in rc2. Shall we close this one as a dupe, or would you like to leave it open until we update? |
Could we leave it open for a few more days? |
I am not entirely sure if it got inserted, worth trying. |
Downloading the rc2 nightly magically solved this problem for me. |
Another SDK release, another lament.
I'm using fsdocs which processes some scripts to generate HTML. What worked yesterday, stopped working after I downloaded dotnet 8 RC 1.
Repro steps
dotnet add package FSharp.Compiler.Service --version 43.8.100-preview.23418.2
)Program.fs
:Expected behaviour
I'm able to get the project options.
Actual behaviour
This is failing to execute
dotnet --version
infsharp/src/Compiler/Driver/FxResolver.fs
Lines 54 to 111 in 88b14c4
What is very frustrating is that the unit tests in
fsharp/tests/service/ScriptOptionsTests.fs
Lines 26 to 45 in a296258
are still working for me on my local machine.
Known workarounds
/
Related information
Provide any related information (optional):
The text was updated successfully, but these errors were encountered: