[avahi] avahi-daemon exists with poll(): Invalid argument on FreeBSD

Felix J. Ogris fjo-lists at ogris.de
Thu Jan 2 01:30:58 PST 2014


I run avahi 0.6.31 on FreeBSD 8.4 and 9.2 amd64 inside a VMware VM with vendor supplied tools installed. Within a few hours up to a few days after restarting, avahi-daemon exists with "poll(): Invalid argument". I added some syslog() calls to avahi-common/simple-watch.c. Turns out that avahi_simple_poll_prepare(), line 506 can run into an integer wrap around when usec > 0x7fffffff. From my debug output:

avahi-daemon[4447]: avahi_simple_poll_prepare: t:-2147308239 usec:6442626352642 ntsec:1390524436 ntusec:348696 nowsec:1384081809 nowusec:996054

(where ntsec/ntusec are next_timeout->expiry, and nowsec/nowusec are now)

Fixing this might be trivial (insert 'if (timeout < 0) timeout = 0;' at line 513), although I don't know why next_timeout occasionally is about 74 days in the future (no adjkerntz when avahi-daemon exists, no time leaps, vm behaves normally besides that avahi strangeness).

Anyone..? I can add additional debug statements to avahi and provide more data if asked for.


More information about the avahi mailing list