Join GitHub today
cmd/cgo: Corruption with C.CString #6275
What steps will reproduce the problem? Run the attached files. With go tip you can run directly. With go release you'll need to pre-compile the C/C++ code and link it. What is the expected output? 300 C'Hello'; What do you see instead? Sometimes something like: 1 CC'Hello';'Hello'; 1 298 C'Hello'; Which compiler are you using (5g, 6g, 8g, gccgo)? go (default) Which operating system are you using? Mac OS X 10.8.4 (darwin amd64) Which version are you using? (run 'go version') go version devel +21a81bde7dc9 Wed Aug 28 09:40:08 2013 +1000 darwin/amd64 go version go1.1.1 darwin/amd64 Please provide any additional information below. This doesn't happen every time. You have to run the above code a few dozen times before you get the unexpected output. I have a full library where I was getting this almost every time. The sample seems to be doing it less frequently for some reason.
This issue was closed.