You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What does 'go version' print?
go version go1.2.1 windows/amd64
What steps reproduce the problem?
http://play.golang.org/p/Go2KPCaIDZ
What happened?
No stack trace returned from runtime.Stack() call. The function returns 0, indicating 0
bytes written to the pre-allocated buffer.
What should have happened instead?
I should get a stack trace for the current goroutine. runtime/debug.Stack() returns a
stack trace, but runtime.Stack() does not.
Please provide any additional information below.
The text was updated successfully, but these errors were encountered:
That's C semantics, not Go semantics. You have an allocated buffer with plenty
capacity. Length should be zero. The Stack function should fill the buffer up to
capacity at most, not its length. This would remove the need for the nonstandard int
return value representing the new length of the buffer.
It is Go semantics. see also io.Reader.
API should generally not change len of a slice passed in (for example,
consider that, before the introduction of three index slides, what if
you have a custom []byte allocator that allocates from a big []byte?
Writing past the length might corrupt the memory of others unrelated
byte slices).
by james.jdunne:
The text was updated successfully, but these errors were encountered: