Unexpected string to byte casting behavior in Go 1.5
github.com
github.com
I've spent a few hours looking at the compiler source and the runtime code and a surprising amount of it is very understandable to me.
On another note, I find it very odd that this fell off the front page so quickly. Is there some kind of go/google voters club on HN that flags anything that seems negative towards go?
Yes, that is a very nasty bug indeed. I think I'll be sticking with 1.4.2 for quite some time..
Does anyone else feel like 1.5 was released prematurely before it was honestly ready to go out the door? At this point Go is more than 5 years old; these kinds of amateur issues seem unacceptable.
Can anyone comment on what it's like when new versions of Java have been released throughout the past 20 years? I am curious if regressions and stability issues are common in that ecosystem.
My experience with Scala has been that things are quite bulletproof by the time they actually get released for wide-consumption.
Honestly, no. All software has bugs. The Go codebase is very solid, in general. It's hard to get away with as much change as we've had between 1.4 and 1.5 without a few issues slipping through.
At Google we've been running 1.5 in production for a while and didn't catch this issue. As have a lot of our other users. But inevitably when you release the stable version more bugs are uncovered; this is just life.
Conservative users should certainly wait a few days (or weeks) after a major new version before upgrading. Historically we have released version 1.N.1 within a couple of weeks of each major release. If I were you I'd just wait for 1.5.1.
edit: I think "very nasty" is overstating things. The likelihood of real code triggering this bug is extremely low.
It suggests the error is somehow not that commonly triggered in a visible way, or lots of tests would have broken. Or alternately it was a last-minute change.
It looks like the Go compilers are especially vulnerable to this because individual AST nodes have to allocate registers, which would not be a problem if they used a more traditional IR.
This also stresses the importance of random codegen testing and fuzzing, where test cases get run on v1.4 and v1.5 simultaneously and compared against each other. A simple fuzzer should have caught this.
The good news is this bug was caught on the same day as the release.
Nope. I would consider it the same as moving from 1.7 -> 1.8 and having things break/bugs occur. How many people in the Java ecosystem are still on 1.6 for whatever reason? It may have been fixed before release if more people tested the release candidate (but that never happens), and unfortunately for software "x.0" ends up being the "public beta".
I remember in 1.3.0 where I reported a bug (that also had to do with string/byte slice weirdness), that was fixed pretty quickly and landed in 1.3.1 (https://github.com/golang/go/issues/8325).