[llvm-bugs] [Bug 34484] New: libclang crashes with segmentation fault with python bindings

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Sep 5 13:38:28 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=34484

            Bug ID: 34484
           Summary: libclang crashes with segmentation fault with python
                    bindings
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: libclang
          Assignee: unassignedclangbugs at nondot.org
          Reporter: sagi at auroralabs.com
                CC: klimek at google.com, llvm-bugs at lists.llvm.org

The full description can be found here :
https://stackoverflow.com/questions/45901636/python-clang-crashes-with-segmentation-fault

While trying to traverse clang AST using python-clang bindings on bitcoin
opensource project. libclang crashes with segmentation fault.
At start I used libclang version 3.8 but it happens with versions 3.9, 4.0, 5.0
and 6.0 (6.0~svn312460-1~exp1)

backtrace :

#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 at entry=0x7ffe35f45470, ND=ND at entry=0x7f9ec0092cc8, Name=..., 
    AdditionalAbiTags=AdditionalAbiTags at 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 at entry=0x7ffe35f45470, D=D at entry=0x7f9ec0092cc8,
AdditionalAbiTags=AdditionalAbiTags at entry=0x7ffe35f453c0, 
    ExcludeUnqualifiedName=ExcludeUnqualifiedName at 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 at entry=0x7ffe35f45470, ND=ND at entry=0x7f9ec0092cc8, 
    AdditionalAbiTags=AdditionalAbiTags at entry=0x7ffe35f453c0,
ExcludeUnqualifiedName=ExcludeUnqualifiedName at 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

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170905/ba7a545e/attachment-0001.html>


More information about the llvm-bugs mailing list