TestFilesystemInfo miscompiled on ppc64el by gccgo-4.9 in 1.25
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
juju-core |
Invalid
|
High
|
Unassigned | ||
1.25 |
Fix Released
|
Critical
|
Cheryl Jennings |
Bug Description
As seen in
http://
TestFilesystemInfo can fail for hilarious reasons:
storage_
c.Assert(info, jc.DeepEquals, expect)
... obtained state.Filesyste
... expected state.Filesyste
... mismatch at .ReadOnly: unequal; obtained true; expected true
mgz believes at the time of evaluation the value was false, but by the time of printing, the value is true.
This issue first appeared in 1.25
https:/
https:/
CI will try to make this test pass 3 times, then curse the branch. We have seen that with 6 tries the test can pass.
Changed in juju-core: | |
status: | Triaged → Incomplete |
tags: | added: ci intermittent-failure regression |
description: | updated |
summary: |
- TestFilesystemInfo race condition in 1.25 + TestFilesystemInfo miscompiled on ppc64el by gccgo-4.9 in 1.25 |
Changed in juju-core: | |
status: | Incomplete → Invalid |
It's a strange one because there's only a single goroutine involved, the test and related implementation code are quite straightforward, and the structs in question are copies (no pointers being passed around). It hard to see how the struct values could be changed in unexpected ways.
I've looked into it on stilson-09 (the ppc build slave) and have found some pretty weird behaviour. The "expected" struct is created here: https:/ /github. com/juju/ juju/blob/ 1.25/state/ filesystem_ test.go# L259, like this:
filesystemA ttachmentInfo := state.Filesyste mAttachmentInfo {MountPoint: "/srv"}
There's a bool field called ReadOnly which isn't being explicitly specified.
If I add:
fmt. Printf( "%+v\n" , filesystemAttac hmentInfo)
on the next line it almost always emits {MountPoint: , ReadOnly: true}. WTF?!
If I change the line that creates the struct to:
filesystemA ttachmentInfo := state.Filesyste mAttachmentInfo {MountPoint: "/srv", ReadOnly: false}
the Printf shows the expected field values and the test consistently passes.
The only explanation I can come up with is a compiler bug. I've sent the above to davecheney and mwhudson. Dave agrees it's probably a compiler bug but that it's unlikely that anyone will both fixing gccgo4.9 given that go1.5 now has the focus in terms of supporting ppc with Go. Waiting to see if Michael has any further comments.