Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-18941

Segmentation fault in CPlusPlus::Token::spell() when creating raw string literal

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Done
    • Affects Version/s: Qt Creator 4.4.0
    • Fix Version/s: Qt Creator 4.4.1
    • Component/s: C/C++/Obj-C++ Support
    • Labels:
      None
    • Environment:
      QtCreator 4.4.0, Qt 5.6.2 from online installer

      Debian 8 (jessie) amd64 with KDE

      ClangCodeModel plugin enabled

      Description

      I have attached example project (no need to build it), which has cpp file with line:

      QRegularExpressionValidator(QRegularExpression(QStringLiteral("[^\\s]+([^\\s]+[\\ ]?)*[^\\s]+")), parent){
      

      QtCreator crashes when placing text cursor before first quote " and typing R to start refactoring string into a raw string literal:

      Program received signal SIGSEGV, Segmentation fault.
      [Switching to Thread 0x7fd1937fe700 (LWP 21289)]
      0x00007fd1c368f401 in CPlusPlus::Token::spell() const () from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      
      Thread 7 (Thread 0x7fd1937fe700 (LWP 21289)):
      #0  0x00007fd1c368f401 in CPlusPlus::Token::spell() const () from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #1  0x00007fd1c3686fc8 in CPlusPlus::Bind::asStringLiteral(CPlusPlus::ExpressionAST const*) ()
         from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #2  0x00007fd1c3689368 in CPlusPlus::Bind::enumerator(CPlusPlus::EnumeratorAST*, CPlusPlus::Enum*) ()
         from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #3  0x00007fd1c368969f in CPlusPlus::Bind::visit(CPlusPlus::EnumSpecifierAST*) ()
         from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #4  0x00007fd1c363eef9 in CPlusPlus::EnumSpecifierAST::accept0(CPlusPlus::ASTVisitor*) ()
         from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #5  0x00007fd1c363a34f in CPlusPlus::AST::accept(CPlusPlus::ASTVisitor*) () from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #6  0x00007fd1c3684475 in CPlusPlus::Bind::postfixDeclarator(CPlusPlus::PostfixDeclaratorAST*, CPlusPlus::FullySpecifiedType const&) ()
         from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #7  0x00007fd1c36844f9 in CPlusPlus::Bind::specifier(CPlusPlus::SpecifierAST*, CPlusPlus::FullySpecifiedType const&) ()
         from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #8  0x00007fd1c36884ec in CPlusPlus::Bind::visit(CPlusPlus::SimpleDeclarationAST*) ()
         from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #9  0x00007fd1c363e0c9 in CPlusPlus::SimpleDeclarationAST::accept0(CPlusPlus::ASTVisitor*) ()
         from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #10 0x00007fd1c363a34f in CPlusPlus::AST::accept(CPlusPlus::ASTVisitor*) () from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #11 0x00007fd1c36836dd in CPlusPlus::Bind::visit(CPlusPlus::DeclarationStatementAST*) ()
         from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #12 0x00007fd1c363eb8b in CPlusPlus::DeclarationStatementAST::accept0(CPlusPlus::ASTVisitor*) ()
         from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #13 0x00007fd1c363a34f in CPlusPlus::AST::accept(CPlusPlus::ASTVisitor*) () from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #14 0x00007fd1c36826fc in CPlusPlus::Bind::visit(CPlusPlus::CompoundStatementAST*) ()
         from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #15 0x00007fd1c363e959 in CPlusPlus::CompoundStatementAST::accept0(CPlusPlus::ASTVisitor*) ()
         from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #16 0x00007fd1c363a34f in CPlusPlus::AST::accept(CPlusPlus::ASTVisitor*) () from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #17 0x00007fd1c3686c4d in CPlusPlus::Bind::visit(CPlusPlus::LambdaExpressionAST*) ()
         from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #18 0x00007fd1c36415eb in ?? () from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #19 0x00007fd1c363a34f in CPlusPlus::AST::accept(CPlusPlus::ASTVisitor*) () from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #20 0x00007fd1c3682781 in CPlusPlus::Bind::expression(CPlusPlus::ExpressionAST*) ()
         from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #21 0x00007fd1c368329d in CPlusPlus::Bind::visit(CPlusPlus::CallAST*) () from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #22 0x00007fd1c363fdd9 in CPlusPlus::CallAST::accept0(CPlusPlus::ASTVisitor*) ()
         from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #23 0x00007fd1c363a34f in CPlusPlus::AST::accept(CPlusPlus::ASTVisitor*) () from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #24 0x00007fd1c3682781 in CPlusPlus::Bind::expression(CPlusPlus::ExpressionAST*) ()
         from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #25 0x00007fd1c36830d4 in CPlusPlus::Bind::visit(CPlusPlus::NestedExpressionAST*) ()
         from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #26 0x00007fd1c364047b in CPlusPlus::NestedExpressionAST::accept0(CPlusPlus::ASTVisitor*) ()
         from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #27 0x00007fd1c363a34f in CPlusPlus::AST::accept(CPlusPlus::ASTVisitor*) () from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #28 0x00007fd1c3682781 in CPlusPlus::Bind::expression(CPlusPlus::ExpressionAST*) ()
         from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #29 0x00007fd1c36832c7 in CPlusPlus::Bind::visit(CPlusPlus::CallAST*) () from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #30 0x00007fd1c363fdd9 in CPlusPlus::CallAST::accept0(CPlusPlus::ASTVisitor*) ()
         from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #31 0x00007fd1c363a34f in CPlusPlus::AST::accept(CPlusPlus::ASTVisitor*) () from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #32 0x00007fd1c3682781 in CPlusPlus::Bind::expression(CPlusPlus::ExpressionAST*) ()
         from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #33 0x00007fd1c368285f in CPlusPlus::Bind::visit(CPlusPlus::ExpressionListParenAST*) ()
         from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #34 0x00007fd1c363fa99 in CPlusPlus::ExpressionListParenAST::accept0(CPlusPlus::ASTVisitor*) ()
         from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #35 0x00007fd1c363a34f in CPlusPlus::AST::accept(CPlusPlus::ASTVisitor*) () from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #36 0x00007fd1c3682781 in CPlusPlus::Bind::expression(CPlusPlus::ExpressionAST*) ()
         from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #37 0x00007fd1c368582e in CPlusPlus::Bind::memInitializer(CPlusPlus::MemInitializerAST*, CPlusPlus::Function*) ()
         from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #38 0x00007fd1c368587f in CPlusPlus::Bind::ctorInitializer(CPlusPlus::CtorInitializerAST*, CPlusPlus::Function*) ()
         from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #39 0x00007fd1c3685a2e in CPlusPlus::Bind::visit(CPlusPlus::FunctionDefinitionAST*) ()
         from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #40 0x00007fd1c363f1d9 in CPlusPlus::FunctionDefinitionAST::accept0(CPlusPlus::ASTVisitor*) ()
         from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #41 0x00007fd1c363a34f in CPlusPlus::AST::accept(CPlusPlus::ASTVisitor*) () from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #42 0x00007fd1c368641c in CPlusPlus::Bind::translationUnit(CPlusPlus::TranslationUnitAST*) ()
         from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #43 0x00007fd1c3686450 in CPlusPlus::Bind::operator()(CPlusPlus::TranslationUnitAST*, CPlusPlus::Namespace*) ()
         from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #44 0x00007fd1c36a2275 in CPlusPlus::Document::check(CPlusPlus::Document::CheckMode) ()
         from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/../libCPlusPlus.so.4
      #45 0x00007fd1c3a8da79 in ?? () from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/libCppTools.so
      #46 0x00007fd1c39ec316 in CppTools::BuiltinEditorDocumentParser::updateImpl(QFutureInterface<void> const&, CppTools::BaseEditorDocumentParser::UpdateParams const&) () from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/libCppTools.so
      #47 0x00007fd1c39de6f8 in CppTools::BaseEditorDocumentParser::update(QFutureInterface<void> const&, CppTools::BaseEditorDocumentParser::UpdateParams const&) () from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/libCppTools.so
      #48 0x00007fd1c39df852 in CppTools::BaseEditorDocumentProcessor::runParser(QFutureInterface<void>&, QSharedPointer<CppTools::BaseEditorDocumentParser>, CppTools::BaseEditorDocumentParser::UpdateParams) () from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/libCppTools.so
      #49 0x00007fd1c39f711b in ?? () from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/libCppTools.so
      #50 0x00007fd1c39f728a in ?? () from /opt/Qt/Tools/QtCreator/lib/qtcreator/plugins/libCppTools.so
      #51 0x00007fd1d5770ba3 in ?? () from /opt/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt5Core.so.5
      #52 0x00007fd1d577484a in ?? () from /opt/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt5Core.so.5
      #53 0x00007fd1d521b064 in start_thread (arg=0x7fd1937fe700) at pthread_create.c:309
      #54 0x00007fd1d472e62d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      
      Thread 5 (Thread 0x7fd1cd116700 (LWP 20406)):
      #0  0x00007fd1d4725aed in poll () at ../sysdeps/unix/syscall-template.S:81
      #1  0x00007fd1cf8f6252 in ?? () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
      #2  0x00007fd1cf8f7ddf in xcb_wait_for_event () from /usr/lib/x86_64-linux-gnu/libxcb.so.1
      #3  0x00007fd1ce569589 in ?? () from /opt/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/../../lib/libQt5XcbQpa.so.5
      #4  0x00007fd1d577484a in ?? () from /opt/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt5Core.so.5
      #5  0x00007fd1d521b064 in start_thread (arg=0x7fd1cd116700) at pthread_create.c:309
      #6  0x00007fd1d472e62d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      
      Thread 4 (Thread 0x7fd1b6c8b700 (LWP 20409)):
      #0  0x00007fd1d4725aed in poll () at ../sysdeps/unix/syscall-template.S:81
      #1  0x00007fd1d1535ee4 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
      #2  0x00007fd1d1535ffc in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
      #3  0x00007fd1d599513b in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
         from /opt/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt5Core.so.5
      #4  0x00007fd1d59414aa in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /opt/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt5Core.so.5
      #5  0x00007fd1d576fdfc in QThread::exec() () from /opt/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt5Core.so.5
      #6  0x00007fd1d577484a in ?? () from /opt/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt5Core.so.5
      #7  0x00007fd1d521b064 in start_thread (arg=0x7fd1b6c8b700) at pthread_create.c:309
      #8  0x00007fd1d472e62d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      
      Thread 3 (Thread 0x7fd1b648a700 (LWP 20410)):
      #0  0x00007fd1d4725aed in poll () at ../sysdeps/unix/syscall-template.S:81
      #1  0x00007fd1d1535ee4 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
      #2  0x00007fd1d1535ffc in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
      #3  0x00007fd1d599511f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
         from /opt/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt5Core.so.5
      #4  0x00007fd1d59414aa in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /opt/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt5Core.so.5
      #5  0x00007fd1d576fdfc in QThread::exec() () from /opt/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt5Core.so.5
      #6  0x00007fd1d4116755 in ?? () from /opt/Qt/Tools/QtCreator/bin/../lib/qtcreator/../Qt/lib/libQt5Qml.so.5
      #7  0x00007fd1d577484a in ?? () from /opt/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt5Core.so.5
      #8  0x00007fd1d521b064 in start_thread (arg=0x7fd1b648a700) at pthread_create.c:309
      #9  0x00007fd1d472e62d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      
      Thread 2 (Thread 0x7fd1affff700 (LWP 20411)):
      #0  0x00007fd1d4725aed in poll () at ../sysdeps/unix/syscall-template.S:81
      #1  0x00007fd1d1535ee4 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
      #2  0x00007fd1d1535ffc in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
      #3  0x00007fd1d599511f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
         from /opt/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt5Core.so.5
      #4  0x00007fd1d59414aa in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /opt/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt5Core.so.5
      #5  0x00007fd1d576fdfc in QThread::exec() () from /opt/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt5Core.so.5
      #6  0x00007fd1d4116755 in ?? () from /opt/Qt/Tools/QtCreator/bin/../lib/qtcreator/../Qt/lib/libQt5Qml.so.5
      #7  0x00007fd1d577484a in ?? () from /opt/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt5Core.so.5
      #8  0x00007fd1d521b064 in start_thread (arg=0x7fd1affff700) at pthread_create.c:309
      #9  0x00007fd1d472e62d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
      
      Thread 1 (Thread 0x7fd1d7d7d780 (LWP 20405)):
      #0  0x00007fd1d4725aed in poll () at ../sysdeps/unix/syscall-template.S:81
      #1  0x00007fd1d1535ee4 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
      #2  0x00007fd1d1535ffc in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
      #3  0x00007fd1d599511f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
         from /opt/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt5Core.so.5
      #4  0x00007fd1d59414aa in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /opt/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt5Core.so.5
      #5  0x00007fd1d5949d34 in QCoreApplication::exec() () from /opt/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt5Core.so.5
      #6  0x0000000000409aa7 in ?? ()
      #7  0x00007fd1d4667b45 in __libc_start_main (main=0x406ef0, argc=1, argv=0x7ffeb42c0c68, init=<optimized out>, fini=<optimized out>, 
          rtld_fini=<optimized out>, stack_end=0x7ffeb42c0c58) at libc-start.c:287
      #8  0x000000000040a401 in ?? ()
      
      

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            kosjar Nikolai Kosjar
            Reporter:
            talkless Vincas Dargis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes