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

Qt Creator crashed when replacing string and preserving case

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • Qt Creator 2.7.0
    • Qt Creator 2.7.0
    • Editors
    • None
    • Linux 32bit (ubuntu 10.04) , Qt 5.0.0
    • 05b6c466c3c80fe032eb9d35ef9c8cda92cc6c46

    Description

      Say, if I have a file:
      cat test_replace.cpp

      MYMACRO

      MYMACRO
      MYMACRO
      MYMACRO
      MYMACRO
      MYMACRO
      MYMACRO
      MYMACRO

      Then I block select all of those lines and do a replace 'MYMACRO' with 'MYMACROS', with the 'preserve case' option active I get a crash:

      ASSERT: "uint < uint(size())" in file /opt/Qt/5/include/QtCore/qstring.h, line 729

      #0 0xb7829430 in __kernel_vsyscall ()
      #1 0xb6383651 in raise () from /lib/tls/i686/cmov/libc.so.6
      #2 0xb6386a82 in abort () from /lib/tls/i686/cmov/libc.so.6
      #3 0xb6772f24 in ?? () from /opt/qt/5.0.0/gcc/lib/libQt5Core.so.5
      #4 0xb6770f54 in QMessageLogger::fatal(char const*, ...) const () from /opt/qt/5.0.0/gcc/lib/libQt5Core.so.5
      #5 0xb676c7b9 in qt_assert(char const*, char const*, int) () from /opt/qt/5.0.0/gcc/lib/libQt5Core.so.5
      #6 0xb37915e3 in QString::at (this=0xbfadeae8, i=7) at /opt/Qt/5/include/QtCore/qstring.h:729
      #7 0xb37a2a3a in Utils::matchCaseReplacement (originalText=..., replaceText=...) at ../../../../qt-creator/src/libs/utils/filesearch.cpp:401
      #8 0xb2621815 in Find::BaseTextFind::replaceAll (this=0xaac07180, before=..., after=..., findFlags=...) at ../../../../qt-creator/src/plugins/find/basetextfind.cpp:293
      #9 0xb261e710 in Find::Internal::CurrentDocumentFind::replaceAll (this=0x89c56d8, before=..., after=..., findFlags=...)
      at ../../../../qt-creator/src/plugins/find/currentdocumentfind.cpp:139
      #10 0xb262a860 in Find::Internal::FindToolBar::invokeReplaceAll (this=0x89c5808) at ../../../../qt-creator/src/plugins/find/findtoolbar.cpp:512
      #11 0xb264c852 in Find::Internal::FindToolBar::qt_static_metacall (_o=0x89c5808, _c=QMetaObject::InvokeMetaMethod, _id=8, _a=0xbfaded08)
      at .moc/debug-shared/moc_findtoolbar.cpp:176
      #12 0xb698ef3b in QMetaObject::activate(QObject*, int, int, void**) () from /opt/qt/5.0.0/gcc/lib/libQt5Core.so.5
      #13 0xb698e810 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /opt/qt/5.0.0/gcc/lib/libQt5Core.so.5

      Attachments

        Activity

          People

            davschul David Schulz
            nunosalmeida Nuno Sucena Almeida
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: