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

Go Serialization panics on nested struct field. #87

Open
sadiq1971 opened this issue Feb 28, 2023 · 2 comments
Open

Go Serialization panics on nested struct field. #87

sadiq1971 opened this issue Feb 28, 2023 · 2 comments

Comments

@sadiq1971
Copy link

sadiq1971 commented Feb 28, 2023

It seems the serialization is panicking in the case of a struct containing a nested field. Not sure whether this feature is supported or not, or is there anything that needs to be done on the .fbe file as nothing is mentioned on the docs
fbe file definition:

package proto

struct NestedTest
{
   NestedTest? nested;
}

The command used for building go source files:
fbec --input=nested.fbe --output=. --go --final --proto --json

Go code for serialization:

        cnt := filespb.NewNestedTest()
	writer := filespb.NewNestedTestFinalModel(fbe.NewEmptyBuffer())
	if _, err := writer.Serialize(cnt); err != nil {
		panic("serialization error")
	}
	if ok := writer.Verify(); !ok {
		panic("verify error")
	}

panic trace:

runtime: goroutine stack exceeds 1000000000-byte limit
runtime: sp=0xc023180418 stack=[0xc023180000, 0xc043180000]
fatal error: stack overflow

runtime stack:
runtime.throw({0xe0939b?, 0x14ccaa0?})
	/home/sadiq/go/go1.19.1/src/runtime/panic.go:1047 +0x5d fp=0x7f8ca1ffacb8 sp=0x7f8ca1ffac88 pc=0x43b57d
@sadiq1971
Copy link
Author

@chronoxor

@L-LingRen
Copy link

Same the problem, any resolution?

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

No branches or pull requests

2 participants