Skip to content
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

json 解析错误 #15

Open
ChenhuaYang opened this issue Jun 13, 2023 · 3 comments
Open

json 解析错误 #15

ChenhuaYang opened this issue Jun 13, 2023 · 3 comments

Comments

@ChenhuaYang
Copy link

检查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”

@Yunlongs
Copy link
Owner

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

@yinluming13579
Copy link

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
Copy link

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants