Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-17364

Crash due to profile evaluator considering forward slashes only

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Not Evaluated Not Evaluated
    • Qt Creator 4.2.1
    • Qt Creator 4.2.0-rc1
    • None
    • Windows 7, x64 build based on Qt 5.6.2 MSVC2015 x64
    • 821bc8cdb1be581df6255a1cad2466a3c9fbd1bc

      I have a qmake project on windows which defines all paths using backslashes like e.g.

      SOURCE += \
          D:\Projects\SomeProject.git\Src\MySource.cpp
      

      I use that project file to open the source tree in QtCreator and have a custom build step set up to call the actual build tool (waf).

      With the latest 4.2 branch this causes the project parsing to crash in case one of the referenced source files is not existent yet. We have some files that are generated on the fly during the build but are still referenced in the sources list so that I am able to browse those autogenerated files as well.

      The crash occurs in ProFileEvaluator::absoluteFileValues. Debugging has shown this is caused by line 149:

      src/shared/proparser/profileevaluator.cpp:149
      int nameOff = absEl.lastIndexOf(QLatin1Char('/'));
      QString absDir = d->m_tmp1.setRawData(absEl.constData(), nameOff);
      if (IoUtils::exists(absDir)) {
          ....
      

      It's only searching for forward slashes, never backward slashes. Changing this to support backward as well will fix the crash because absDir will have valid contents and thus the existence check works.

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

            buddenha Oswald Buddenhagen
            ramoel ramoel
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes