-
Notifications
You must be signed in to change notification settings - Fork 9
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
Stack overflow with v0.4.4 #16
Comments
Thank you for the report, I'll take a look! |
We are having the same issue in a public project that uses musttag via golangci-lint: https://github.com/FerretDB/FerretDB/actions/runs/4119737045/jobs/7113756954 |
A simple package to reproduce: package tmp
import (
"encoding/json"
)
type Human struct {
Mom *Human `json:"mom"`
Dad *Human `json:"dad"`
Children []*Human `json:"children"`
}
func encode(v *Human) ([]byte, error) {
return json.Marshal(v)
} so the stack overflow happens when a struct has a field with type of those struct, I already have a fix, will publish the PR in couple of minutes |
fix go-simpler#16 with stack overflow issue when a struct has the fields of self type
fix go-simpler#16 with stack overflow issue when a struct has the fields of self type
fix go-simpler#16 with stack overflow issue when a struct has the fields of self type
fix #16 with stack overflow issue when a struct has the fields of self type
Please take a look at https://github.com/junk1tm/musttag/releases/tag/v0.4.5 |
musttag 0.4.4 is experiencing a stack overflow when run on one of our projects. I can't share that project unfortunately but the output of
musttag ./...
is provided in the attached file.The problem doesn't occur if I revert this change: 9229084#diff-cfb5a4e47e6f8c71c0c2f50fffec7a51b18984f95177a9c1af9c436475810a99R209-R213
I added some logging at it seems to be looping over some structs from go-github.
I'm out of time to look at this for now but thought I'd let you know what I've found so far in case the problem/solution is obvious to you.
The text was updated successfully, but these errors were encountered: