msbuild: [Broken Build]: Get stack overflow on a M2 MacBook

Issue Description

My project builds fine on Windows X64 Machines and a M2 Mac when it is just cloned from Github. But when I modified the code(even a single line), the build faild with console output “stack overflow” or just hang there. But the modified code builds fine on Windows X64.

It‘s wired that after I pushed modified files to Git and re-clone the project, the build worked again. And after modified some files it failed again(and succeed on Windows X64). This trick works and it`s now a temperory workaround for me. image

Sometimes it producs error MSB4166 with noting in the log folder 截屏2023-06-06 17 17 04

After the first stack overflow or fail, any dotnet build\restore\clean will hang as it’s shown above.

Steps to Reproduce

Project: https://github.com/ProjectRakuen/MoeUC.git

Steps to reproduce:

  1. Clone the project
  2. Build the solution
  3. Modify some files with VS Mac or Rider
  4. Rebuild MoeUC.Api
  5. If build success, goto 3
  6. Build failed with console output stack overflow or hangs.

Expected Behavior

Just build the project

Actual Behavior

dotnet build\restore\clean faild with stack overflow or segment fault or hang

Ask us questions

No response

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Comments: 16 (6 by maintainers)

Most upvoted comments

As another possible workaround, @StarPluckerZ, try to build with /m:1 switch: dotnet build /m:1.

This problem magically disappeared after I update to MacOS 13.4.1(22F82). I’m stil running some test on it and will close this issue if this problem does not occur within 7 days.