[Asterisk-bsd] Wait failed (Interrupted system call) -> hangup

Staffan Ulfberg staffanu+freebsd at multivac.fatburen.org
Mon Mar 21 19:03:15 CST 2005


Hello,

I have a problem with AGI scripts that use the GET DATA function: If
two calls access the AGI script at the same time, and one of them
hangs up, the other call is also terminated.  It seems the thread for
this other call receives EINTR on the call to poll() in
ast_waitfor_nandfds:

Mar 22 01:49:00 WARNING[9633]: file.c:1073 ast_waitstream_full: Wait
failed (Interrupted system call)

Has anyone else seen this?  There are a few reports of this problem
that can be found on mailing lists and on the web, but it seems quite
uncommon.  I did make a dirty fix in ast_waitfor_nandfds, which just
restarts the poll() call id it fails with EINTR, which seems to work.
I don't understand what ill effects what fix might have, however.

To reproduce, use the following AGI script:

#!/bin/sh

while true; do read a; if [ "$a" = "" ]; then break; fi; done
echo ANSWER
read response
echo GET DATA pbx-invalid 50000 4
read response


Then, call Asterisk from two phones simultaneously (I use one SIP
phone on my PC and one Zap device, but I've seen this happen with
multiple SIP calls as well).  Hang up one of the phones, and with a
high probability (>90%), the other call will also be terminated.  The
probability seems higher if you wait for the message to finish before
hanging up the phone.

I had this problem on 1.0.5, and on HEAD, and just confirmed that it
is also present in Asterisk 1.0.6 from ports.

Does anyone here have any clue how FreeBSD and Linux differs here that
might explain this?

Staffan


More information about the Asterisk-BSD mailing list