Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/151.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/oracle/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
python铿锵崩溃,出现分段错误_Python_C++_Clang_Abstract Syntax Tree_Bitcoin - Fatal编程技术网

python铿锵崩溃,出现分段错误

python铿锵崩溃,出现分段错误,python,c++,clang,abstract-syntax-tree,bitcoin,Python,C++,Clang,Abstract Syntax Tree,Bitcoin,我有以下简单的python代码,它使用libclang python绑定遍历AST,不幸的是,它因分段错误而崩溃。 我使用的是python2.7,并尝试了以下所有的clang版本3.8、3.9、4.0、5.0、6.0(当然,每个版本都使用了正确的python clang绑定) 回溯: #0 clang::TagType::getDecl (this=0x0) at /build/llvm-toolchain-3.8-_PD09B/llvm-toolchain-3.8-3.8/tools/cla

我有以下简单的python代码,它使用libclang python绑定遍历AST,不幸的是,它因分段错误而崩溃。 我使用的是python2.7,并尝试了以下所有的clang版本3.8、3.9、4.0、5.0、6.0(当然,每个版本都使用了正确的python clang绑定)

回溯:

#0  clang::TagType::getDecl (this=0x0) at /build/llvm-toolchain-3.8-_PD09B/llvm-toolchain-3.8-3.8/tools/clang/lib/AST/Type.cpp:2962
#1  0x00007f9ecbe65caf in clang::RecordType::getDecl (this=<optimized out>) at /build/llvm-toolchain-3.8-_PD09B/llvm-toolchain-3.8-3.8/tools/clang/include/clang/AST/Type.h:3554
#2  (anonymous namespace)::CXXNameMangler::mangleUnqualifiedName (this=this@entry=0x7ffe35f45470, ND=ND@entry=0x7f9ec0092cc8, Name=..., 
    AdditionalAbiTags=AdditionalAbiTags@entry=0x7ffe35f453c0, KnownArity=4294967295)
    at /build/llvm-toolchain-3.8-_PD09B/llvm-toolchain-3.8-3.8/tools/clang/lib/AST/ItaniumMangle.cpp:1184
#3  0x00007f9ecbe60250 in (anonymous namespace)::CXXNameMangler::mangleUnqualifiedName (AdditionalAbiTags=0x7ffe35f453c0, ND=<optimized out>, this=0x7ffe35f45470)
    at /build/llvm-toolchain-3.8-_PD09B/llvm-toolchain-3.8-3.8/tools/clang/lib/AST/ItaniumMangle.cpp:481
#4  (anonymous namespace)::CXXNameMangler::mangleLocalName (this=this@entry=0x7ffe35f45470, D=D@entry=0x7f9ec0092cc8, AdditionalAbiTags=AdditionalAbiTags@entry=0x7ffe35f453c0, 
    ExcludeUnqualifiedName=ExcludeUnqualifiedName@entry=false) at /build/llvm-toolchain-3.8-_PD09B/llvm-toolchain-3.8-3.8/tools/clang/lib/AST/ItaniumMangle.cpp:1471
#5  0x00007f9ecbe607b7 in (anonymous namespace)::CXXNameMangler::mangleNameWithAbiTags (this=this@entry=0x7ffe35f45470, ND=ND@entry=0x7f9ec0092cc8, 
    AdditionalAbiTags=AdditionalAbiTags@entry=0x7ffe35f453c0, ExcludeUnqualifiedName=ExcludeUnqualifiedName@entry=false)
    at /build/llvm-toolchain-3.8-_PD09B/llvm-toolchain-3.8-3.8/tools/clang/lib/AST/ItaniumMangle.cpp:801
#6  0x00007f9ecbe61621 in (anonymous namespace)::CXXNameMangler::mangleName (this=0x7ffe35f45470, ND=0x7f9ec0092cc8, ExcludeUnqualifiedName=<optimized out>)
    at /build/llvm-toolchain-3.8-_PD09B/llvm-toolchain-3.8-3.8/tools/clang/lib/AST/ItaniumMangle.cpp:776
#7  0x00007f9ecbe62822 in (anonymous namespace)::ItaniumMangleContextImpl::mangleCXXName (this=<optimized out>, D=0x7f9ec0092cc8, Out=...)
    at /build/llvm-toolchain-3.8-_PD09B/llvm-toolchain-3.8-3.8/tools/clang/lib/AST/ItaniumMangle.cpp:4422
