Ticket #254 (new defect)
Vidalia process using 100% of CPU cycles
| Reported by: | vidalia | Owned by: | developer |
|---|---|---|---|
| Priority: | critical | Milestone: | |
| Component: | Vidalia | Version: | 0.0.12 |
| Keywords: | Maximum CPU usage | Cc: | ttag@… |
Description
Hi Vidalia support,
Could you help us please with this weird problem. Without the added Sleep calls below, we see the Vidalia process use up 100% of the CPU cycles. With the sleep calls, everything seems normal. Any ideas?
The machine this happens on is a Panasonic CF-W2 running XP Pro SP2
Thanks, Tarek and Steve at Ironkey
void QAbstractSocketPrivate::_q_connectToNextAddress() {
Q_Q(QAbstractSocket); do {
// Check for more pending addresses if (addresses.isEmpty()) {
#if defined(QABSTRACTSOCKET_DEBUG)
qDebug("QAbstractSocketPrivate::_q_connectToNextAddress(), all addresses failed.");
#endif
state = QAbstractSocket::UnconnectedState?; if (socketEngine) {
if ((socketEngine->error() == QAbstractSocket::UnknownSocketError?
#ifdef Q_OS_AIX
// On AIX, the second connect call will result in EINVAL and not // ECONNECTIONREFUSED; although the meaning is the same.
socketEngine->error() == QAbstractSocket::UnsupportedSocketOperationError?
#endif
) && socketEngine->state() == QAbstractSocket::ConnectingState?) { socketError = QAbstractSocket::ConnectionRefusedError?; q->setErrorString(QLatin1String(QT_TRANSLATE_NOOP("QAbstractSocket",
"Connection refused")));
} else {
socketError = socketEngine->error(); q->setErrorString(socketEngine->errorString());
}
} else {
socketError = QAbstractSocket::ConnectionRefusedError?; q->setErrorString(QLatin1String(QT_TRANSLATE_NOOP("QAbstractSocket",
"Connection refused")));
} emit q->stateChanged(state); emit q->error(QAbstractSocket::ConnectionRefusedError?); return;
}
// Pick the first host address candidate host = addresses.takeFirst();
#if defined(QABSTRACTSOCKET_DEBUG)
qDebug("QAbstractSocketPrivate::_q_connectToNextAddress(), connecting to %s:%i",
host.toString().toLatin1().constData(), port);
#endif
#if defined(QT_NO_IPV6)
if (host.protocol() == QAbstractSocket::IPv6Protocol) {
// If we have no IPv6 support, then we will not be able to // connect. So we just pretend we didn't see this address. continue;
}
#endif
if (!initSocketLayer(host, q->socketType())) {
// hope that the next address is better continue;
}
// Tries to connect to the address. If it succeeds immediately // (localhost address on BSD or any UDP connect), emit // connected() and return. if (socketEngine->connectToHost(host, port)) {
fetchConnectionParameters(); return;
}
// Check that we're in delayed connection state. If not, try // the next address if (socketEngine->state() != QAbstractSocket::ConnectingState?) {
#if defined(QABSTRACTSOCKET_DEBUG)
qDebug("QAbstractSocketPrivate::_q_connectToNextAddress(), connection failed (%s)",
socketEngine->errorString().toLatin1().constData());
#endif
continue;
}
// Start the connect timer.
/* IK Added stuff...starts here....*/
if(oneOff <= 0) {
Sleep( 1750 ); oneOff++; }
Sleep( 250 );
/* IK Added stuff...ends here......*/
if (threadData->eventDispatcher) {
if (!connectTimer) {
connectTimer = new QTimer(q); QObject::connect(connectTimer, SIGNAL(timeout()),
q, SLOT(_q_abortConnectionAttempt()));
} connectTimer->start(QT_CONNECT_TIMEOUT);
}
// Wait for a write notification that will eventually call // _q_testConnection(). socketEngine->setWriteNotificationEnabled(true); break;
} while (state != QAbstractSocket::ConnectedState?);
}
