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

Crash with U+069C on Mac OS X 10.9.5

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • None
    • 5.5.0, 5.6.0 Alpha
    • GUI: Text handling
    • None
    • Mac OS X 10.9.5
    • macOS

    Description

      On my MacBook Pro, this reliably crashes on OS X 10.9.5 with Qt 5.5 and Qt 5.6.0 alpha.

      On my MacBook Pro, it does not crash in OS X 10.10.5.

      The problem may be due to an OS X bug that has been fixed but I am posting it in case it is a Qt bug.

      To reproduce, open the codeeditor example (qt/qtbase/examples/widgets/widgets/codeeditor) in Qt creator and add the indicated code to the main function in main.cpp:

      int main(int argv, char **args)
      {
          QApplication app(argv, args);
      
      // START ADDED CODE
      	QString qtext(QChar(0x061C));	// U+061C - ARABIC LETTER MARK
      	QFont f;			// Application default font
      	QFontMetricsF fm(f);
      	QRectF r;
      
      	// This reliably crashes on Mac OS X 10.9.5
      	QRectF br = fm.boundingRect(r, Qt::AlignLeft | Qt::AlignTop, qtext);
      // END ADDED CODE
      
          CodeEditor editor;
          editor.setWindowTitle(QObject::tr("Code Editor Example"));
          editor.show();
      
          return app.exec();
      }
      

      On my MacBook Pro running OS X 10.9.5, the fm.boundingRect call crashes almost every time, 9 of 10 tries.

      If I change 0x061C to 0x061D, it does not crash in 10 tries.

      I suspect there are other characters that would make it crash - I just happened to find one in 0x061C. I do not get a crash in another program that uses Quartz-based code.

      The stack crawl looks like this:

      0	QFontEngineMulti::getGlyphBearings(unsigned int, double *, double *)	QFontEngineMulti::getGlyphBearings(unsigned int, double*, double*)		0x1007f965a	
      1	QTextLine::layout_helper(int)	QTextLine::layout_helper(int)		0x10083039e	
      2	qt_format_text(QFont const&, QRectF const&, int, QTextOption const *, QString const&, QRectF *, int, int *, int, QPainter *)	qt_format_text(QFont const&, QRectF const&, int, QTextOption const*, QString const&, QRectF*, int, int*, int, QPainter*)		0x10098502b	
      3	qt_format_text(QFont const&, QRectF const&, int, QString const&, QRectF *, int, int *, int, QPainter *)	qt_format_text(QFont const&, QRectF const&, int, QString const&, QRectF*, int, int*, int, QPainter*)		0x1009882aa	
      4	QFontMetricsF::boundingRect(QRectF const&, int, QString const&, int, int *) const	QFontMetricsF::boundingRect(QRectF const&, int, QString const&, int, int*) const		0x100807a1d	
      5	main	main.cpp	53	0x100002f76	
      6	start	start		0x100002e84	
      

      Attachments

        Issue Links

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

          Activity

            People

              vestbo Tor Arne Vestbø
              hrodstein Howard Rodstein
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes