[llvm-bugs] [Bug 25363] New: [REGRESSION] against 3.6: parse + reparse cause crash

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Oct 31 06:50:41 PDT 2015


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

            Bug ID: 25363
           Summary: [REGRESSION] against 3.6: parse + reparse cause crash
           Product: clang
           Version: 3.7
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: libclang
          Assignee: unassignedclangbugs at nondot.org
          Reporter: dushistov at gmail.com
                CC: klimek at google.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 15197
  --> https://llvm.org/bugs/attachment.cgi?id=15197&action=edit
test to reproduce problem

The simple code like this:

 CXIndex  index = clang_createIndex(0, 1);
    CXTranslationUnit out_TU;

    auto error = clang_parseTranslationUnit2(index, argv[1],
                                             compile_args, sizeof(compile_args)
/ sizeof(compile_args[0]), nullptr, 0,
                                            
CXTranslationUnit_PrecompiledPreamble |
CXTranslationUnit_CacheCompletionResults
                                             |
CXTranslationUnit_SkipFunctionBodies
                                             , &out_TU);
    if (error == CXError_Crashed)
        printf("crashed..!\n");
    else
        printf("res: %d\n", int(error));

    clang_reparseTranslationUnit(out_TU, 0, nullptr,
clang_defaultReparseOptions(out_TU));

works fine with clang 3.6, but failed with 3.7, with such message:
clang::CXXConstructorDecl* clang::CXXConstructorDecl::getTargetConstructor()
const: Assertion `isDelegatingConstructor() && "Not a delegating constructor!"'
failed.

The git bisect show that commit that cause problem is:

Author: Richard Smith <richard-llvm at metafoo.co.uk>
Date:   Tue Mar 24 06:36:48 2015 +0000

    [modules] Deserialize CXXCtorInitializer list for a constructor lazily.

    Previously we'd deserialize the list of mem-initializers for a constructor
when
    we deserialized the declaration of the constructor. That could trigger a
    significant amount of unnecessary work (pulling in all base classes
    recursively, for a start) and was causing problems for the modules buildbot
due
    to cyclic deserializations. We now deserialize these on demand.

    This creates a certain amount of duplication with the handling of
    CXXBaseSpecifiers; I'll look into reducing that next.


    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233052
91177308-0d34-0410-b5e6-96231b3b80d8

To reproduce problem you need test_complete_at.cpp (see attachment),
and as input rtags/src/Source.cpp:

git clone https://github.com/Andersbakken/rtags.git 
git checkout c85d54789ceb44da701051de467208897ff750a4

I tried create preprocessed sources, but for some reason with preprocessed
sources bug not reproduced, command line to reproduce bug:

$./bin/test_complete_at /home/evgeniy/projects/study_ide/rtags/src/Source.cpp

Side note: if I comment CXTranslationUnit_SkipFunctionBodies in 
test_complete_at.cpp test start work without errors.

-- 
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/20151031/4d77dd0a/attachment.html>


More information about the llvm-bugs mailing list