Ueland / VikingBot

Vikingbot is yet another simple PHP based IRC bot with support for plugins and secure IRC servers. The bot requires Unix/Linux shell access with PHP support and SSL support in PHP for use against secure IRC servers.
GNU General Public License v3.0
40 stars 6 forks source link

100% cpu usage #39

Closed enricoros closed 1 year ago

enricoros commented 9 years ago

VikingBot used to work great; now one core is always on. The only thing that changed is the php version I believe (5.6.8).

The cause seems to be the " $data = fgets($this->socket, 256); " call, which is blocking (and polling the read() function on the socket - as revealed by systrace) instead of timing out and returning 0 bytes.

The code seems to set the socket as non blocking, but I see it looping endlessly.

Ueland commented 9 years ago

Hmm, it is not quite unlikely that this might be a PHP bug if everything worked fine before you upgraded PHP. Are you connection to a server with SSL or is it an unencrypted connection?

/Tor