https://bugs.kde.org/show_bug.cgi?id=392223

Sergio Martins <smart...@kde.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Latest Commit|                            |https://commits.kde.org/cla
                   |                            |zy/d6cb7569816ce11160a2eeeb
                   |                            |d58a92a345b59f70
         Resolution|---                         |FIXED
             Status|CONFIRMED                   |RESOLVED

--- Comment #11 from Sergio Martins <smart...@kde.org> ---
Git commit d6cb7569816ce11160a2eeebd58a92a345b59f70 by Sergio Martins.
Committed on 22/09/2018 at 19:25.
Pushed by smartins into branch '1.3'.

Workaround crash with LLVM 7

If clazy is compiled with clang instead of gcc it might crash with:

==10637== Process terminating with default action of signal 11 (SIGSEGV):
dumping core
==10637==  Access not within mapped region at address 0x8
==10637==    at 0x19CDD8C:
clang::ast_matchers::MatchFinder::MatchFinder(clang::ast_matchers::MatchFinder::MatchFinderOptions)
(in /usr/lib/llvm-7/bin/clang)
==10637==    by 0x9D75670: ClazyASTConsumer (Clazy.cpp:62)
==10637==    by 0x9D75670:
ClazyASTAction::CreateASTConsumer(clang::CompilerInstance&, llvm::StringRef)
(Clazy.cpp:183)
==10637==    by 0x9E29ED:
clang::FrontendAction::CreateWrappedASTConsumer(clang::CompilerInstance&,
llvm::StringRef) (in /usr/lib/llvm-7/bin/clang)
==10637==    by 0x9E8FCA:
clang::FrontendAction::BeginSourceFile(clang::CompilerInstance&,
clang::FrontendInputFile const&) (in /usr/lib/llvm-7/bin/clang)
==10637==    by 0x9AE3D5:
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (in
/usr/lib/llvm-7/bin/clang)
==10637==    by 0xA8C9FA:
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (in
/usr/lib/llvm-7/bin/clang)
==10637==    by 0x5822C7: cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (in /usr/lib/llvm-7/bin/clang)
==10637==    by 0x571ACC: main (in /usr/lib/llvm-7/bin/clang)

After debugging clazy and clang's code I couldn't find anything wrong with it.
Valgrind's output doesn't make much sense, and simply compiling the Clazy.cpp
translation unit with gcc instead of clang makes the crash go away and
valgrind's output is clean.

I'm assuming debian's LLVM was built with gcc and building clazy with clang
will have some sort of incompatibility, or maybe it's simply a clang bug.

The downside of this workaround is that qcolor-literal check will be disabled.
Next step will be producing a minimal test case and reporting to LLVM.
CCMAIL: woebbek...@kde.org

M  +6    -0    CMakeLists.txt
M  +7    -0    src/Clazy.cpp

https://commits.kde.org/clazy/d6cb7569816ce11160a2eeebd58a92a345b59f70

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to