Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/cgo: Corruption with C.CString #6275

lukescott opened this issue Aug 28, 2013 · 3 comments


Copy link

commented Aug 28, 2013

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';
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.


  1. (1109 bytes)

This comment has been minimized.

Copy link

commented Aug 28, 2013

Comment 1:

Forgot to add that I'm running the binary like this to get the results above:
v8test 2>&1 | uniq -c

This comment has been minimized.

Copy link

commented Aug 28, 2013

Comment 2:

I think this is working as intended. The cout isn't synchronized, and thus creates
garbage data. It isn't a fault with CString. I do have another issue with V8, but isn't
related to this.

This comment has been minimized.

Copy link

commented Aug 28, 2013

Comment 3:

Marking as retracted.  Please re-open if you determine that there is a real problem here.

Status changed to Retracted.

@golang golang locked and limited conversation to collaborators Jun 25, 2016

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
3 participants
You can’t perform that action at this time.