alibaba / alibaba/fastjson2

[BUG]IOUtils在使用JIT会出现解析错误

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

Description

### 问题描述
当前频繁调用JSON.parseObject(jsonStr)解析(json中又嵌套)时出现com.alibaba.fastjson2.JSONException: offset 33, character

### 环境信息
*请填写以下信息:*

- OS信息: [ kylin arrach64]
- JDK信息: [e.g.:Openjdk 1.8.0_392]
- 版本信息:[e.g.:Fastjson2 2.0.64]

### 重现步骤
单线程,100次解析,json越复杂越容易复现

单线程测试完成,报错次数: 0 (预期为 0)

========== 开始多线程并发测试 ==========
线程已就绪,1秒后同时发起并发解析...
【并发报错】线程 7 第 3 次解析失败!
异常类型: com.alibaba.fastjson2.JSONException
异常信息: invalid escape character EOI, offset 15, character ", line 1, column 15, fastjson-version 2.0.64 {"JOB_PARAMS":"[{\"jobId\":680010,\"jobObject\":\"0\",\"jobObjectType\":\"81\",\"objectEnable\":1,\"priIndex\":1,\"xxxx\":[]}]"}

### 期待的正确结果
正常解析

### 相关日志输出
*请复制并粘贴任何相关的日志输出。*

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

Contributor guide

Open the contributing guide

Research direction

Start with the JSON.parseObject entry point and reproduce the nested-JSON case on Kylin aarch64, comparing the single-thread and concurrent tests described in the issue. Investigate why repeated parsing under JIT produces an invalid escape character error; done means the concurrent test completes with zero parse failures.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend-api-design
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.