alibaba / alibaba/fastjson2

[BUG]银河麒麟aarch64环境,2.0.58高并发,json解析异常,2.0.54没问题

Open
#3,763 9 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

### 问题描述
升级至2.0.58后,压测500并发出现json解析异常,出现异常之后,所有相关的json解析都会报错.

### 环境信息

- 版本信息:[e.g.:Fastjson2 2.0.58]

![Image](https://github.com/user-attachments/assets/a2d23d5a-d5e4-4f5a-ac60-cbe5644a5c1a)

### 重现步骤
*如何操作可以重现该问题:*
"{\"queryParam\":{},\"columnOrderParam\":[{\"field\":\"RTIME\",\"sortType\":\"DESC\"}],\"simpleQueryParam\":[],\"columnFilterParam\":[{\"field\":\"XXXX$USER_ID\",\"dateFormat\":\"\",\"value\":\"\",\"fieldValueRel\":\"like\",\"conditionRel\":\"and\",\"conditions\":[{\"expression\":\"eq\",\"value\":\"77c21b37d87e457e8669508310420ed7\"},{\"expression\":\"eq\",\"value\":\"\"}]}]}"
1. 使用 `xxx.xxx` 方法
2. 输入 `...` 数据
3. 出现 `...` 错误
```java
JSON.parseObject(methodParams, new TypeReference>() { });
```

### 期待的正确结果
*对您期望发生的结果进行清晰简洁的描述。*

### 相关日志输出
com.alibaba.fastjson2.JSONException: illegal input, offset 199, character ", line 1, column 199, fastjson-version 2.0.58 {"queryParam":{},"columnOrderParam":[{"field":"RTIME","sortType":"DESC"}],"simpleQueryParam":[],"columnFilterParam":[{"field":"XXXXX$USER_ID","dateFormat":"","value":"","fieldValueRel":"like","conditionRel":"and","conditions":[{"expression":"eq","value":"77c21b37d87e457e8669508310420ed7"},{"expression":"eq","value":""}]}]}
at com.alibaba.fastjson2.JSONReader.readFieldNameUnquote(JSONReader.java:677)
at com.alibaba.fastjson2.JSONReader.readObject(JSONReader.java:2420)
at com.alibaba.fastjson2.JSONReader.readArray(JSONReader.java:2735)
at com.alibaba.fastjson2.reader.ObjectReaderImplObject.readObject(ObjectReaderImplObject.java:289)
at com.alibaba.fastjson2.reader.ObjectReaderImplMapTyped.readObject(ObjectReaderImplMapTyped.java:408)
at com.alibaba.fastjson2.JSON.parseObject(JSON.java:1100)

#### 附加信息
*如果你还有其他需要提供的信息,可以在这里填写(可以提供截图、视频等)。*

Contributor guide

Open the contributing guide

Research direction

Start with JSON.parseObject and the stack-trace path through JSONReader.readFieldNameUnquote, readObject, and readArray. Reproduce the reported 500-concurrent parsing workload on aarch64 with fastjson2 2.0.58 and compare it with 2.0.54. Done means the supplied JSON parses reliably without subsequent related parsing failures and the regression is covered by a test.

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
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.