alibaba / alibaba/arthas

watch 命令使用 json 格式时,容易出现 java.lang.StackOverflowError: null

Open
#3,095 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
37.5k
Forks
7.6k
Avg merge
1d 22h
Merged PRs (30d)
4

Description

原因是 fastjson2 序列化时死循环了:

```
2025-12-05 16:31:18 [detailAsyncActivityThread-1518] ERROR c.taobao.arthas.core.view.ObjectView -ObjectView draw error, object class: class java.util.ArrayList
java.lang.StackOverflowError: null
```

```
2025-12-05 16:53:39 [detailAsyncActivityThread-1518] ERROR c.taobao.arthas.core.view.ObjectView -ObjectView draw error, object class: class com.xxx.SkuV3DisplayReq
java.lang.StackOverflowError: null
at com.alibaba.arthas.deps.com.alibaba.fastjson2.writer.ObjectWriterAdapter.hasFilter(ObjectWriterAdapter.java:132)
at com.alibaba.arthas.deps.com.alibaba.fastjson2.writer.ObjectWriter3.write(ObjectWriter3.java:62)
at com.alibaba.arthas.deps.com.alibaba.fastjson2.writer.OWG_10_3_ForestDataReaderProxy.write(Unknown Source)
at com.alibaba.arthas.deps.com.alibaba.fastjson2.writer.FieldWriterObject.writeInternal(FieldWriterObject.java:377)
at com.alibaba.arthas.deps.com.alibaba.fastjson2.writer.FieldWriterObject.write(FieldWriterObject.java:248)
at com.alibaba.arthas.deps.com.alibaba.fastjson2.writer.ObjectWriter6.write(ObjectWriter6.java:79)
at com.alibaba.arthas.deps.com.alibaba.fastjson2.writer.OWG_12_6_BasicDomainReadServiceImpl.write(Unknown Source)
```

Contributor guide

Open the contributing guide

Research direction

Start with the watch command's JSON output path and the ObjectView component named in the error. Reproduce the StackOverflowError with the reported watch cases, then inspect the fastjson2 writer calls in the stack trace to identify the recursive object relationship. Done means watch JSON output completes without the serialization overflow, with coverage for the failure case.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
cli
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.