Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/cgo: deterministically iterate over C.xxx references? #8487
A handful of recent cmd/cgo issues were only intermittent failures because they subtly depended quirks in GCC's DWARF output, which in turn subtly depended upon the order of C.xxx references output by cgo (which in turn is random because of a "range" iteration over the f.Name map in (*Package).guessKinds(*File)). Making it deterministic seems easy enough to do (just add an appropriate call to sort.Sort somewhere in cmd/cgo/gcc.go), but it's not obvious to me whether that's desirable or not. On one hand, the random ordering seems to have helped fuzz test debug/dwarf and cmd/cgo a bit and perhaps expose bugs we wouldn't have otherwise been aware of, but it also means builds might spuriously fail because of latent bugs rather than deterministically fail depending on the input.
This issue was closed.