dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.1k stars 4.7k forks source link

Segmentation Fault while debugging #105917

Closed Martin521 closed 2 months ago

Martin521 commented 2 months ago

Description

In a certain, reproducible situation, while debugging a .net program (the F# compiler in this case) in VS Code, a segmentation fault happens.

Reproduction Steps

  1. Prerequisite: VS Code with Dev Containers
  2. Clone https://github.com/dotnet/fsharp
  3. Open repository in VS Code, install recommended extensions.
  4. Reopen repository in the devcontainer.
  5. Build compiler in dev container with dotnet build ./FSharp.Compiler.Service.sln -c Debug.
  6. In repository root, create a file, named test.fs, containing the following:
    module A
    printfn "hello world"
  7. Press F5, chose launch configuration Launch FSC (Debug), enter test.fs at the popped up prompt. FSC compiles test.fs and exits normally
  8. Add a breakpoint here (src/Compiler/Driver/FxResolver.fs:471).
  9. Press F5, wait for the breakpoint to be reached, press F5 again => "Segmentation fault" is printed on stdout.

Expected behavior

no segmentation fault

Actual behavior

see above

Regression?

It used to work on preview 5

Known Workarounds

Downgrade to preview 5.

Configuration

9.0.100-preview.6.24328.19 Windows 11 x64 host, dev container using mcr.microsoft.com/dotnet/sdk:9.0.100-preview.6

Other information

No response

dotnet-policy-service[bot] commented 2 months ago

Tagging subscribers to this area: @tommcdon See info in area-owners.md if you want to be subscribed.

Martin521 commented 1 month ago

@thaystg Thanks for the fix. Did it land in preview 7?

thaystg commented 1 month ago

No, landed in RC1.