go: runtime: memory corruption on darwin/amd64

#!watchflakes
post <- goos == "darwin" && goarch == "amd64" && (
	log ~ `fatal error: found pointer to free object` ||
	log ~ `fatal error: found bad pointer in Go heap` ||
	log ~ `fatal error: workbuf is not empty` ||
	log ~ `fatal error: workbuf is empty` ||
	log ~ `schedule: holding locks` ||
	log ~ `fatal error: bad summary data` ||
	log ~ `fatal: morestack on gsignal` ||
	log ~ `runtime\.\(\*mheap\)\.allocNeedsZero` ||
	(log ~ `panic: runtime error: invalid memory address or nil pointer dereference` && log ~ `^\s*runtime\.sigpanic.*\n\s+.*\n\s*runtime\.sweepone`) ||
	(log ~ `panic: runtime error: invalid memory address or nil pointer dereference` && pkg == "cmd/compile/internal/ssa") ||
	(log ~ `SIGSEGV: segmentation violation` && log ~ `^\s*runtime\.spanOfUnchecked\(`))

Issue created automatically to collect these failures.

Example (log):

— watchflakes

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 43 (43 by maintainers)

Most upvoted comments

darwin/amd64 is supposed to be a first class port.

@golang/runtime, should this be marked as a release-blocker for Go 1.22?

I may be misunderstanding the policy, but I think technically it’s not a release-blocker since we released Go 1.21 with the same issue, so it’s not new to this release. (The fact that we released Go 1.21 without figuring out what it is is on it’s own something that we should maybe revisit, but I think that’s where we are today.) I don’t want to be the sole judge on this so I’ll add it to the next weekly meeting and/or revisit this in triage.

@cherrymui spent a good bit of time investigating this and had a lot of difficulty reproducing. (Mentioning that here because I don’t think that was recorded in this issue.) The crash rate is also fairly low, so it’s difficult to continue to prioritize this against other things that need fixing, especially since the amount of time this bug could take to resolve is unknown and likely high. Again, not trying to make a decision, just trying to rationalize how we got here.

The other aspect to this is that it doesn’t seem to have impacted downstream users much, if at all. It’s possible that users are just ignoring it, but IIRC other Darwin issues that appeared on the builders have been reported in the past, such as the CPU profile related one.

This makes me wonder if maybe it’s our postsubmit Mac machines specifically that are the problem. It also occurs to me that I haven’t seen the same kinds of failures on the LUCI infrastructure. Those builders have been up long enough that I would’ve expected to see at least one such failure by now. They have a few failures from other unique sources, but I haven’t seen anything like this yet.

I will say that it’s possible the failure got missed on the LUCI builders because watchflakes doesn’t run against the LUCI infrastructure yet. At the very least I can do an ad-hoc-but-systematic analysis of all our LUCI darwin builds and see if anything crops up. If not, then that’s an interesting data point.

darwin/amd64 is supposed to be a first class port.

@golang/runtime, should this be marked as a release-blocker for Go 1.22?

These represent more general runtime memory corruption, but I suspect this is all part of the same issue.

2023-08-21 23:20 darwin-amd64-11_0 go@e3c80f57 cmd/go.TestScript (log) 2023-08-22 08:38 darwin-amd64-longtest go@05f95115 runtime.TestEINTR (log)

I was going back through issues assigned to me (oops, I have a backlog) and I noticed that #58715 is also memory corruption, but none of those failures include forkExec. Just mentioning it here since it might be related.

We should probably aggregate such issues into a single issue.