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

Fontdata gets corrupted with poor /broken network connection resulting in crash while loading a webpage.

    XMLWordPrintable

    Details

    • Commits:
      d16508a285a5423ae9a5034e969801bce74ffb98, 909b0de5d16f2af3b3d6a3ca4c7e53b84836ad37

      Description

      This is on windows only.
      Use the attached application to reproduce the problem .
      Click on More Information to load the second page.
      While the page is loading pull out the network connection or switch off the wifi.
      The application crashes.
      This is hard to reproduce as it generally happens with poor internet connection.

      The crash log is attached.

      Using a debug statement as below shows that when it is crashed, one of the fontdata's loaded has wrong size compared with the correct loading.

      --- a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
      +++ b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
      @@ -215,7 +215,7 @@ namespace {
               TableDirectory *nameTableDirectoryEntry = tableDirectoryEntry("name");
               if (nameTableDirectoryEntry == 0)
                   return QString();
      -
      +		qDebug()<<"Changing "<< newFamilyName << m_fontData.size();
               QString oldFamilyName = familyName(nameTableDirectoryEntry);
      

      Checking of Null or trailing with \O doesn't help

      --- a/Source/WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp
      +++ b/Source/WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp
      @@ -28,6 +28,7 @@
       #include "WOFFFileFormat.h"
       #endif
       #include <QStringList>
      +#include <QDebug>
       
       namespace WebCore {
       
      @@ -55,6 +56,9 @@ FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer* buffer)
       #endif // USE(ZLIB)
       
           const QByteArray fontData(buffer->data(), buffer->size());
      +    if(fontData.isNull() || !fontData.endsWith("\0"))
      +		return 0;
      +    qDebug()<<"Font Data Size : "<<fontData.size();
       #if !USE(ZLIB)
           if (fontData.startsWith("wOFF")) {
               qWarning("WOFF support requires QtWebKit to be built with zlib support.");
      

        Attachments

        1. CallStack.txt
          15 kB
        2. CrashLog.txt
          917 kB
        3. CrashLogs.zip
          2 kB
        4. fontData.txt
          21 kB
        5. FontData.txt
          114 kB
        6. FontInfo.zip
          1.05 MB
        7. Logs.zip
          1 kB
        8. Resize.zip
          2 kB

          Issue Links

          For Gerrit Dashboard: QTBUG-37190
          # Subject Branch Project Status CR V

            Activity

              People

              Assignee:
              esabraha Eskil Abrahamsen Blomfeldt
              Reporter:
              tapadar Indrajit Tapadar (Inactive)
              Votes:
              2 Vote for this issue
              Watchers:
              11 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes