[Date Prev][Date Next] [Chronological] [Thread] [Top]

(ITS#3542) daemon: select failed (22): invalid argument

Full_Name: Robert Roll
Version: openldap 2.2.23
OS: solaris 9 (on sparc)
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (

        I am encountering the following:

                daemon: select failed (22): Invalid argument

        This only seemed to crop up when I was attempting a syncrepl.
However, after seeing where its occurring, it's not clear to me that it
might not be able to occur at other times. 

        Sparc Solaris 9
        openldap 2.2.23
        db 4.3.27

        Below is some output demonstrating the problem. Note, I did add
some debug print statements to ../servers/slapd/daemon.c . I have
annotated them below. It appears that a large negative seconds is passed
in the time structure to select. That is what is causing the invalid

        I managed to "fix" this for now, by changing an equals
comparison to a less than or equals. I didn't explore the logic real
close, so I am not sure if this is the best thing to do or not.

        I have also included a diff, showing my debug print statements,
along with the comparison change I made to get around my immediate

BTW -- 

         I have also encountered a number of what seem to be already
reported bugs about the syncrepl provider server terminating after an
improper termination of the client machine.

        Maybe, it is documented somewhere and I missed it. It made all
the difference in the world to index entryUUID. If this isn't
documented, it really should be. 
        I think this syncrepl stuff is pretty cool and I really hope
those working on it can get the bugs worked out. I really appreciate
their efforts ! :)



Robert Roll
University of Utah
OIT (Office of Information Technology)
(801) 581-7655

ldap_chkResponseList for msgid=-1, all=0
ldap_chkResponseList returns NULL
connection_get(11): got connid=0
daemon: added 11r

diff 1, tdelta 1, cat->tv_sec 1108397241, now 1108397240 now/1000 

daemon: select: listen=7 active_threads=0 tvp=zero
daemon: select: listen=8 active_threads=0 tvp=zero
daemon: activity on 1 descriptors

diff -1108397241, tdelta 1, cat->tv_sec 0, now 1108397241 now/1000

daemon: select: listen=7 active_threads=0 tvp=zero
daemon: select: listen=8 active_threads=0 tvp=zero

nfds: 12 tv.tv_sec -1108397241, tv.tv_usec 0 tvp->tv_sec -1108397241,
tvp->tv_usec 0

daemon: select failed (22): Invalid argument
daemon: abnormal condition, shutdown initiated.
daemon: closing 7
daemon: closing 8
slapd shutdown: waiting for 1 threads to terminate
connection_get(11): got connid=0
daemon: removing 11r
ldap_free_request (origid 2, msgid 2)
ber_flush: 7 bytes to sd 11
ldap_free_connection: actually freed
slapd shutdown: initiated
====> bdb_cache_release_all
slapd shutdown: freeing system resources.
slapd stopped.

######## Diff #############3

> diff daemon.c.bak daemon.c
<                       if ( diff == 0 )
>                       printf("diff %d, tdelta %d, cat->tv_sec %d, now
%d now/1000 %d\n", diff, tdelta, cat->tv_sec, now, now/1000);
>                       if ( diff <= 0 )
>                                 printf("nfds: %d tv.tv_sec %d,
tv.tv_usec %d tvp->tv_sec %d, tvp->tv_usec %d\n", nfds, tv.tv_sec,
tv.tv_usec,  tvp->tv_sec, tvp->tv_usec);