Qmake.exe/qtcreator.exe is slow to start.

Source: Internet
Author: User
Tags windows 7 x64

I have been using QT creator to develop QT programs. The QT creator of Nokia is too slow, slow to start, and extremely slow to compile. Yesterday, at last it slowed down, so I couldn't bear it. I decided to leave all my work on hand and dig into the causes of slow start of QT creator. First, it is suspected that the powerful McAfee Enterprise Edition is stuck in the program. Try to disable all Mcafee monitoring, which is ineffective! Then I suspect that there are too many processes in the system. It is ineffective to uninstall a bunch of useless programs from Sony! Continue to suspect that some processes are in conflict with QT creator (Windows 7 x64), kill all irrelevant processes, no effect! Resetting Windows system services does not work! I wiped it, and the character was poor. QT creator was incompatible with win7 x64. I came to this conclusion. Cannot even change the program compatibility settings ?!

Just as I had nothing to do with it, my classmates said that the QT Creator on its computer was very happy to run, and it was also win7 x64. It's so hard. It's all win7 x64. Why am I running fast? As a software developer, let's take a look at Process Monitor! Er ...... Run a 32-bit program in the x64 system. The calling of a wow dll must be detailed.

However, it takes a long time to record a contiguous process profiling operation, which takes about 1 second. What is process profiling? Later, I checked a lot of information and found that it is only a probe operation for Windows to conveniently calculate CPU usage and other performance information insertion when the program is idle. That is to say, QT creator has nothing to do at this conference ?! When there is a qmake.exe call operation, is it related to slow startup? Find qmake.exe and double-click it. A black box is stuck. After half a day, we found that the slow start of QT creator is indeed related to the slow start of qmake, but qmake is not all complained about, and the Creator has its own problems!

Well, there's no way to figure out a large piece of process profiling. Who makes my software debugging fail. Windbg won't be used, that is, PDB will be used, and PDB will have to be re-compiled with qmake and QT creator ...... Accidentally disable the NIC. Try again and disable all NICs. Qmake and QT creator are amazing! This works ?! Then I can block the two processes with the wall! Enable the built-in firewall of the grayed out windows, and disable qmake and QT creator such as the site/outbound in advanced rules. No! What are the results when these two programs are started ...... What can I do? To solve network problems, we still need to capture packets and sacrifice Wireshark to capture packets. This is actually the case:

NBNS is short for NetBIOS Name Service. It seems that QT creator queries the host name like cmake/cmake. EXE/SH. EXE at startup ?! This behavior is incredible. You still have to look for the source code:

#ifdef Q_OS_WIN

static QStringList detectShellPath()

{

    QStringList paths;

    QString path = qgetenv("PATH");

    QStringList pathlist = path.toLower().split(";");

    for (int i = 0; i < pathlist.count(); i++) {

        QString maybeSh = pathlist.at(i) + "/sh.exe";

        if (QFile::exists(maybeSh)) {

            paths.append(maybeSh);

        }

    }

    return paths;

}

#endif

This is a piece of qmake code. It obtains the environment variable named "path" at startup and uses ";" to split it into a qstringlist, finally, connect "/sh.exe" to each path in the PATH environment variable and use qfile to check whether the path exists. In this case, how can I query the Host Name of SH. EXE? Go back and find the following operations in the process monitor monitoring record started by qmake:

Open \ sh.exe \ with createfile, and check msdn. createfile understands this syntax: \ servername \ PIPE \ pipename. Createfileactually uses sh.exe as the server name to create a pipe -_-! Where does "\ sh.exe \" come from? From the above Code, it is spelled out from the environment variables. I was shocked to take a look at my path environment variables !!! In this section, "; C: \ Program Files \ widcomm \ Bluetooth Software \ syswow64; \;" is written ;\;". When did this damn backslash come out! Remove the backslash and start qmake and QT creator again. They finally ran as happily as they did on my computer!

Summary: It seems like a system problem, but actually a program problem, but actually a network problem. It seems like a network problem, but actually an environment variable problem! If Windows Firewall can block the operation of creating remote pipelines, I may never find the truth. The root cause of the problem is far from the appearance!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.