Goshawk
Goshawk copied to clipboard
json 解析错误
检查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”
This seems to be a compatibility issue with C++, i will try to fix it.
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是通过辨别双引号的确定分割的,所以会解析错误,但我还不太清楚怎么修复这个问题,想请教一下有什么修复的思路吗,感觉挺多的项目都会遇到这个问题的
This seems to be a compatibility issue with C++, i will try to fix it.
使用工具检查https://github.com/DCMTK/dcmtk.git这个项目的时候可以复现这个问题