[CalendarServer-dev] Exception in recvfd --was: Re: continuing work on FreeBSD ports

Glyph glyph at twistedmatrix.com
Tue Feb 19 22:02:36 PST 2013


On Feb 19, 2013, at 1:28 PM, Axel Rau <axel.rau at chaos1.de> wrote:

> Hi,
> 
> the break came from finding and reading "Unix Network Programming" by Stevens/Fenner/Rudoff. (-;
> 
> Am 14.02.2013 um 11:37 schrieb Fredrik Unger:
> 
>> From the top of my head I find it strange that just 3 bytes was received.
>> If I remember correctly my tests sent more (with sendmsg).
> I think, the reason is, that *no* ancillary data is being sent:

Like... no ancillary data is being *passed to sendmsg*?  Or no data is being received from recvmsg?  Does tracing the relevant processes with something like strace or dtruss confirm this?  What process is being debugged here; master, worker, or both?

The debug messages which you've added seem like they might be missing some data, since they just truncate after 'return from sendmsg with', rather than printing a string (even an empty one) after.

> Without ancillary data, no fd can be shipped.
> The only place where ancillary data could be provided seems to be
> twext.internet.sendfdport._SubprocessSocket.doWrite.
> I would be happy for any hint where to dig...

Well, hrm.  This code works fine on other platforms, so, one thing to check would be to see if previous versions of the FreeBSD kernel have the same issue.  What exact versions of everything are you testing?

> Axel
> PS: sendmsg.c seems to be very fragile as debug code changes
> behaviour of the system (i.e. it locks up after trying a http
> connect and does not reach point of original exception)

This is too general of a comment to really be any use in debugging - but, this code is extremely low-level and sensitive to any I/O that happens on its socket.  Where are your debug messages going that are disrupting things?

I *really* don't know what you mean by "does not reach point of original exception", though.  Can you elaborate?

-glyph



More information about the calendarserver-dev mailing list