#8  0x00007f9ecbd4df6b in clang_Cursor_getMangling (C=...) at /build/llvm-toolchain-3.8-_PD09B/llvm-toolchain-3.8-3.8/tools/clang/tools/libclang/CIndex.cpp:3996
#9  0x00007f9eccbd2e40 in ffi_call_unix64 () from /usr/lib/x86_64-linux-gnu/libffi.so.6
#10 0x00007f9eccbd28ab in ffi_call () from /usr/lib/x86_64-linux-gnu/libffi.so.6
#0 clang::TagType::getDecl(this=0x0)at/build/llvm-toolchain-3.8-_PD09B/llvm-toolchain-3.8-3.8/tools/clang/lib/AST/Type.cpp:2962
#位于/build/llvm-toolchain-3.8-_PD09B/llvm-toolchain-3.8-3.8/tools/clang/include/clang/AST/Type.h的1 0x00007f9ecbe65caf
#2(匿名名称空间)::CXXNameMangler::mangleUnqualifiedName(此名称)=this@entry=0x7ffe35f45470,ND=ND@entry=0x7f9ec0092cc8,名称=。。。,
附加标签=AdditionalAbiTags@entry=0x7ffe35f453c0,知晓率=4294967295)
at/build/llvm-toolchain-3.8-_PD09B/llvm-toolchain-3.8-3.8/tools/clang/lib/AST/ItaniumMangle.cpp:1184
#3 0x00007f9ecbe60250 in(匿名命名空间)::CXXNameMangler::mangleUnqualifiedName(AdditionalAbiTags=0x7ffe35f453c0,ND=,this=0x7ffe35f45470)
at/build/llvm-toolchain-3.8-_PD09B/llvm-toolchain-3.8-3.8/tools/clang/lib/AST/ItaniumMangle.cpp:481
#4(匿名命名空间)::CXXNameMangler::mangleLocalName(此=this@entry=0x7ffe35f45470,D=D@entry=0x7f9ec0092cc8,附加标签=AdditionalAbiTags@entry=0x7ffe35f453c0,
ExcludeUnqualifiedName=ExcludeUnqualifiedName@entry=false)at/build/llvm-toolchain-3.8-_PD09B/llvm-toolchain-3.8-3.8/tools/clang/lib/AST/ItaniumMangle.cpp:1471
#5 0x00007f9ecbe607b7 in(匿名命名空间)::CXXNameMangler::mangleNameWithAbiTags(此=this@entry=0x7ffe35f45470,ND=ND@entry=0x7f9ec0092cc8,
附加标签=AdditionalAbiTags@entry=0x7ffe35f453c0,不包括不合格的名称=ExcludeUnqualifiedName@entry=假)
at/build/llvm-toolchain-3.8-_PD09B/llvm-toolchain-3.8-3.8/tools/clang/lib/AST/ItaniumMangle.cpp:801
#(匿名命名空间)中的6 0x00007f9ecbe61621::CXXNameMangler::mangleName(this=0x7ffe35f45470,ND=0x7f9ec0092cc8,ExcludeUnqualifiedName=)
at/build/llvm-toolchain-3.8-_PD09B/llvm-toolchain-3.8-3.8/tools/clang/lib/AST/ItaniumMangle.cpp:776
#7 0x00007f9ecbe62822 in(匿名命名空间)::ItaniumangleContextImpl::MangleCxName(this=,D=0x7f9ec0092cc8,Out=…)
at/build/llvm-toolchain-3.8-_PD09B/llvm-toolchain-3.8-3.8/tools/clang/lib/AST/ItaniumMangle.cpp:4422
#8 0x00007f9ecbd4df6b在/build/llvm-toolchain-3.8-\u PD09B/llvm-toolchain-3.8/tools/clang/tools/libclang/CIndex.cpp处的clang_光标(C=…)中
#9 0x00007f9eccbd2e40在/usr/lib/x86\u 64-linux-gnu/libffi.so.6的ffi\u调用unix64()中
#来自/usr/lib/x86_64-linux-gnu/libffi.so.6的ffi_调用()中的10 0x00007f9eccbd28ab
我正在github的比特币源代码上运行python代码,此回溯用于文件src/bitcoin-cli.cpp

