Goshawk icon indicating copy to clipboard operation
Goshawk copied to clipboard

json 解析错误

Open ChenhuaYang opened this issue 1 year ago • 3 comments

检查redis-stable版本,parse_call_graph.py第53行caller_funcname = json.loads(caller.strip())["funcname"]报错:

json.decoder.JSONDecodeError: Expecting ',' delimiter: line 1 column

caller.strip()输入内容为:

{"return_type": "class std::basic_string<char>", "funcname": "std::string_literals::operator""s", "params": "const char *@__str,unsigned long@__len,", "file" :"/usr/lib/gcc/aarch64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/basic_string.h", "begin": [6660, 5], "end": [6663, 48]}

其中funcname多余末尾“s”

ChenhuaYang avatar Jun 13 '23 15:06 ChenhuaYang

This seems to be a compatibility issue with C++, i will try to fix it.

Yunlongs avatar Jun 14 '23 02:06 Yunlongs

This seems to be a compatibility issue with C++, i will try to fix it.

你好!我在跑一些项目的时候也遇到了这个问题,我检查了一下应该是/usr/lib/gcc/aarch64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/basic_string.h的这个文件里面有的函数就叫std::string_literals::operator""s这个名字,CSA的getnameasstring打印的没错,但在json.loads的时候json是通过辨别双引号的确定分割的,所以会解析错误,但我还不太清楚怎么修复这个问题,想请教一下有什么修复的思路吗,感觉挺多的项目都会遇到这个问题的

yinluming13579 avatar Mar 12 '24 07:03 yinluming13579

This seems to be a compatibility issue with C++, i will try to fix it.

使用工具检查https://github.com/DCMTK/dcmtk.git这个项目的时候可以复现这个问题

yinluming13579 avatar Mar 12 '24 07:03 yinluming13579