alibaba / alibaba/fastjson2

[BUG]fastjson2的JSON.parseObject, x86系统上跑没有问题,部署到了麒麟ARM报错

Open
#7,732 14 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

### 问题描述:fastjson2的JSON.parseObject, x86系统上跑没有问题,部署到了麒麟ARM报错
fastjson2,的JSON.parseObject, x86系统上跑没有问题,部署到了麒麟ARM报错:
错误1:
com.alibaba.fastjson2.JSONException: illegal fieldName input103, offset 84, character g, line 1, column 84, fastjson-version 2.0.61 {"expireTime":1785411580135,"ifRemindResetPassword":false,"ipaddr":"10.10.10.10","loginTime":1785409780135,"passwordExpiredDay":0,"permissions":["::*"],"sysUser":{"admin":true,"apiCall":0,"businessCatalogType":2,"isEnableSecurityDownload":0,"isSingleLogin":0,"limitSingleLogin":false,"ptzLockTime":1,"status":1,"telephone":"2asmPb/g4knm0thZtw==","tenantId":1,"tenantMgr":false,"userCode":"aaadmin","userId":12,"userLevel":3,"userName":"tt","userPassword":"9C5gafUuHPSOqYUzP4TksEOS8OhJo=","userType":3,"videoPlayConcurrent":50},"token":"0:aaadmin:0ecac3d2-3daeaa","userCode":"aaadmin","userid":12,"username":"tt"}
at com.alibaba.fastjson2.JSONReader.readFieldNameHashCodeError(JSONReader.java:6886) ~[fastjson2-2.0.63.jar:?]
at com.alibaba.fastjson2.JSONReaderUTF16.readFieldNameHashCode(JSONReaderUTF16.java:1194) ~[fastjson2-2.0.63.jar:?]
at com.alibaba.fastjson2.reader.ORG_2_13_LoginUser.readObject(Unknown Source) ~[?:?]
at com.alibaba.fastjson2.JSON.parseObject(JSON.java:992) ~[fastjson2-2.0.63.jar:?]

错误2:
com.alibaba.fastjson2.JSONException: expect ':', but 114, offset 690, character ", line 1, column 690, fastjson-version 2.0.61 {"auth":true,"broadcastPushAfterAck":false,"channelCount":0,"deviceId":"44444444","deviceType":3,"enableAudio":true,"expires":86400,"firmware":"V4.62.325","hostAddress":"10.20.30.11:606","ip":"10.20.30.11","isStoreGbDeviceAlarm":0,"keepaliveIntervalTime":60,"keepaliveTime":"2026-07-30 18:54:53","localIp":"10.20.30.145","manufacturer":"HIKVISION","mediaRouteId":1,"mobilePositionSubmissionInterval":5,"model":"DS-7616NX-I3","name":"DeepinMind","networkType":4,"password":"O11DE0OTg3 ","port":25606,"registerTime":"2026-07-30 08:37:46","sipGatewayGroupId":"sipRoute_1","sipGatewayRouteId":2,"sipServerId":"1","ssrcCheck":true,"streamMode":"TCP-PASSIVE","streamModeForParam":1,"subscribeCycleForAlarm":0,"subscribeCycleForCatalog":3600,"subscribeCycleForMobilePosition":0,"transport":"UDP","updateTime":"2026-07-30 18:54:53","useStatus":1,"vendorId":2}
at com.alibaba.fastjson2.JSONReaderUTF16.readFieldNameHashCode(JSONReaderUTF16.java:1234) ~[fastjson2-2.0.63.jar:?]
at com.alibaba.fastjson2.reader.ORG_6_39_Device.readObject(Unknown Source) ~[?:?]
at com.alibaba.fastjson2.JSON.parseObject(JSON.java:992) ~[fastjson2-2.0.63.jar:?]
at com.alibaba.fastjson2.JSONObject.parseObject(JSONObject.java:2184) ~[fastjson2-2.0.63.jar:?]

错误3:
com.alibaba.fastjson2.JSONException: expect ':', but 100, offset 2, character ", line 1, column 2, fastjson-version 2.0.61 {"id":2,"routeCode":"sipRoute_1","routeName":"信令路由1"}
at com.alibaba.fastjson2.JSONReaderUTF16.readFieldNameHashCode(JSONReaderUTF16.java:1234) ~[fastjson2-2.0.63.jar:?]
at com.alibaba.fastjson2.reader.ORG_209_3_SipRouteCache.readObject(Unknown Source) ~[?:?]
at com.alibaba.fastjson2.JSON.parseObject(JSON.java:992) ~[fastjson2-2.0.63.jar:?]

环境信息

OS信息: 麒麟ARM
JDK信息:JDK8
版本信息:fastjson2.0.63
springboot-2.6.15
tomcat-9.0.75

Contributor guide

Open the contributing guide

Research direction

Start with JSONReaderUTF16.java:1194 and :1234, JSONReader.java:6886, and the JSON.parseObject calls shown in the traces. Reproduce the three payloads on Kylin ARM with JDK 8 and compare against x86; done means the same inputs parse successfully without the reported field-name or colon errors.

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
Active
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.