Re: CMSG bugs

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Mon, 10 Oct 2011 15:48:07 -0600

On 10/10/2011 03:17 PM, Amos Jeffries wrote:
> On Mon, 10 Oct 2011 09:51:53 -0600, Alex Rousskov wrote:
>> On 10/09/2011 08:48 PM, Amos Jeffries wrote:
>>> We are hitting bugs in CMSG_* macros on several systems (Windows,
>>> NetBSD, MacOS, and likely their derivatives).
>>
>> I would like to help with these but bugzilla search for CMSG turned out
>> nothing for me. Could you point me to specific bug reports we need to
>> address?
>>
>
> The most up to date info is about MacOSX in this thread here (post #4):
>
> http://squid-web-proxy-cache.1019090.n4.nabble.com/Building-on-Mac-OSX-td3840262.html

OK, that thread cites one CMSG-related bug:

> In TypedMsgHeader.h, I get an "array bound is not an integer
> constant" for the struct definition here. To get past it I just set
> the array size to an arbitrary value, as I'm not sure why it doesn't
> work. Obviously that is not a fix...
>
> structCtrlBuffer{
> charraw[CMSG_SPACE(sizeof(int))]; ///< control buffer space for one fd
> }

This indeed looks similar to what NetBSD thread talks about. Will fix.

I BCCed Matt Cochran to encourage him to file a corresponding bug report
so that we can track this :-).

> Windows we have already discussed the absence of CMSG.

I do not consider Windows problems CMSG-related because Windows does not
have UDS at all. Windows simply needs a different IPC mechanism (and a
Windows developer to propose, build, and test it). I am happy to help
with the design, especially when it comes to seamlessly integrating
Windows IPC into the existing code, but I cannot help with coding that
stuff.

Thank you,

Alex.

>>> I've found a discussion from Feb (this year!) which seems to explain
>>> some of the build problems reported recently.
>>>
>>> http://mail-index.netbsd.org/tech-userlevel/2011/02/24/msg004623.html
>>>
>>> http://mail-index.netbsd.org/tech-userlevel/2011/02/24/msg004626.html
>>
>> I cannot say I understand everything those folks say, but it looks like
>> we may want to do what scm-rights.h does.
>>
>>
>>> Does anyone know of an alternative for passing the SMP packets data
>>> around?
>>
>> IIRC, CMSG macros are needed to pass file descriptors only but passing
>> descriptors was one of the primary reason for using UDS.
>>
>> For passing file descriptors on Unix, I know of three choices:
>>
>> 1. Use threads instead of processes.
>> 2. Use UDS and CMSG stuff.
>> 3. Use STREAMS and ioctl stuff.
>>
>> Given the above choice, and all the pros and cons of each option, I
>> still think we made the right decision to go with UDS.
>>
>>
>>> It looks like we may be headed down the same road that scm-rights.h rant
>>> was all about.
>>
>> Agreed. While it sounds like there is a big API problem there, their
>> solution seems simple enough, although I do not know how they set
>> NEW_CMSG_INTERFACE.
>>
>>
>> Cheers,
>>
>> Alex.
Received on Mon Oct 10 2011 - 21:48:24 MDT

This archive was generated by hypermail 2.2.0 : Tue Oct 11 2011 - 12:00:11 MDT