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

moc crashes when processing a file that includes an ICU header and is not encoded as UTF-16

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2: Important P2: Important
    • None
    • 5.0.0 RC 1, 5.0.0
    • Build tools: moc
    • None
    • Windows 8 Professional amd64
      Qt 5.0 RC1 binary installer for MSVC2010

      With the 5.0 RC1 binary installer for MSVC2010, moc crashes when processing an input file so long as the following conditions are fulfilled:

      1. A path to the ICU include files is specified using the -I parameter to moc. I've tried both ICU 49 and ICU 50 includes, both show the same behaviour.
      2. The input file #include s an ICU header file. I've seen the issue with unicode/basictz.h, unicode/timezone.h, unicode/uversion.h, unicode/unistr.h, layout/playout.h.
      3. The input file is either encoded with an 8-bit encoding or not with a UTF-16 encoding (this is where I gave in to the madness). I'm not sure which it is; UTF-8 (with and without BOM), Windows-1252, ISO-8859-15 all crashed moc (and I added some umlauts to make them actually discernible) whereas any variant of UTF-16 (little/big endian, with or without BOM) all worked fine.

      If these conditions are fulfilled, moc crashes producing Windows' "moc.exe has stopped working" message. I've attached two header files differing only in encoding that exhibit and don't exhibit the problem, respectively.

      Specific steps to reproduce:
      Assuming an appropriate version of moc.exe is in your PATH and ICU includes are in C:\ICU\include:

      moc.exe -I"C:\ICU\include" test-utf8.h

      crashes moc whereas

      moc.exe -I"C:\ICU\include" test-utf16.h

      produces the expected "No relevant classes found" message.

      I can reproduce these symptoms on two independent machines and one VM (all running Windows 8 Professional 64-bit and using the Qt 5.0 RC1 binary installer for MSVC2010 from qt-project.org); in addition, the same issue occurs on my home-built Qt5 from git (using MSVC2012 64-bit; revision id of the top-level qt5 repository is 039f8c85559abaf1c59fdbcf098a5391eb2c0193). In any case, I checked and the problem happens neither with the Qt 5.0 beta2 binary installer nor with the Qt 4.8.4 binary installer.

      I'm really not good enough with Windows debugging to produce a stack trace, but between three machines, I'm reasonably confident the bug is reproducible. I have to say, I'm really curious what the hell is going on here ...

        1. test-utf16.h
          0.1 kB
          user-c388c
        2. test-utf8.h
          0.0 kB
          user-c388c
        3. gdb.bt
          6 kB
          user-c388c
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            ogoffart Olivier Goffart (Woboq GmbH)
            jirauser16803 user-c388c (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes