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

Fredrik Unger fred at tree.se
Mon Aug 13 03:49:33 PDT 2012


On 08/08/2012 01:33 PM, Fredrik Unger wrote:
> Hi,
>
> I found the problem, it turns out it was not a 32/64 bit or alignment
> problem. Seems to be a C-Python interface problem.

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 the bug
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=678525
can be closed once it is has been done.

/Fred
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc-bug.tar.gz
Type: application/gzip
Size: 1756 bytes
Desc: not available
URL: <http://lists.macosforge.org/pipermail/calendarserver-users/attachments/20120813/612d070f/attachment.bin>


More information about the calendarserver-users mailing list