Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 370413 - dev-lang/ruby fails to build with glibc-2.14
Summary: dev-lang/ruby fails to build with glibc-2.14
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL: http://redmine.ruby-lang.org/issues/5108
Whiteboard:
Keywords:
: 377213 385961 391969 392415 392611 392741 393101 393349 393417 394215 395137 395325 396391 396393 396407 396409 396423 396563 396645 404399 (view as bug list)
Depends on:
Blocks: glibc-2.14
  Show dependency tree
 
Reported: 2011-06-07 06:58 UTC by Diego Elio Pettenò (RETIRED)
Modified: 2012-02-19 07:05 UTC (History)
43 users (show)

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


Attachments
Build log (ruby-1.8.7_p334-r1:20110601-001027.log,67.43 KB, text/plain)
2011-06-07 06:58 UTC, Diego Elio Pettenò (RETIRED)
Details
Build log (ruby-1.8.7_p334-r1:20110606-220244.log,34.04 KB, text/plain)
2011-06-07 08:59 UTC, Diego Elio Pettenò (RETIRED)
Details
0068_all_glibc-2.14-glibc-revert-fseek-on-fclose.patch (0068_all_glibc-2.14-glibc-revert-fseek-on-fclose.patch,5.60 KB, patch)
2011-12-05 21:07 UTC, SpanKY
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Diego Elio Pettenò (RETIRED) gentoo-dev 2011-06-07 06:58:23 UTC
Created attachment 276103 [details]
Build log

Portage 2.1.10 (default/linux/x86/10.0, gcc-4.6.0-asneeded, glibc-2.14-r0, 2.6.39 i686)
=================================================================
System uname: Linux-2.6.39-i686-Quad-Core_AMD_Opteron-tm-_Processor_2350-with-gentoo-2.0.2
Timestamp of tree: Mon, 06 Jun 2011 20:30:01 +0000
app-shells/bash:          4.2_p10
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.1-r1, 3.2
dev-util/cmake:           2.8.4-r1
sys-apps/baselayout:      2.0.2
sys-apps/openrc:          0.8.2-r1
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.68
sys-devel/automake:       1.9.6-r3, 1.10.3, 1.11.1-r1
sys-devel/binutils:       2.21
sys-devel/gcc:            4.6.0
sys-devel/gcc-config:     1.4.1-r1
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82
sys-kernel/linux-headers: 2.6.38 (virtual/os-headers)
sys-libs/glibc:           2.14
Repositories: gentoo
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib/tomoyo/conf /usr/share/bufrtables /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.0/conf /usr/share/openvpn/easy-rsa /usr/share/qpsmtpd/plugins /var/lib/hsqldb /var/phxd /var/qmail/alias /var/qmail/control /var/yp/Makefile"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/games/angband/edit/ /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe"
DISTDIR="/var/cache/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms split-log strict test test-fail-continue unknown-features-warn unmerge-orphans userfetch userpriv usersandbox"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.wheel.sk/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
MAKEOPTS="-j14"
PKGDIR="/var/spool/portage/packages"
PORTAGE_COMPRESS=""
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/var/cache/portage/tree"
PORTDIR_OVERLAY=""
SYNC="rsync://yamato.home.flameeyes.eu/gentoo-portage"
USE="acl berkdb bzip2 cli cracklib crypt cups cxx dri fortran gdbm gpm iconv ipv6 java5 java6 modules mudflap mysql ncurses nls nostatic nptl nptlonly openmp pam pcre pcsc-lite perl postgres pppd python qt3support readline ruby semantic-desktop session ssl sysfs tcpd unicode vhosts x86 xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias auth_digest cgi" CALLIGRA_FEATURES="braindump flow karbon kexi kpresenter krita tables words" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18 jruby ruby19 ree18" USERLAND="GNU" VIDEO_CARDS="intel radeon nouveau vmware" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Diego Elio Pettenò (RETIRED) gentoo-dev 2011-06-07 08:59:06 UTC
Created attachment 276115 [details]
Build log
Comment 2 Hans de Graaff gentoo-dev Security 2011-08-01 06:28:49 UTC
*** Bug 377213 has been marked as a duplicate of this bug. ***
Comment 3 David Carlos Manuelda 2011-08-01 20:22:47 UTC
I saw a workarround for this on github, consider taking it a look: https://gist.github.com/1057203
Comment 4 Sergei Trofimovich (RETIRED) gentoo-dev 2011-08-10 16:18:31 UTC
I'll braindump here what i have found out.

It's likely caused by this change in glibc:

http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=fcabc0f8b185f9e0a9289720be5ede6c39b3bf21#patch5

Why i think so:

The simplest test case i was able to get is the following:

    sf dl # pwd
        /var/tmp/portage/dev-lang/ruby-1.8.7_p334-r2/work/ruby-1.8.7-p334/ext/dl
    sf dl # cat mkfoo.rb 
        # -*- ruby -*-
        
        # we emulate emulate
        #    require 'mkmf'
        #    >  @orgerr = $stderr.dup
        #    >  @orgout = $stdout.dup
        #
        orgout = $stdout.dup
    
        #more than 4kb, seems to be a glibc's buffer
        printf("1\n" * 2048)
        printf("2\n" * 32)
    sf dl # ../../miniruby mkfoo.rb > a.foo; head -n 2 a.foo
        2
        2

The head is overwritten. Let's look at the strace log:

    sf dl $ strace -etrace=open,write,close,lseek,dup,dup2,execve ../../miniruby mkfoo.rb > a.foo; head -n 2 a.foo
    ... [snippet] ...
[1] dup(1)                                  = 3
    lseek(3, 0, SEEK_CUR)                   = 0
    lseek(1, 0, SEEK_CUR)                   = 0
    lseek(3, 0, SEEK_SET)                   = 0
[2] write(1, "1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n"..., 4096) = 4096
[3] lseek(3, 0, SEEK_SET)                   = 0
[4] close(3)                                = 0
[5] write(1, "2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n2\n"..., 64) = 64
    2
    2

Here we see:
[1] fd=3 is an alias of fd=1 (stdout)
[2] part of print()s is written to disk
[4] 'orgout' is garbage collected out (program shutdowns)
     [3] and right before fclose() glibc
        "restores" pointer of file descriptor (offest for fd=3 is 0, as nobody
        written to the dupped fd).
[5] last bits of stdout are flushed to fd=1, but it's descriptor is shifted, so last write overwrites head

I don't know how to fix it properly.
I see such variants: 
   1. all mkfmrb users must call $stdout.flush at the end of file
   2. Ruby's implementation of IO#dup(io.c:rb_io_init_copy:rb_fdopen)
      and it's finalizer (io.c:fptr_finalize:fclose)
      should not use fdopen/fclose. Or should restore position properly.
   3. fix mkfm Logger module

Thus, the workaround for this particular case is the following:

--- mkcallback.rb.orig  2011-08-10 19:20:59.338487021 +0300
+++ mkcallback.rb       2011-08-10 19:20:39.154739353 +0300
@@ -54,3 +54,5 @@
     print(mkfunc(t, n, 15), "\n\n")
   end
 }
+
+$stdout.flush
Comment 5 Hans de Graaff gentoo-dev Security 2011-08-10 17:59:24 UTC
(In reply to comment #4)

Thanks for digging in!

> Thus, the workaround for this particular case is the following:
> 
> --- mkcallback.rb.orig  2011-08-10 19:20:59.338487021 +0300
> +++ mkcallback.rb       2011-08-10 19:20:39.154739353 +0300
> @@ -54,3 +54,5 @@
>      print(mkfunc(t, n, 15), "\n\n")
>    end
>  }
> +
> +$stdout.flush

But if we do this then we fix the installation of ruby itself, but code using ruby will behave differently depending on the glibc version underneath it and thus "randomly" break things. Option 2 (fix IO::dup) is probably the solution we should aim at, but also something that is outside our own scope. If someone wants to work on this it's probably better to do so on the upstream bug directly.
Comment 6 Hans de Graaff gentoo-dev Security 2011-09-20 10:37:58 UTC
The conclusion appears to be that this is a bug in glibc instead. See http://sourceware.org/bugzilla/show_bug.cgi?id=12724

Reassigning accordingly.
Comment 7 Hans de Graaff gentoo-dev Security 2011-10-08 06:24:55 UTC
*** Bug 385961 has been marked as a duplicate of this bug. ***
Comment 8 Hans de Graaff gentoo-dev Security 2011-11-28 19:10:57 UTC
*** Bug 391969 has been marked as a duplicate of this bug. ***
Comment 9 Alex Legler (RETIRED) archtester gentoo-dev Security 2011-11-29 15:56:12 UTC
*** Bug 392415 has been marked as a duplicate of this bug. ***
Comment 10 Agostino Sarubbo gentoo-dev 2011-11-30 14:16:33 UTC
*** Bug 392611 has been marked as a duplicate of this bug. ***
Comment 11 Ben Kohler gentoo-dev 2011-12-01 15:06:46 UTC
Upstream bug report, with patch: http://redmine.ruby-lang.org/issues/5108
Comment 12 Ben Kohler gentoo-dev 2011-12-01 15:16:14 UTC
Builds ok with the patch... but I don't actively USE ruby myself, but:

