all: avoid a goroutine deadlock on disassembler error testExtDis currently has a goroutine deadlock - errc is an unbuffered channel, which is written to from a goroutine that calls extdis. The goroutine running testExtDis calls generate, which calls back into the anonymous function which then reads from ext.Dis. If extdis returns an error, it will not write to ext.Dis which leaves a deadlock between the two goroutines - one writing on errc and one reading from ext.Dis. Prevent this by closing the ext.Dis channel if we encounter an error that would be written to errc. This results in all current and future calls to the anonymous function returning, generate will then return and errc will then be read. This is a minimal fix - this really needs a redesign to improve the synchronisation and error handling (and ideally it would be not duplicated for each architecture). Change-Id: I9354b43608d25a55152d3ec989869c2afc076ee5 Reviewed-on: https://go-review.googlesource.com/c/arch/+/805180 Reviewed-by: Cherry Mui <cherryyz@google.com> Auto-Submit: Joel Sing <joel@sing.id.au> LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Carlos Amedee <carlos@golang.org>
This repository holds machine architecture information used by the Go toolchain. The parts needed in the main Go repository are copied in.
This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://go.dev/doc/contribute.
The git repository is https://go.googlesource.com/arch.
The main issue tracker for the arch repository is located at https://go.dev/issues. Prefix your issue with “x/arch:” in the subject line, so it is easy to find.