Skip to content

select() loops forever #17

@nickandrew

Description

@nickandrew

I have a jabber client process which is spinning in a tight loop calling select():

# ps uww 24492
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
nick     24492 98.9  0.0  77956 25588 pts/14   R+   Jun10 6974:59 /usr/bin/perl -w bin/jabber-control.pl
$ perl-stacktrace 24492
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
__memmove_ssse3_back () at ../sysdeps/x86_64/multiarch/memcpy-ssse3-back.S:55
55      ../sysdeps/x86_64/multiarch/memcpy-ssse3-back.S: No such file or directory.
bin/jabber-control.pl:35
/usr/share/perl5/Net/XMPP/Connection.pm:136
/usr/share/perl5/XML/Stream.pm:1013
/usr/share/perl5/XML/Stream.pm:1174

Checking XML::Stream around line 1174:

        while(!$self->ReceivedStreamFeatures($sid))
        {
            $self->Process(1);
        }

I am guessing that the connection to a server dropped before "stream features" were received, and so the while loop needs to also check for EOF or I/O error on the socket.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions