Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
None
-
5.5.0, 5.6.0 Alpha
-
None
-
Mac OS X 10.9.5
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
- relates to
-
QTBUG-117500 Sporadic crash on QFontEngineMulti::ensureEngineAt()
-
- Closed
-