Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-70293

crash in QTextCursor::setPosition(int pos, MoveMode m)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.12.0 Beta 1
    • 5.6.3, 5.9.6, 5.11.1
    • GUI: Text handling
    • None
    • Windows
    • 720e243d88e352276cfbbe0b13fa4860fb020b29

    Description

      I don't know how to reproduce this crash but I have callstack

      crash occur only on japan environment 

       

      it crash here

      http://code.qt.io/cgit/qt/qtbase.git/tree/src/gui/text/qtextcursor.cpp#n83

      as priv == nullptr

       

      callstack:

      Qt5Gui.dll!QTextCursorPrivate::QTextCursorPrivate(const QTextCursorPrivate & rhs) Line 83 C++

      [Inline Frame] Qt5Gui.dll!QSharedDataPointer<QTextCursorPrivate>::clone() Line 240 C++

      Qt5Gui.dll!QSharedDataPointer<QTextCursorPrivate>::detach_helper() Line 246 C++

      [Inline Frame] Qt5Gui.dll!QSharedDataPointer<QTextCursorPrivate>::detach() Line 74 C++

      [Inline Frame] Qt5Gui.dll!QSharedDataPointer<QTextCursorPrivate>::operator->() Line 77 C++

      Qt5Gui.dll!QTextCursor::setPosition(int pos, QTextCursor::MoveMode m) Line 1151 C++

      Qt5Widgets.dll!QWidgetTextControlPrivate::extendWordwiseSelection(int suggestedNewPosition, double mouseXPosition) Line 749 C++

       

      problem can be fixed really easy but I don't understand why compiler choose non const method instead of const ????

      It call from http://code.qt.io/cgit/qt/qtbase.git/tree/src/gui/text/qtextcursor.cpp#n1151

      NON CONST VARIANT
      inline T *operator->() { detach(); return d; }

      CONST VARIANT

      inline const T *operator->() const { return d; }  

      so it crash on clone

      but then it still only check property priv  and then it release cloned object

      {{void QTextCursor::setPosition(int pos, MoveMode m) }}

      {{{ if (!d || !d->priv)}}

       

      compiler MSVC 2015 64bit

      any idea ????

       

       

      Attachments

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            miskol MICHAL LAZO
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: