Hi,
After further analyzing the problem and with help from Glyph Lefkowitz, Chris Cleeland and Rahul Amaram, I managed to create a test case that proved it is a gcc bug.
The included tar file includes a simple testcase that can be run under Debian. The c file that is the base for this bugreport can be found here : http://trac.calendarserver.org/browser/CalendarServer/trunk/twext/python/sendmsg.c tar xvfz gcc-bug.tar.gz make fail python sender.py produces the faulty output : SCM_RIGHTS constant : 1 First call level 1 type 1 2a 00 00 00 (4) Second call level 1 type 0 2a 00 00 00 (4) This is using the current gcc in Debian sid : gcc (Debian 4.7.1-6) 4.7.1 make ok python sender.py produces the correct output : SCM_RIGHTS constant : 1 First call level 1 type 1 2a 00 00 00 (4) Second call level 1 type 1 2a 00 00 00 (4) This using current gcc-4.6 in Debian sid : gcc-4.6 (Debian 4.6.3-8) 4.6.3 The first and the second call should produce the same output but in the faulty run type becomes 0. Due to the 0, the linux kernel check in http://lxr.linux.no/linux+v3.2/net/core/scm.c#L159 fails, and gives the Invalid Argument error. The problem can be worked around in Debian and this bug can be closed once it is has been done. /Fred
gcc-bug.tar.gz
Description: application/gzip