runtime: computed hash value for struct map key ignores some fields #3695
Copy link
Copy link
Closed
Labels
Description
This is possibly a duplicate of 3573, but is logged since the problem does not appear to be completely fixed at tip, so it was suggested that I relog. $ go version go version weekly.2012-03-27 +d8e47164f8dd What steps will reproduce the problem? If possible, include a link to a program on play.golang.org. 1. Run one of the variations of the program at: http://play.golang.org/p/wG8AK7AAQl Variations include changing const id = ... to var id = ... and also changing the values assigned to id. The struct sp can also be defined as a struct { string int string int } to the same effect as presented in the linked code. What is the expected output? The numbers 0-499 on separate line. What do you see instead? The numbers 0-81 on separate lines followed by any of (variable results for any given program): 1. 'throw: hashmap assert' when id is const or var "", var or const "a", var ~> "naaa" (4-words checked only) 2. 'invalid memory address or nil pointer dereference' when id is var "" 3. 'unexpected fault address' when id is const or var "a" or ~< "naaa" (4-words checked) 4. no termination with 100% CPU usage. when id is const or var ~> "naaa" (4-words checked only) NB 4-words not exhaustively checked. Which compiler are you using (5g, 6g, 8g, gccgo)? 6g Which operating system are you using? Linux Which version are you using? (run 'go version') go version weekly.2012-03-27 +d8e47164f8dd Please provide any additional information below. Using sf with only the int field or the string field results in normal behaviour.
Reactions are currently unavailable
Activity
robpike commentedon Jun 2, 2012
Comment 1:
Labels changed: added priority-soon, removed priority-triage.
Owner changed to @rsc.
Status changed to Accepted.
gopherbot commentedon Jun 10, 2012
Comment 2:
rsc commentedon Jun 13, 2012
Comment 3:
This issue was closed by revision 51fe544.
Status changed to Fixed.
gopherbot commentedon Nov 29, 2012
Comment 5 by ulf@nhumi.com:
gopherbot commentedon Nov 29, 2012
Comment 6:
davecheney commentedon Nov 29, 2012
Comment 7:
gopherbot commentedon Nov 30, 2012
Comment 8 by ulf@nhumi.com:
rsc commentedon Dec 3, 2012
Comment 9:
Status changed to Retracted.
[release-branch.go1] runtime: improved continuity in hash computation