知道它为什么会崩溃吗?
谢谢,Sagi

我发现node.mangled_name导致了崩溃。

这看起来像是一个bug,正在这里跟踪:

使用最新的libclang.so:clang.cindex.Config.set_library_文件('/usr/lib/llvm-6.0/lib/libclang.so')仍然是libclang 7的问题。
#0  clang::TagType::getDecl (this=0x0) at /build/llvm-toolchain-3.8-_PD09B/llvm-toolchain-3.8-3.8/tools/clang/lib/AST/Type.cpp:2962
#1  0x00007f9ecbe65caf in clang::RecordType::getDecl (this=<optimized out>) at /build/llvm-toolchain-3.8-_PD09B/llvm-toolchain-3.8-3.8/tools/clang/include/clang/AST/Type.h:3554
#2  (anonymous namespace)::CXXNameMangler::mangleUnqualifiedName (this=this@entry=0x7ffe35f45470, ND=ND@entry=0x7f9ec0092cc8, Name=..., 
    AdditionalAbiTags=AdditionalAbiTags@entry=0x7ffe35f453c0, KnownArity=4294967295)
    at /build/llvm-toolchain-3.8-_PD09B/llvm-toolchain-3.8-3.8/tools/clang/lib/AST/ItaniumMangle.cpp:1184
#3  0x00007f9ecbe60250 in (anonymous namespace)::CXXNameMangler::mangleUnqualifiedName (AdditionalAbiTags=0x7ffe35f453c0, ND=<optimized out>, this=0x7ffe35f45470)
    at /build/llvm-toolchain-3.8-_PD09B/llvm-toolchain-3.8-3.8/tools/clang/lib/AST/ItaniumMangle.cpp:481
#4  (anonymous namespace)::CXXNameMangler::mangleLocalName (this=this@entry=0x7ffe35f45470, D=D@entry=0x7f9ec0092cc8, AdditionalAbiTags=AdditionalAbiTags@entry=0x7ffe35f453c0, 
    ExcludeUnqualifiedName=ExcludeUnqualifiedName@entry=false) at /build/llvm-toolchain-3.8-_PD09B/llvm-toolchain-3.8-3.8/tools/clang/lib/AST/ItaniumMangle.cpp:1471
#5  0x00007f9ecbe607b7 in (anonymous namespace)::CXXNameMangler::mangleNameWithAbiTags (this=this@entry=0x7ffe35f45470, ND=ND@entry=0x7f9ec0092cc8, 
    AdditionalAbiTags=AdditionalAbiTags@entry=0x7ffe35f453c0, ExcludeUnqualifiedName=ExcludeUnqualifiedName@entry=false)
    at /build/llvm-toolchain-3.8-_PD09B/llvm-toolchain-3.8-3.8/tools/clang/lib/AST/ItaniumMangle.cpp:801
#6  0x00007f9ecbe61621 in (anonymous namespace)::CXXNameMangler::mangleName (this=0x7ffe35f45470, ND=0x7f9ec0092cc8, ExcludeUnqualifiedName=<optimized out>)
    at /build/llvm-toolchain-3.8-_PD09B/llvm-toolchain-3.8-3.8/tools/clang/lib/AST/ItaniumMangle.cpp:776
#7  0x00007f9ecbe62822 in (anonymous namespace)::ItaniumMangleContextImpl::mangleCXXName (this=<optimized out>, D=0x7f9ec0092cc8, Out=...)
    at /build/llvm-toolchain-3.8-_PD09B/llvm-toolchain-3.8-3.8/tools/clang/lib/AST/ItaniumMangle.cpp:4422
#8  0x00007f9ecbd4df6b in clang_Cursor_getMangling (C=...) at /build/llvm-toolchain-3.8-_PD09B/llvm-toolchain-3.8-3.8/tools/clang/tools/libclang/CIndex.cpp:3996
#9  0x00007f9eccbd2e40 in ffi_call_unix64 () from /usr/lib/x86_64-linux-gnu/libffi.so.6
#10 0x00007f9eccbd28ab in ffi_call () from /usr/lib/x86_64-linux-gnu/libffi.so.6