shanipribadi opened a new issue, #3039:
URL: https://github.com/apache/fory/issues/3039

   ### Search before asking
   
   - [x] I had searched in the [issues](https://github.com/apache/fory/issues) 
and found no similar issues.
   
   
   ### Version
   
   require github.com/apache/fory/go/fory v0.0.0-20251210114924-170ff49a1cc4
   go version go1.25.4 linux/amd64
   
   ### Component(s)
   
   Go
   
   ### Minimal reproduce step
   
   ```Go
   func main() {
           f := fory.New(
                   fory.WithCompatible(true),
           )
           type A struct {
                   Name string
           }
   
           f.RegisterNamedType(A{}, "test.A")
           a := A{Name: "hello"}
           buf, err := f.Marshal(&a)
           if err != nil {
                   log.Fatalf("err: %v", err)
           }
           log.Printf("buf: % x", buf)
           b := A{}
           err = f.Unmarshal(buf, &b)
           if err != nil {
                   log.Fatalf("err: %v", err)
           }
           log.Printf("b: %v", b)
   }
   ```
   
   ### What did you expect to see?
   
   working deserialization
   
   ### What did you see instead?
   
   panic: runtime error: slice bounds out of range [:86073] with capacity 138
   
   ### Anything Else?
   
   changing the struct into
   ```Go
   struct A {
   FirstName string
   LastName string
   }
   ```
   
   gives panic: invalid string encoding: 3
   
   changing the struct into
   ```Go
   struct A {
   FirstName string
   }
   ```
   doesn't actually cause a panic, but somehow the result is wrong
   
   Marshaling the struct directly instead of pointer actually works
   ```Go
           buf, err := f.Marshal(a)
           err = f.Unmarshal(buf, &b)
   ```
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to