bytedance / sonic

A blazingly fast JSON serializing & deserializing library
Apache License 2.0
6.59k stars 327 forks source link

Panic: &rt.GoString{Ptr:(unsafe.Pointer)(0xc003f6d650), Len:100} has nil pointer while its length is not zero! #587

Closed contestjia closed 5 months ago

contestjia commented 5 months ago

The pointer within the string does not appear to be nil, why is it reporting a nil pointer error?

go version: 1.19
sonic version: v1.8.10
github.com/bytedance/sonic/encoder.goPanic(0xc0044be300?, 0x3?)
    /usr/local/app/go/pkg/mod/github.com/bytedance/sonic@v1.8.10/encoder/errors.go:61 +0x65
github.com/bytedance/sonic/encoder.encodeTypedPointer(0xc00435e9a8, 0x1faae20, 0xc0054a2768, 0x7f4ad47ce370?, 0x8)
    /usr/local/app/go/pkg/mod/github.com/bytedance/sonic@v1.8.10/encoder/primitives.go:83 +0x1c2
github.com/bytedance/sonic/encoder.encodeInto(0xc00435e9a8, {0x1faae20, 0xc006134bf8}, 0xc0044be300?)
    /usr/local/app/go/pkg/mod/github.com/bytedance/sonic@v1.8.10/encoder/encoder.go:211 +0xdf
github.com/bytedance/sonic/encoder.Encode({0x1faae20, 0xc006134bf8}, 0x25c6ec9?)
    /usr/local/app/go/pkg/mod/github.com/bytedance/sonic@v1.8.10/encoder/encoder.go:168 +0xcc
github.com/bytedance/sonic.frozenConfig.Marshal(...)
    /usr/local/app/go/pkg/mod/github.com/bytedance/sonic@v1.8.10/sonic.go:83
AsterDY commented 5 months ago

data race