You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The result is that bytes can be successfully deserialized in java but gives a strange error in go.
go console
GOROOT=/usr/lib/go-1.22 #gosetup
GOPATH=/home/leo/go #gosetup
/usr/lib/go-1.22/bin/go build -o /home/leo/.cache/JetBrains/GoLand2024.3/tmp/GoLand/___go_build_github_com_apache_fury_go_fury_main github.com/apache/fury/go/fury/main #gosetup
/home/leo/.cache/JetBrains/GoLand2024.3/tmp/GoLand/___go_build_github_com_apache_fury_go_fury_main #gosetup
panic: type of id 50 not supported, supported types: map[1:bool 2:uint8 3:int8 5:int16 7:int32 9:int64 11:float32 12:float64 13:string 14:[]uint8 16:fury.Date 18:time.Time 25:[]interface {} 30:map[interface {}]interface {} 257:fury.GenericSet 258:[]bool 259:[]int16 260:[]int32 261:[]int64 262:[]float32 263:[]float64 264:[]string]
goroutine 1 [running]:
main.deserialize()
/home/leo/projects/furygo/main/main.go:54 +0x185
main.main()
/home/leo/projects/furygo/main/main.go:37 +0xf
Process finished with the exit code 2
Second Trial
Next I went to discover the difference in the logic of the deserialization code between the two.
And then realized that in the go code there is one more part than in the java
go
buf.ReadInt32() // nativeObjectsStartOffsetnativeObjectsSize:=buf.ReadInt32()
iff.peerLanguage==GO {
ifnativeObjectsSize>0 {
returnfmt.Errorf("native serialization for golang is not supported currently")
}
}
returnf.ReadReferencable(buf, reflect.ValueOf(v).Elem())
java
obj = xreadRef(buffer);
I tried commenting out the code that reads an additional 4+4=8 bytes and then re-running the go code, however, a new error occurs
GOROOT=/usr/lib/go-1.22 #gosetup
GOPATH=/home/leo/go #gosetup
/usr/lib/go-1.22/bin/go build -o /home/leo/.cache/JetBrains/GoLand2024.3/tmp/GoLand/___go_build_github_com_apache_fury_go_fury_main github.com/apache/fury/go/fury/main #gosetup
/home/leo/.cache/JetBrains/GoLand2024.3/tmp/GoLand/___go_build_github_com_apache_fury_go_fury_main #gosetup
panic: type of id 29 not supported, supported types: map[1:bool 2:uint8 3:int8 5:int16 7:int32 9:int64 11:float32 12:float64 13:string 14:[]uint8 16:fury.Date 18:time.Time 25:[]interface {} 30:map[interface {}]interface {} 257:fury.GenericSet 258:[]bool 259:[]int16 260:[]int32 261:[]int64 262:[]float32 263:[]float64 264:[]string]
goroutine 1 [running]:
main.deserialize()
/home/leo/projects/furygo/main/main.go:54 +0x185
main.main()
/home/leo/projects/furygo/main/main.go:37 +0xf
Process finished with the exit code 2
I can roughly see that it's a type mismatch error, and then I went and compared the type id declared in furygo's type.go with the definition in the guide(xlang_type_mapping), and there seems to be some discrepancies, and I'm a little confused about these conflicts, or am I using it incorrectly?
What did you expect to see?
furygo deserialized object successfully
What did you see instead?
unsupported type error
Anything Else?
No response
Are you willing to submit a PR?
I'm willing to submit a PR!
The text was updated successfully, but these errors were encountered:
Hi @LouisLou2 , which fury java version are you using? We are refactoring the xlang serialization spec. The first part of Fury java has been finished in #1690 , but the golang implementation has not be finished. Is this related to your issue?
Search before asking
Version
I'm using XLANG mode on both ends, but go still doesn't deserialize java serialized objects correctly!
Component(s)
Go
Minimal reproduce step
here is my trail. and please Let me know if I'm making some kind of cheap mistake.
My First Trial
java
go
The result is that bytes can be successfully deserialized in java but gives a strange error in go.
go console
Second Trial
Next I went to discover the difference in the logic of the deserialization code between the two.
And then realized that in the go code there is one more part than in the java
go
java
I tried commenting out the code that reads an additional 4+4=8 bytes and then re-running the go code, however, a new error occurs
I can roughly see that it's a type mismatch error, and then I went and compared the type id declared in furygo's
type.go
with the definition in the guide(xlang_type_mapping), and there seems to be some discrepancies, and I'm a little confused about these conflicts, or am I using it incorrectly?What did you expect to see?
furygo deserialized object successfully
What did you see instead?
unsupported type error
Anything Else?
No response
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: