Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 307651 - [PATCH] sys-devel/glibc defined SOCK_CLOEXEC incorrectly on Alpha
Summary: [PATCH] sys-devel/glibc defined SOCK_CLOEXEC incorrectly on Alpha
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: Alpha Linux
: High major (vote)
Assignee: Gentoo Toolchain Maintainers
URL: http://sources.redhat.com/bugzilla/sh...
Whiteboard:
Keywords:
Depends on:
Blocks: 294470
  Show dependency tree
 
Reported: 2010-03-03 17:49 UTC by Matt Turner
Modified: 2010-06-29 20:34 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Just the updated patch in the RH bugzilla (6028_all_alpha-fix-SOCK_NONBLOCK.patch,13.98 KB, patch)
2010-03-07 20:02 UTC, Matt Turner
Details | Diff
fixed patch (apply it to the correct place) (6028_all_alpha-fix-SOCK_NONBLOCK.patch,13.98 KB, patch)
2010-06-29 17:21 UTC, Matt Turner
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Turner gentoo-dev 2010-03-03 17:49:24 UTC
The kernel defines SOCK_CLOEXEC as
include/linux/net.h:#define SOCK_CLOEXEC        O_CLOEXEC
arch/alpha/include/asm/fcntl.h:#define O_CLOEXEC        010000000

But glibc was defining
bits/socket.h:  SOCK_CLOEXEC = 02000000
which was correct for x86, but not for alpha.

Aurelien Jarno has a patch to fix this in the linked bug report. We already have included patch from that bug report called 6028_all_alpha-fix-SOCK_NONBLOCK.patch that fixes the definition of SOCK_NONBLOCK, but he recently updated it to fix SOCK_CLOEXEC as well after I discovered that it was incorrect: http://sourceware.org/ml/libc-ports/2010-02/msg00013.html

The incorrect definition of SOCK_CLOEXEC causes the 'Invalid argument' errors in bug 294470.
Comment 1 SpanKY gentoo-dev 2010-03-07 16:12:54 UTC
can you post an updated 6028_all_alpha-fix-SOCK_NONBLOCK.patch that includes the changes you need ?
Comment 2 Matt Turner gentoo-dev 2010-03-07 20:02:42 UTC
Created attachment 222561 [details, diff]
Just the updated patch in the RH bugzilla

This should do it.

I'm not sure how glibc's ebuild does the patching, but I think this should work.

We've got a bug that depends on this fix. Is an alpha-only version bump the way forward?
Comment 4 Matt Turner gentoo-dev 2010-06-28 22:01:38 UTC
(In reply to comment #3)
> we'll have to do a bump for Bug 301761 for everyone soon
> 
> http://sources.gentoo.org/gentoo/src/patchsets/glibc/2.11/6028_all_alpha-fix-SOCK_NONBLOCK.patch?r1=1.1&r2=1.2

This patch is totally wrong. I'm not sure how this happened. The patch I've got attached to this bug has the correct SOCK_CLOEXEC definition.
Comment 5 SpanKY gentoo-dev 2010-06-29 05:35:13 UTC
you're going to have to provide more information.  i see no difference at all.  the 2.11, 2.11.1, 2.11.2 patches are exactly the same as this attachment.

$ wget -nv http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo/src/patchsets/glibc/2.11/6028_all_alpha-fix-SOCK_NONBLOCK.patch https://bugs.gentoo.org/attachment.cgi?id=222561
2010-06-29 01:32:56 URL:http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo/src/patchsets/glibc/2.11/6028_all_alpha-fix-SOCK_NONBLOCK.patch [14320/14320] -> "6028_all_alpha-fix-SOCK_NONBLOCK.patch" [1]
2010-06-29 01:33:01 URL:https://bugs.gentoo.org/attachment.cgi?id=222561 [14320/14320] -> "attachment.cgi?id=222561" [1]
FINISHED --2010-06-29 01:33:01--
Downloaded: 2 files, 28K in 0s (53346 GB/s)

$ md5sum attachment.cgi\?id\=222561 6028_all_alpha-fix-SOCK_NONBLOCK.patch 
118c388dc76e2bb6a52ccb49402bc3c9  attachment.cgi?id=222561
118c388dc76e2bb6a52ccb49402bc3c9  6028_all_alpha-fix-SOCK_NONBLOCK.patch
Comment 6 Matt Turner gentoo-dev 2010-06-29 17:20:25 UTC
(In reply to comment #5)
> you're going to have to provide more information.  i see no difference at all. 
> the 2.11, 2.11.1, 2.11.2 patches are exactly the same as this attachment.
> 
> $ wget -nv
> http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo/src/patchsets/glibc/2.11/6028_all_alpha-fix-SOCK_NONBLOCK.patch
> https://bugs.gentoo.org/attachment.cgi?id=222561
> 2010-06-29 01:32:56
> URL:http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo/src/patchsets/glibc/2.11/6028_all_alpha-fix-SOCK_NONBLOCK.patch
> [14320/14320] -> "6028_all_alpha-fix-SOCK_NONBLOCK.patch" [1]
> 2010-06-29 01:33:01 URL:https://bugs.gentoo.org/attachment.cgi?id=222561
> [14320/14320] -> "attachment.cgi?id=222561" [1]
> FINISHED --2010-06-29 01:33:01--
> Downloaded: 2 files, 28K in 0s (53346 GB/s)
> 
> $ md5sum attachment.cgi\?id\=222561 6028_all_alpha-fix-SOCK_NONBLOCK.patch 
> 118c388dc76e2bb6a52ccb49402bc3c9  attachment.cgi?id=222561
> 118c388dc76e2bb6a52ccb49402bc3c9  6028_all_alpha-fix-SOCK_NONBLOCK.patch

Sorry. This looks like a multipart fuck-up on my part. First, I was reading the patch in glibc-2.11-patches-5.tar.bz2 instead of glibc-2.11.2-patches-1.tar.bz2.

So armin noticed that the patch in 2.11.2 is correct, but is being applied incorrectly. Notice the change from ports/sysdeps/unix/sysv/linux/alpha/bits/socket.h 	-> b/ports/sysdeps/unix/sysv/linux/alpha/bits/socket.h in http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo/src/patchsets/glibc/2.11/6028_all_alpha-fix-SOCK_NONBLOCK.patch?r1=1.1&r2=1.2

God, let's look forward to glibc-2.12 which will kill most of our alpha patches...
Comment 7 Matt Turner gentoo-dev 2010-06-29 17:21:07 UTC
Created attachment 236937 [details, diff]
fixed patch (apply it to the correct place)
Comment 9 SpanKY gentoo-dev 2010-06-29 20:34:53 UTC
i also pushed out an updated patchset for glibc-2.11.2 w/out a revbump.  older glibc-2.11 will be culled, so i didnt bother with those.