[LLVMbugs] [Bug 22398] New: stack-overflow in clang (computeLVForDecl) on 2-line input

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jan 29 20:57:26 PST 2015


http://llvm.org/bugs/show_bug.cgi?id=22398

            Bug ID: 22398
           Summary: stack-overflow in clang (computeLVForDecl) on 2-line
                    input
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: kcc at google.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

found by fuzzing, not sure if this is too interesting. 
Here we have either very deep or infinite recursion. 

intint foo(struct foo;) { foo(/^) {r?e r;
vk/


% clang++ -c a.cc

==36882==ERROR: AddressSanitizer: stack-overflow on address 0x7fffeac06f80 (pc
0x00000169ab44 bp 0x7fffeac07030 sp 0x7fffeac06f40 T0)
    #0 0x169ab43 in clang::Redeclarable<clang::FunctionDecl>::getFirstDecl()
const tools/clang/include/clang/AST/Redeclarable.h:149
    #1 0x3283fbb in getLVForNamespaceScopeDecl(clang::NamedDecl const*,
LVComputationKind) tools/clang/lib/AST/Decl.cpp:620:9
    #2 0x3236679 in computeLVForDecl(clang::NamedDecl const*,
LVComputationKind) tools/clang/lib/AST/Decl.cpp:1275:12
    #3 0x323a32b in getLVForDecl tools/clang/lib/AST/Decl.cpp:1314:22
    #4 0x323a32b in getLVForDecl tools/clang/lib/AST/Decl.cpp:1351
    #5 0x323a32b in getLVForLocalDecl tools/clang/lib/AST/Decl.cpp:1198
    #6 0x323a32b in computeLVForDecl(clang::NamedDecl const*,
LVComputationKind) tools/clang/lib/AST/Decl.cpp:1299
    #7 0x323f3d8 in getLVForDecl tools/clang/lib/AST/Decl.cpp:1314:22
    #8 0x323f3d8 in getLVForDecl tools/clang/lib/AST/Decl.cpp:1351
    #9 0x323f3d8 in clang::NamedDecl::getLinkageInternal() const
tools/clang/lib/AST/Decl.cpp:1024
    #10 0x383b355 in computeCachedProperties
tools/clang/lib/AST/Type.cpp:2192:17
    #11 0x383b355 in clang::TypePropertyCache<(anonymous
namespace)::Private>::ensure(clang::Type const*)
tools/clang/lib/AST/Type.cpp:2144
    #12 0x383bac3 in get tools/clang/lib/AST/Type.cpp:2123:5
    #13 0x383bac3 in get tools/clang/lib/AST/Type.cpp:2119
    #14 0x383bac3 in computeCachedProperties tools/clang/lib/AST/Type.cpp:2229
    #15 0x383bac3 in clang::TypePropertyCache<(anonymous
namespace)::Private>::ensure(clang::Type const*)
tools/clang/lib/AST/Type.cpp:2144
    #16 0x383a581 in clang::TypePropertyCache<(anonymous
namespace)::Private>::ensure(clang::Type const*)
tools/clang/lib/AST/Type.cpp:2136:7
    #17 0x383a3da in clang::Type::getLinkage() const
tools/clang/lib/AST/Type.cpp:2249:3
    #18 0x328664e in getLVForNamespaceScopeDecl(clang::NamedDecl const*,
LVComputationKind) tools/clang/lib/AST/Decl.cpp:764:11
    #19 0x3236679 in computeLVForDecl(clang::NamedDecl const*,
LVComputationKind) tools/clang/lib/AST/Decl.cpp:1275:12
    #20 0x323a32b in getLVForDecl tools/clang/lib/AST/Decl.cpp:1314:22
    #21 0x323a32b in getLVForDecl tools/clang/lib/AST/Decl.cpp:1351
    #22 0x323a32b in getLVForLocalDecl tools/clang/lib/AST/Decl.cpp:1198
    #23 0x323a32b in computeLVForDecl(clang::NamedDecl const*,
LVComputationKind) tools/clang/lib/AST/Decl.cpp:1299
    #24 0x323f3d8 in getLVForDecl tools/clang/lib/AST/Decl.cpp:1314:22
    #25 0x323f3d8 in getLVForDecl tools/clang/lib/AST/Decl.cpp:1351
    #26 0x323f3d8 in clang::NamedDecl::getLinkageInternal() const
tools/clang/lib/AST/Decl.cpp:1024
    #27 0x383b355 in computeCachedProperties
tools/clang/lib/AST/Type.cpp:2192:17
    #28 0x383b355 in clang::TypePropertyCache<(anonymous
namespace)::Private>::ensure(clang::Type const*)
tools/clang/lib/AST/Type.cpp:2144
    #29 0x383bac3 in get tools/clang/lib/AST/Type.cpp:2123:5
    #30 0x383bac3 in get tools/clang/lib/AST/Type.cpp:2119
    #31 0x383bac3 in computeCachedProperties tools/clang/lib/AST/Type.cpp:2229
    #32 0x383bac3 in clang::TypePropertyCache<(anonymous
namespace)::Private>::ensure(clang::Type const*)
tools/clang/lib/AST/Type.cpp:2144
    #33 0x383a581 in clang::TypePropertyCache<(anonymous
namespace)::Private>::ensure(clang::Type const*)
tools/clang/lib/AST/Type.cpp:2136:7
    #34 0x383a3da in clang::Type::getLinkage() const
tools/clang/lib/AST/Type.cpp:2249:3
    #35 0x328664e in getLVForNamespaceScopeDecl(clang::NamedDecl const*,
LVComputationKind) tools/clang/lib/AST/Decl.cpp:764:11
    #36 0x3236679 in computeLVForDecl(clang::NamedDecl const*,
LVComputationKind) tools/clang/lib/AST/Decl.cpp:1275:12
    #37 0x323a32b in getLVForDecl tools/clang/lib/AST/Decl.cpp:1314:22
    #38 0x323a32b in getLVForDecl tools/clang/lib/AST/Decl.cpp:1351
    #39 0x323a32b in getLVForLocalDecl tools/clang/lib/AST/Decl.cpp:1198

<thousands more frames>

-- 
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/20150130/84e9f658/attachment.html>


More information about the llvm-bugs mailing list