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

There is an panic at github.com/bytedance/sonic/internal/decoder/errors.(*MismatchTypeError).Error #692

Closed
yuanjize opened this issue Aug 21, 2024 · 5 comments · Fixed by #695

Comments

@yuanjize
Copy link

There is an nil pointer panic in my prod env.

runtime error: invalid memory address or nil pointer dereference

github.com/bytedance/sonic/internal/decoder/errors.(*MismatchTypeError).Error(0x2ff8980?)
	:1 +0x25

The code just like:

var sonicConfig = sonic.Config{
	EscapeHTML: true,
}.Froze()

err:=sonicConfig.Unmarshal(data, v)
if err!=nil{
  print(err.Error())
}

It panic when i call err.Error()

@liuq19
Copy link
Collaborator

liuq19 commented Aug 23, 2024

Thanks, could you provide minimal reproducible codes, we will investigate it

@yuanjize
Copy link
Author

Hi @liuq19, I find you have push an fix commit. But it only for main branch. Can we use main branch in our prod environment? It is safe?

@liuq19
Copy link
Collaborator

liuq19 commented Aug 26, 2024

we will publish the version later

@yuanjize
Copy link
Author

@liuq19 Thank you very much

@liuq19
Copy link
Collaborator

liuq19 commented Aug 27, 2024

pls update into v1.12.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants