Skip to content

[BUG] fastjson2 jsonb Type seeAlso反序列化导致JVM崩溃 #3440

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
zhonghongfly opened this issue Mar 24, 2025 · 5 comments
Closed

[BUG] fastjson2 jsonb Type seeAlso反序列化导致JVM崩溃 #3440

zhonghongfly opened this issue Mar 24, 2025 · 5 comments
Labels
bug Something isn't working fixed
Milestone

Comments

@zhonghongfly
Copy link

问题描述

fastjson2 通过注解JSONType#seeAlso配置类型别名,使用JSONB.toBytes()序列化数据后,再使用JSONB.parseObject() 反序列化导致JVM崩溃

环境信息

  • OS信息: macOS 15.3.2 M1 16 GB
  • JDK信息: oracle jdk 1.8.0_275
  • 版本信息:Fastjson2 2.0.56

重现步骤

复现代码

fastjson2_test.zip

期待的正确结果

对您期望发生的结果进行清晰简洁的描述。

相关日志输出

hs_err_pid94413.log

附加信息

@zhonghongfly zhonghongfly added the bug Something isn't working label Mar 24, 2025
@wenshao
Copy link
Member

wenshao commented Mar 25, 2025

https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.57-SNAPSHOT/
能帮忙用2.0.57-SNAPSHOT版本验证问题是否修复么?

@wenshao wenshao added this to the 2.0.57 milestone Mar 25, 2025
@zhonghongfly
Copy link
Author

https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.57-SNAPSHOT/ 能帮忙用2.0.57-SNAPSHOT版本验证问题是否修复么?

使用最新快照fastjson2-2.0.57-20250321.052620-63.jar,问题依然存在

@zhonghongfly
Copy link
Author

@wenshao 您好,我研究了一下fastjson2的代码,目前fastjson2 jsonb不支持Type seeAlso指定TypeKey,查看了master分支关于SeeAlso的单元测试,没有覆盖jsonb seeAlso指定TypeKey的情况

@wenshao
Copy link
Member

wenshao commented Mar 29, 2025

已经修复,请帮忙用新的快照帮忙在验证下

@wenshao wenshao added the fixed label Mar 29, 2025
@wenshao
Copy link
Member

wenshao commented Mar 31, 2025

https://github.com/alibaba/fastjson2/releases/tag/2.0.57
问题已修复,请用新版本

@wenshao wenshao closed this as completed Mar 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed
Projects
None yet
Development

No branches or pull requests

2 participants