While trying to implement https://github.com/NVIDIA/dcgm-exporter/issues/72 I've encountered a segfault when trying to use DCGM_FI_DRIVER_VERSION; specifically if I try to format the result of FieldValue_v1.String().
I've only written a few hundred lines of Go in my life, but this looks suspicious: it's directly casting a C NUL-terminated string to a Go string, rather than using C.GoString.
While trying to implement https://github.com/NVIDIA/dcgm-exporter/issues/72 I've encountered a segfault when trying to use DCGM_FI_DRIVER_VERSION; specifically if I try to format the result of
FieldValue_v1.String()
.I've only written a few hundred lines of Go in my life, but this looks suspicious: it's directly casting a C NUL-terminated string to a Go
string
, rather than using C.GoString.