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

Unable to build Qt with address sanitizer

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P2: Important
    • None
    • 6.2.4, 6.6.2, 6.7.0 Beta3
    • None
    • Ubuntu 22.04
      gcc 11.4.0
      clang 14.0.0
    • Linux/X11

    Description

      Enabling sanitizers as I understand it is done via the configuration script. This is what the documentation says:

      $ configure -h
      
      -sanitize {address|thread|memory|fuzzer-no-link|undefined}
               Instrument with the specified compiler sanitizer.
               Note that some sanitizers cannot be combined;
               for example, -sanitize address cannot be combined with
               -sanitize thread.

      I cannot get it to work on Ubuntu 22.04 neighter on clang nor gcc. I tried version 6.2.4, 6.6.2, 6.7.0 beta3 and even the current dev branch. All fail.

       

      I attached a Dockerfile to reproduce the issue as well as the log output. The build commands are:

      configure -sanitize address (-platform linux-clang)
      cmake --build . --parallel
      

       

      For gcc the moc compiler just hangs and slowly leaks memory at around 340/1700 items.

      For clang moc crashes with an error around the same time.

       

      [276/1638] Automatic MOC for target Core   AutoMoc subprocess error
      ------------------------
      The moc process failed to compile
        "SRC:/qtbase/src/corelib/animation/qpropertyanimation.h"
      into
        "SRC:/build/qtbase/src/corelib/Core_autogen/include/moc_qpropertyanimation.cpp"
      included by
        "SRC:/qtbase/src/corelib/animation/qpropertyanimation.cpp"
      

       

      Another thing I noticed is that the current dev branch breaks the configure script. Where Qt is build without sanitizers completely.

      CMake Warning:
        Manually-specified variables were not used by the project:
          INPUT_sanitize_address
          QT_INTERNAL_CALLED_FROM_CONFIGURE
      

      The problematic commit is qtbase 110f656d from Mar 5, 2024.

      The last dev branch to reproduce the issue is therefore a3f2c3037 from Mar 8, 2024.

       

      I am also wondering under which platform and compiler the address sanitizers is supported? Am I simply doing something wrong?

      Attachments

        Issue Links

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

          Activity

            People

              jbornema Joerg Bornemann
              brugger Christian Brugger
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes