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
runtime: random crashes on macOS 13 Ventura Public Beta #53800
Comments
Putting it in the Go 1.20 milestone for now. |
I failed to reproduce this. I checked out 123a632 on my linux/amd64 laptop, ran make.bash, and then ran Is anyone else able to reproduce the failure? |
I installed macOS 13 beta (22A5295i) on an M1 machine, and I got random crashes, seg faults, GC errors, weird errors in the compiler, linker, go command, etc. They look different each time. Looks like memory corruptions. I'll keep looking into it. Given that Go has been working well on the M1 since macOS 11, and it seems to work well in a previous version of macOS 13 beta, there is probably something unexpected in the new beta of the OS. |
I found that running with low parallelism ( Further, running multiple Go processes in parallel is okay, as long as each Go process uses only 1 thread. On the other hand, running with a single process but high thread number within a process seems to make it fairly likely to fail. So it seems the issue is thread switch and/or synchronization within a process. For one attempt, for synchronization, I tried to add a memory barrier instruction ( Maybe something changed for thread switch and/or synchronization in the kernel, or libSystem? |
Reported to Apple via Feedback tool, got assigned FB10667468. |
I found that disabling memory reuse --
It is possible that we miss some sort of barrier when reusing memory. But as it works fine on a variety of weak-memory-model architectures, as well as previous versions of macOS, it is still weird. I also tried allowing Go GC but disabling returning memory to the OS, i.e. comment out all the code in |
Just to add more logs to the pile as I've been experiencing it since Developer Beta 2. On Developer Beta 1 you could still use Xcode 13, as Xcode 14 Beta 1 was broken in a different way. I didn't start getting these random crashes until Developer Beta 2 forward. I've also had other things crashing out with error messages regarding unaligned memory access, if that gives any hints. I can confirm that dropping down concurrency to 1 does work pretty consistently for me though (at least with the Go build process.) I submitted this to Apple on the 6th of July. ID is FB10564832. I updated it to mention that it's probably the same issue discussed here. error_1.log Edit: Also, yes. It was on |
Does this bug only affect the golang compiler or does it also affect applications created by the golang compiler? |
While I would need someone more familiar with Go errors/backtraces to weigh in, I'm tempted to say applications produced by the Go compiler are also affected. I started receiving random crashes relating to unexpected values from Terraform (written in Go) around the same time that I started receiving the above compiler crashes. In the case of the Go compiler, I would assume that it just so happens to create the ideal conditions to trigger this issue. Backtrace of an example Terraform crash attached, reproduced today. |
It is not limited to the compiler. It also affects also programs generated by the Go compiler, and as an OS bug it may affect non-Go programs as well. Apple is working on a fix. Thanks. |
As of macOS 13 Beta 6 I am no longer able to replicate this issue either by building go, or terraform-provider-aws (which was one of the hardest to get to build in Beta 5) repeatedly. It appears that the fix we were waiting for is in Beta 6. I may repeat the builds a few more times, but I've already built both 3 or 4 times without issue. |
Yeah, I think beta 6 should fix this, although I haven't been able to test myself. Thanks for confirming. Closing for now. We can reopen if we see it again. |
What version of Go are you using (
go version
)?What operating system and processor architecture are you using (
go env
)?go env
OutputBuild failure
The text was updated successfully, but these errors were encountered: