[clazy] [Bug 435615] New: Reproducible crash within clang when attempting to check Akonadi

Jonathan Marten bugzilla_noreply at kde.org
Sun Apr 11 14:56:34 BST 2021


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

            Bug ID: 435615
           Summary: Reproducible crash within clang when attempting to
                    check Akonadi
           Product: clazy
           Version: unspecified
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: unassigned-bugs at kde.org
          Reporter: jjm at keelhaul.me.uk
                CC: smartins at kde.org
  Target Milestone: ---

SUMMARY

When using clazy with Clang 11 to check Akonadi source, with the default
checking options as suggested in clazy's README.md, a segfault happens
triggered by the regexp in OldStyleConnect::VisitMacroExpands().  This happens
both with clazy 1.9 and master branch (1.10), at the same build stage every
time.

The full log file is attached due to its size, but the relevant part is:

1.      /usr/include/qt5/QtWidgets/qheaderview.h:259: current parser token
'Q_PRIVATE_SLOT'
2.      /usr/include/qt5/QtWidgets/qheaderview.h:53: parsing struct/union/class
body 'QHeaderView'
 #0 0x00007fbd6be00dcd
(/usr/lib/llvm/11/bin/../lib64/libLLVM-11libcxx.so+0x8eadcd)
 #1 0x00007fbd6bdfed50 llvm::sys::RunSignalHandlers()
(/usr/lib/llvm/11/bin/../lib64/libLLVM-11libcxx.so+0x8e8d50)                    
 #2 0x00007fbd6be002dd llvm::sys::CleanupOnSignal(unsigned long)
(/usr/lib/llvm/11/bin/../lib64/libLLVM-11libcxx.so+0x8ea2dd)                    
 #3 0x00007fbd6bd43180
(/usr/lib/llvm/11/bin/../lib64/libLLVM-11libcxx.so+0x82d180)
 #4 0x00007fbd6b2672b0 (/lib64/libc.so.6+0x392b0)
 #5 0x00007fbd6b267204 raise (/lib64/libc.so.6+0x39204)
 #6 0x00007fbd6b250547 abort (/lib64/libc.so.6+0x22547)
 #7 0x00007fbd69060166 (/usr/kde5/lib64/ClazyPlugin.so+0xb4166)
 #8 0x00007fbd6905ffaf (/usr/kde5/lib64/ClazyPlugin.so+0xb3faf)
 #9 0x00007fbd690653a0 bool std::__1::basic_regex<char,
std::__1::regex_traits<char>
>::__search<std::__1::allocator<std::__1::sub_match<char const*> > >(char
const*, char const*, std::__1::match_results<char const*,
std::__1::allocator<std::__1::sub_match<char const*> > >&,
std::__1::regex_constants::match_flag_type) const
/usr/include/c++/v1/regex:5948                                                  
#10 0x00007fbd690ae3b9 bool std::__1::regex_search<char const*,
std::__1::allocator<std::__1::sub_match<std::__1::__wrap_iter<char const*> > >,
char, std::__1::regex_traits<char> >(std::__1::__wrap_iter<char const*>,
std::__1::__wrap_iter<char const*>,
std::__1::match_results<std::__1::__wrap_iter<char const*>,
std::__1::allocator<std::__1::sub_match<std::__1::__wrap_iter<char const*> > >
>&, std::__1::basic_regex<char, std::__1::regex_traits<char> > const&,
std::__1::regex_constants::match_flag_type) /usr/include/c++/v1/regex:6004      
#11 0x00007fbd690ae3b9 bool std::__1::regex_match<std::__1::__wrap_iter<char
const*>, std::__1::allocator<std::__1::sub_match<std::__1::__wrap_iter<char
const*> > >, char, std::__1::regex_traits<char> >(std::__1::__wrap_iter<char
const*>, std::__1::__wrap_iter<char const*>,
std::__1::match_results<std::__1::__wrap_iter<char const*>,
std::__1::allocator<std::__1::sub_match<std::__1::__wrap_iter<char const*> > >
>&, std::__1::basic_regex<char, std::__1::regex_traits<char> > const&,
std::__1::regex_constants::match_flag_type) /usr/include/c++/v1/regex:6106      
#12 0x00007fbd690ae3b9 bool std::__1::regex_match<std::__1::char_traits<char>,
std::__1::allocator<char>,
std::__1::allocator<std::__1::sub_match<std::__1::__wrap_iter<char const*> > >,
char, std::__1::regex_traits<char> >(std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> > const&,
std::__1::match_results<std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> >::const_iterator,
std::__1::allocator<std::__1::sub_match<std::__1::__wrap_iter<char const*> > >
>&, std::__1::basic_regex<char, std::__1::regex_traits<char> > const&,
std::__1::regex_constants::match_flag_type) /usr/include/c++/v1/regex:6148      
#13 0x00007fbd690ae3b9 OldStyleConnect::VisitMacroExpands(clang::Token const&,
clang::SourceRange const&, clang::MacroInfo const*)
/ws/frameworks/sdk/clazy/src/checks/level2/old-style-connect.cpp:286       
#14 0x00007fbd690e043b ClazyPreprocessorCallbacks::MacroExpands(clang::Token
const&, clang::MacroDefinition const&, clang::SourceRange, clang::MacroArgs
const*) /ws/frameworks/sdk/clazy/src/checkbase.cpp:65
#15 0x00007fbd6f6cd475
(/usr/lib/llvm/11/bin/../lib64/libclang-cpp.so.11.1+0x9b3475)
#16 0x00007fbd6f6ead05
clang::Preprocessor::HandleMacroExpandedIdentifier(clang::Token&,
clang::MacroDefinition const&)
(/usr/lib/llvm/11/bin/../lib64/libclang-cpp.so.11.1+0x9d0d05)                   
#17 0x00007fbd6f7070fc clang::Preprocessor::HandleIdentifier(clang::Token&)
(/usr/lib/llvm/11/bin/../lib64/libclang-cpp.so.11.1+0x9ed0fc)                   
#18 0x00007fbd6f6a19e7 clang::Lexer::LexIdentifier(clang::Token&, char const*)
(/usr/lib/llvm/11/bin/../lib64/libclang-cpp.so.11.1+0x9879e7)                   

STEPS TO REPRODUCE
1. Run clazy over current Akonadi source, observe crash above

SOFTWARE/OS VERSIONS
Operating System: Gentoo
KDE Plasma Version: 5.21.80
KDE Frameworks Version: 5.81.0
Qt Version: 5.15.2
Kernel Version: 5.4.97-gentoo-x86_64 (64-bit)
Graphics Platform: X11
Processors: 3 × AMD Phenom(tm) II X3 705e Processor

clang version 11.1.0
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/11/bin

ADDITIONAL INFORMATION

This is using the Clang runtime (libcxx, libcxxabi, libunwind).
System, Qt and Frameworks are all compiled with Clang.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Unassigned-bugs mailing list