saslauthd hangs on FreeBSD/amd64 with fghack

Igor Brezac igor at ipass.net
Thu Aug 25 12:48:11 EDT 2005


On Thu, 25 Aug 2005, Attila Nagy wrote:

> Hello,
>
> I am running saslauthd from daemontools with fghack, because it does not have 
> a "stay in foreground" mode.

Hmm, where did you get this?

> When I try to access the server, it hangs and starts to eat the CPU.
>
> The command line, I use:
> /usr/local/bin/fghack /usr/local/sbin/saslauthd -c -s 16384 -t 604800 -r -a 
> ldap
>
> but the problem persist with a simple -a ldap too. If I specify -a getpwent 
> or start without fghack and with -d, the problem disappears, so it's LDAP 
> specific. The problem also goes away, if I use the attached patch and start 
> saslauthd with -f. (could this be applied to the source? It would be a nice 
> addition.)
>
> It seems that saslauthd gets into the loop after openldap tries to connect to 
> the server. The interesting thing is that the same setup works on 
> FreeBSD/i386, with the same version of openldap libraries.
>
> Should I contact the openldap developers instead? :-O

I am not sure if it loops within openldap api or saslauthd ldap code. 
You can verify this with gdb.  Based on your ktrace, it looks like 
openldap api.

>
> ktrace output:
> 51204 saslauthd NAMI  "/root/.ldaprc"
> 51204 saslauthd RET   open -1 errno 2 No such file or directory
> 51204 saslauthd CALL  open(0x800a6f817,0,0x1b6)
> 51204 saslauthd NAMI  "ldaprc"
> 51204 saslauthd RET   open -1 errno 2 No such file or directory
> 51204 saslauthd CALL  socket(0x2,0x1,0)
> 51204 saslauthd RET   socket 40/0x28
> 51204 saslauthd CALL  setsockopt(0x28,0x6,0x1,0x7fffffffddf4,0x4)
> 51204 saslauthd RET   setsockopt 0
> 51204 saslauthd CALL  fcntl(0x28,0x3,0x800a6f01e)
> 51204 saslauthd RET   fcntl 2
> 51204 saslauthd CALL  fcntl(0x28,0x4,0x6)
> 51204 saslauthd RET   fcntl 0
> 51204 saslauthd CALL  connect(0x28,0x513230,0x10)
> 51204 saslauthd RET   connect -1 errno 36 Operation now in progress
> 51204 saslauthd CALL  select(0x400,0,0x7fffffffde80,0,0x7fffffffdf00)
> 51204 saslauthd RET   select 1
> 51204 saslauthd CALL  getpeername(0x28,0x7fffffffde00,0x7fffffffddf0)
> 51204 saslauthd RET   getpeername 0
> 51204 saslauthd CALL  fcntl(0x28,0x3,0x800a6efba)
> 51204 saslauthd RET   fcntl 6
> 51204 saslauthd CALL  fcntl(0x28,0x4,0x2)
> 51204 saslauthd RET   fcntl 0
> 51204 saslauthd CALL  gettimeofday(0x7fffffffdfe0,0)
> 51204 saslauthd RET   gettimeofday 0
> 51204 saslauthd CALL  write(0x28,0x51d000,0x47)
> 51204 saslauthd GIO   fd 40 wrote 71 bytes
> [LDAP bind credentials]
>
> 51204 saslauthd RET   write 71/0x47
> 51204 saslauthd CALL  select(0x400,0x51b500,0x51b580,0,0)
> 51204 saslauthd RET   select 1
> [endless loop]
> 51204 saslauthd CALL  select(0x400,0x51b500,0x51b580,0,0)
> 51204 saslauthd RET   select 1
>
> Thanks,
>
>

-- 
Igor


More information about the Cyrus-sasl mailing list