On 9/25/22 19:06, 'Axel Wagner' via golang-nuts wrote:
Another possibility is someone trying (and failing) to use unsafe to speed things up in a []byte/string conversion and accidentally converts a nil-slice.
No unsafe in my own code, but I use a third-party library ("sdlcanvas") for rendering that I think is using cgo and might use unsafe too, but that does not relate to the part of the code that panics.
It's also possible that the value is not nil, but a pointer to another piece of invalid memory - an mmaped region which got unmapped or a string pointing into the C stack, or something. FWIW you can check the actual data pointer of the string using unsafe <https://go.dev/play/p/AGMEBkD3JbA>, for debugging. That should at least tell you whether it's nil, as a first step.
I will try that; thanks for the advice. >Y< -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/47103683-7d0f-215b-c41a-2dd0ba140e19%40hoi-polloi.org.