Tue Nov 29 18:49:02 2011 >>> sys-libs/glibc-2.14.1-r1
Thu Dec  1 09:11:23 2011 >>> dev-lang/ruby-1.8.7_p352

# ruby --version
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
Comment 13 Hans de Graaff gentoo-dev Security 2011-12-01 15:29:51 UTC
(In reply to comment #11)
> Upstream bug report, with patch: http://redmine.ruby-lang.org/issues/5108

Already linked to the bug in the URL field. Also, as mentioned in comment #5, the patch would only fix the ruby build but leave users of this module open for similar, but probably much harder to detect, problems.
Comment 14 Alex Legler (RETIRED) archtester gentoo-dev Security 2011-12-01 16:48:45 UTC
*** Bug 392741 has been marked as a duplicate of this bug. ***
Comment 15 Alex Legler (RETIRED) archtester gentoo-dev Security 2011-12-04 10:12:39 UTC
*** Bug 393101 has been marked as a duplicate of this bug. ***
Comment 16 SpanKY gentoo-dev 2011-12-05 21:07:19 UTC
Created attachment 294893 [details, diff]
0068_all_glibc-2.14-glibc-revert-fseek-on-fclose.patch

try this patch; it comes from opensuse.  place it in /etc/portage/patches/sys-libs/glibc/ and re-emerge glibc.  see if it fixes the troubles with ruby.
Comment 17 Andriy Baranskyy 2011-12-05 21:57:03 UTC
Works here!
Comment 19 Hans de Graaff gentoo-dev Security 2011-12-06 07:09:08 UTC
*** Bug 393349 has been marked as a duplicate of this bug. ***
Comment 20 Alex Legler (RETIRED) archtester gentoo-dev Security 2011-12-06 16:38:57 UTC
*** Bug 393417 has been marked as a duplicate of this bug. ***
Comment 21 Alex Legler (RETIRED) archtester gentoo-dev Security 2011-12-10 09:08:19 UTC
*** Bug 394215 has been marked as a duplicate of this bug. ***
Comment 22 Marco Napetti 2011-12-15 10:50:52 UTC
I have sys-libs/glibc-2.14.1-r1 and I still have this problem.
Has the patch been inserted in portage without a version bump or is it still in approval process?

I also noticed that dev-lang/ruby-1.9.3_rc1 compiles fine without patched glibc.
Comment 23 Ian Abbott 2011-12-15 12:23:55 UTC
Ditto comment 22. Me too. I still have this problem building ruby-1.8.7_p352 with glibc-2.14.1-r1 on an old x86 machine, but it worked on my newer amd64 machine.
Comment 24 Ian Abbott 2011-12-15 12:56:51 UTC
The patch isn't in glibc-2.14.1-patches-2.tar.bz2, so I guess we need to wait for glibc-2.14.1-patches-3.tar.bz2 and sys-libs/glibc-2.14.1-r2.

My previous comment 23 saying ruby built okay on my amd64 machine with glibc-2.14.1-r1 was incorrect; I should have checked my emerge logs first!
Comment 25 Alex Legler (RETIRED) archtester gentoo-dev Security 2011-12-18 12:02:30 UTC
*** Bug 395137 has been marked as a duplicate of this bug. ***
Comment 26 Ian Abbott 2011-12-21 15:04:09 UTC
This bug was resolved as "fixed" over a fortnight ago.  Any news on when a patched version of glibc >=2.14.1 containing the fix will be released to portage?
Comment 27 Hans de Graaff gentoo-dev Security 2011-12-22 06:53:22 UTC
*** Bug 395325 has been marked as a duplicate of this bug. ***
Comment 28 BillWho 2011-12-22 23:32:25 UTC
ruby compiled for me after adding the patch to /etc/portage/patches/sys-libs/glibc/

emerge --info  

System uname: Linux-3.1.5-gentoo-x86_64-AMD_Phenom-tm-_9150e_Quad-Core_Processor-with-gentoo-2.1
Timestamp of tree: Thu, 22 Dec 2011 18:45:01 +0000
app-shells/bash:          4.2_p20
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.2-r3, 3.1.4-r3, 3.2.2
dev-util/cmake:           2.8.6-r4
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.1
sys-apps/openrc:          0.9.7
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.9.6-r3, 1.10.3, 1.11.1-r1
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.5.3-r2
sys-devel/gcc-config:     1.5-r2
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 3.1 (virtual/os-headers)
sys-libs/glibc:           2.14.1-r1
Repositories: gentoo x11
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=athlon64-sse3 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -march=athlon64-sse3 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://www.cyberuse.com/gentoo/ http://mirror.datapipe.net/gentoo ftp://mirror.datapipe.net/gentoo http://gentoo.mirrors.easynews.com/linux/gentoo/ http://chi-10g-1-mirror.fastsoft.net/pub/linux/gentoo/gentoo-distfiles/ ftp://chi-10g-1-mirror.fastsoft.net/pub/linux/gentoo/gentoo-distfiles/ http://distro.ibiblio.org/pub/linux/distributions/gentoo/ rsync://distro.ibiblio.org/pub/linux/distributions/gentoo/ ftp://ftp.ussg.iu.edu/pub/linux/gentoo http://lug.mtu.edu/gentoo/ ftp://lug.mtu.edu/gentoo/ ftp://gentoo.netnitco.net/pub/mirrors/gentoo/source/ http://gentoo.netnitco.net http://gentoo.osuosl.org/ http://gentoo.mirrors.pair.com/ ftp://gentoo.mirrors.pair.com/ rsync://mirrors.rit.edu/gentoo/ ftp://mirrors.rit.edu/gentoo/ http://mirrors.rit.edu/gentoo/ ftp://mirror.iawnet.sandia.gov/pub/gentoo/ http://mirror.iawnet.sandia.gov/gentoo/ ftp://gentoo.llarian.net/pub/gentoo http://gentoo.llarian.net/ ftp://gentoo.mirrors.tds.net/gentoo rsync://gentoo.mirrors.tds.net/gentoo http://gentoo.mirrors.tds.net/gentoo http://ftp.ucsb.edu/pub/mirrors/linux/gentoo/ ftp://ftp.ucsb.edu/pub/mirrors/linux/gentoo/ ftp://ftp.lug.udel.edu/pub/gentoo/ http://mirror.lug.udel.edu/pub/gentoo/ ftp://mirror.its.uidaho.edu/gentoo/ http://mirror.its.uidaho.edu/pub/gentoo/ http://gentoo.cites.uiuc.edu/pub/gentoo/ ftp://gentoo.cites.uiuc.edu/pub/gentoo/ rsync://gentoo.cs.uni.edu/gentoo-distfiles http://gentoo.cs.uni.edu/ http://mirror.usu.edu/mirrors/gentoo/ ftp://ftp.wallawalla.edu/pub/mirrors/ftp.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/x11"
SYNC="rsync://rsync.us.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi additions alsa amd64 apng automount branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cups cxx dbus dirac doc dri dts dvd dvdr emboss encode exif extras facc fadd fam firefox flac fontconfig fortran gd gdbm gdu gif gnome gpm gtk hddtemp iconv introspection iostats ipv6 java jpeg kdrive lcms ldap libnotify live lm_sensors lock lua lua-cairo lua-imlib lxde mad math mmx mng modules mp3 mp4 mpeg mudflap multilib ncurses network nls nptl nptlonly ogg opengl openmp pam pango pcre pdf png policykit ppds pppd pulseaudio python qt-bundled qt3support qt4 readline rss scanner sdl session sound spell sqlite sse sse2 ssl startup-notification static-libs svg sysfs tcpd tiff truetype udev unicode usb utp vorbis x264 xcb xml xorg xulrunner xv xvid xvmc zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev mouse keyboard" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="ati vesa" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 29 Hans de Graaff gentoo-dev Security 2011-12-29 06:28:59 UTC
(In reply to comment #18)
> queued it up then
> 
> http://sources.gentoo.org/gentoo/src/patchsets/glibc/2.14.1/0068_all_glibc-2.14-glibc-revert-fseek-on-fclose.patch?rev=1.1

Can you please release this patch? We just had a security bump for ruby over in bug 396301 but with current glibc people won't be able to update to that version.
Comment 30 Alex Legler (RETIRED) archtester gentoo-dev Security 2011-12-29 08:52:53 UTC
*** Bug 396391 has been marked as a duplicate of this bug. ***
Comment 31 Alex Legler (RETIRED) archtester gentoo-dev Security 2011-12-29 09:57:10 UTC
*** Bug 396393 has been marked as a duplicate of this bug. ***
Comment 32 Alex Legler (RETIRED) archtester gentoo-dev Security 2011-12-29 12:55:57 UTC
*** Bug 396407 has been marked as a duplicate of this bug. ***
Comment 33 PM 2011-12-29 13:01:40 UTC
Why is it marked RESOLVED FIXED if it's not fixed?
Comment 34 Alex Legler (RETIRED) archtester gentoo-dev Security 2011-12-29 13:21:09 UTC
*** Bug 396409 has been marked as a duplicate of this bug. ***
Comment 35 Hans de Graaff gentoo-dev Security 2011-12-29 15:10:28 UTC
Reopening this since it is not fixed in CVS and many people are now hitting this.
Comment 36 Alex Legler (RETIRED) archtester gentoo-dev Security 2011-12-29 16:20:03 UTC
*** Bug 396423 has been marked as a duplicate of this bug. ***
Comment 37 Graham Murray 2011-12-29 21:43:26 UTC
(In reply to comment #6)
> The conclusion appears to be that this is a bug in glibc instead. See
> http://sourceware.org/bugzilla/show_bug.cgi?id=12724
> 
> Reassigning accordingly.

Is this a bug in glibc, as (at least on my ~x86 system)  glibc 2.14.1-r1 seems to have the that bug fixed as the sample program in the bug runs successfully (ie none of the asserts trigger). So if anything it looks like the fix to the glibc bug has triggered a problem in ruby, so should it not be fixed in ruby rather than reverting the change to glibc?
Comment 38 Sven E. 2011-12-30 13:47:08 UTC
(In reply to comment #37)
> (In reply to comment #6)
> > The conclusion appears to be that this is a bug in glibc instead. See
> > http://sourceware.org/bugzilla/show_bug.cgi?id=12724
> > 
> > Reassigning accordingly.
> 
> Is this a bug in glibc, as (at least on my ~x86 system)  glibc 2.14.1-r1 seems
> to have the that bug fixed as the sample program in the bug runs successfully
> (ie none of the asserts trigger). So if anything it looks like the fix to the
> glibc bug has triggered a problem in ruby, so should it not be fixed in ruby
> rather than reverting the change to glibc?

Not a glibc bug imho. The patch presented here reverts functionality introduced to adhere standards and as such changes glibc'S behavior if reverted. This needs to be fixed in ruby.
Comment 39 Martin Mokrejš 2011-12-30 14:01:51 UTC
Patch attached to bug #396393 fixes the problem with ruby, IMHO.
Comment 40 Hans de Graaff gentoo-dev Security 2011-12-30 14:10:56 UTC
(In reply to comment #38)
> (In reply to comment #37)
> > (In reply to comment #6)
> > > The conclusion appears to be that this is a bug in glibc instead. See
> > > http://sourceware.org/bugzilla/show_bug.cgi?id=12724
> > > 
> > > Reassigning accordingly.
> > 
> > Is this a bug in glibc, as (at least on my ~x86 system)  glibc 2.14.1-r1 seems
> > to have the that bug fixed as the sample program in the bug runs successfully
> > (ie none of the asserts trigger). So if anything it looks like the fix to the
> > glibc bug has triggered a problem in ruby, so should it not be fixed in ruby
> > rather than reverting the change to glibc?
> 
> Not a glibc bug imho. The patch presented here reverts functionality introduced
> to adhere standards and as such changes glibc'S behavior if reverted. This
> needs to be fixed in ruby.

Nope, while the patch in glibc fixes one aspect, it doesn't fix another, leaving a non-POSIX solution in place that ruby happens to trip up. This needs to be reverted or fixed properly in glibc, which is what Mike already has done (but not added to our main tree yet).
Comment 41 Hans de Graaff gentoo-dev Security 2011-12-30 14:12:36 UTC
(In reply to comment #39)
> Patch attached to bug #396393 fixes the problem with ruby, IMHO.

It doesn't. True, it let's ruby's own build process continue, but this still leaves broken code around that will trip up other people's code. I'd rather ruby doesn't build at all in that case.
Comment 42 Hans de Graaff gentoo-dev Security 2011-12-31 07:15:40 UTC
*** Bug 396563 has been marked as a duplicate of this bug. ***
Comment 43 Alex Legler (RETIRED) archtester gentoo-dev Security 2012-01-01 02:13:33 UTC
*** Bug 396645 has been marked as a duplicate of this bug. ***
Comment 44 Hans de Graaff gentoo-dev Security 2012-02-19 07:05:14 UTC
*** Bug 404399 has been marked as a duplicate of this bug. ***