alibaba / alibaba/fastjson2

[BUG] 2.0.57版本fieldName not support input type ARRAY -103, offset 107

Open
#3,556 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
4.4k
Forks
613
Avg merge
1d 22h
Merged PRs (30d)
6

Description

dubbo使用fastjson序列化时, 在2.0.57版本中报错fieldName not support input type ARRAY -103, offset 107,

我降为2.0.52和2.0.56版本测试是可以的

异常信息如下:
Caused by: org.apache.dubbo.common.serialize.SerializationException: com.alibaba.fastjson2.JSONException: fieldName not support input type ARRAY -103, offset 107
... 30 more
Caused by: com.alibaba.fastjson2.JSONException: fieldName not support input type ARRAY -103, offset 107
at com.alibaba.fastjson2.JSONReaderJSONB.readFieldNameHashCodeError(JSONReaderJSONB.java:1628) ~[fastjson2-2.0.57.jar:?]
at com.alibaba.fastjson2.JSONReaderJSONB.readFieldNameHashCode(JSONReaderJSONB.java:1530) ~[fastjson2-2.0.57.jar:?]
at com.alibaba.fastjson2.reader.ORG_12_4_Vector.readJSONBObject(Unknown Source) ~[?:?]
at com.alibaba.fastjson2.reader.FieldReaderObject.readFieldValueJSONB(FieldReaderObject.java:203) ~[fastjson2-2.0.57.jar:?]
at com.alibaba.fastjson2.reader.ObjectReaderAdapter.readFieldValue(ObjectReaderAdapter.java:506) ~[fastjson2-2.0.57.jar:?]
at com.alibaba.fastjson2.reader.ORG_11_5_PDU.readJSONBObject(Unknown Source) ~[?:?]
at com.alibaba.fastjson2.reader.ObjectReaderImplMap.readJSONBObject(ObjectReaderImplMap.java:386) ~[fastjson2-2.0.57.jar:?]
at com.alibaba.fastjson2.JSONB.parseObject(JSONB.java:569) ~[fastjson2-2.0.57.jar:?]
at org.apache.dubbo.common.serialize.fastjson2.FastJson2ObjectInput.readObject(FastJson2ObjectInput.java:122) ~[dubbo-3.2.17.jar:3.2.17]
at org.apache.dubbo.common.serialize.DefaultSerializationExceptionWrapper$ProxyObjectInput.readObject(DefaultSerializationExceptionWrapper.java:161) ~[dubbo-3.2.17.jar:3.2.17]
... 27 more

Contributor guide

Open the contributing guide

Research direction

Start with JSONReaderJSONB.java at readFieldNameHashCodeError and readFieldNameHashCode, then trace the JSONB.parseObject path shown in the stack trace through FieldReaderObject and ObjectReaderAdapter. Compare behavior between fastjson2 2.0.56 and 2.0.57 using an input containing an ARRAY field. Done means the reported deserialization exception is reproduced and the affected input can be handled correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.