[CalendarServer-users] calendarserver 3.2 on Debian unstable throwing error "socket.error: [Errno 22] Invalid argument" out of the box?

Glyph glyph at twistedmatrix.com
Fri Jul 20 01:27:57 PDT 2012


On Jul 18, 2012, at 8:05 AM, Chris Cleeland <chris.cleeland at gmail.com> wrote:

> 
> 
> On Tue, Jul 17, 2012 at 6:59 PM, Glyph <glyph at twistedmatrix.com> wrote:
> 
> On Jul 17, 2012, at 1:04 AM, Fredrik Unger <fred at tree.se> wrote:
> 
>> One problem could be socklen_t. Linux uses size_t [1].
> 
> The compiler should know, at this point in the code, that msg_controllen is a size_t, which is to say, uint64, and ((socklen_t) all_data_len) is a socklen_t, which is to say, int32.  So the cast is valid.  (Doing funky stuff with & might not be, depending on the type specifiers in question.)
> 
> Wasn't the code originally discussed written in python, though, and used "pack" to synthesize a struct?  If that's the case, then the pack spec would be assuming a specific layout and type size.  It probably is correct in the 32 bit case, but not in the 64 bit case.

The 'pack' is being used to synthesize a single value - a file descriptor - not a struct.  It's using the 'i' format character, which should be native byte-order, native size, native alignment, so that should all be right.  I just spent a little while looking at the documentation here for *linux*'s CMSG_* macros though, and I see there is some non-standard extension, CMSG_ALIGN, which is not terribly well explained.  Maybe some 64-bit linuxes are sensitive to alignment and some aren't?  I'm frankly somewhat baffled.

-glyph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-users/attachments/20120720/b1e2bab0/attachment.html>


More information about the calendarserver-users mailing list