Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 389881 - sys-apps/sed-4.2.1-r1 sometimes fails with SIGABRT when built against sys-libs/glibc-2.14* on x86
Summary: sys-apps/sed-4.2.1-r1 sometimes fails with SIGABRT when built against sys-lib...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: Normal normal with 1 vote (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: glibc-2.14
  Show dependency tree
 
Reported: 2011-11-08 13:04 UTC by Martin Jansa
Modified: 2012-04-15 19:25 UTC (History)
4 users (show)

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


Attachments
test.txt (test.txt,76.72 KB, text/plain)
2011-11-08 13:05 UTC, Martin Jansa
Details
Valgrind log of sed (sed-valgrind.log,7.80 KB, text/plain)
2012-01-19 14:39 UTC, Vlastimil Babka (Caster) (RETIRED)
Details
fix from upstream glibc (0091_all_glibc-2.14-regex-buffer-checks.patch,6.97 KB, patch)
2012-04-09 19:52 UTC, SpanKY
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Jansa 2011-11-08 13:04:04 UTC
After upgrade to sys-libs/glibc-2.14 (I know it's masked) I have noticed SIGABRT while building glib.

This SIGABRT is in sed call
sed 's/^\(.*\SUBDIRS .*\=.*\)tests\(.*\)$/\1\2/' test.txt
I'll attach test.txt (which is gobject/Makefile.in from dev-libs/glib-2.30.1-r1)
And on amd64 it works fine, only x86 version (in my 32bit chroot) get SIGABRT.

libgobject_2_0_la-gobject.lo: gobject.c
*** glibc detected *** /bin/sed: malloc(): memory corruption: 0x08067e70 ***
======= Backtrace: =========
/lib/libc.so.6(+0x71972)[0xf7eba972]
/lib/libc.so.6(+0x7331d)[0xf7ebc31d]
/lib/libc.so.6(__libc_calloc+0xa7)[0xf7ebf1d7]
/lib/libc.so.6(+0xaf480)[0xf7ef8480]
/lib/libc.so.6(+0xb2844)[0xf7efb844]
/lib/libc.so.6(+0xb72c5)[0xf7f002c5]
/lib/libc.so.6(re_search+0x37)[0xf7f00c67]
/bin/sed[0x804f047]
/bin/sed[0x804e542]
/bin/sed[0x804ed2b]
/bin/sed[0x8049b5b]
/lib/libc.so.6(__libc_start_main+0xf3)[0xf7e656e3]
/bin/sed[0x8049c45]
======= Memory map: ========
08048000-08057000 r-xp 00000000 09:02 1103522                            /bin/sed
08057000-08058000 r--p 0000e000 09:02 1103522                            /bin/sed
08058000-08059000 rw-p 0000f000 09:02 1103522                            /bin/sed
08059000-0807f000 rw-p 00000000 00:00 0                                  [heap]
f7ae3000-f7afe000 r-xp 00000000 09:02 917676                             /lib/libgcc_s.so.1
f7afe000-f7aff000 r--p 0001a000 09:02 917676                             /lib/libgcc_s.so.1
f7aff000-f7b00000 rw-p 0001b000 09:02 917676                             /lib/libgcc_s.so.1
f7b00000-f7b21000 rw-p 00000000 00:00 0
f7b21000-f7c00000 ---p 00000000 00:00 0
f7c1b000-f7c1e000 rw-p 00000000 00:00 0
f7c1e000-f7c25000 r--s 00000000 09:02 807727                             /usr/lib/gconv/gconv-modules.cache
f7c25000-f7c42000 r--p 00200000 09:02 692834                             /usr/lib/locale/locale-archive
f7c42000-f7e42000 r--p 00000000 09:02 692834                             /usr/lib/locale/locale-archive
f7e42000-f7e43000 rw-p 00000000 00:00 0
f7e43000-f7e47000 r-xp 00000000 09:02 528861                             /lib/libattr.so.1.1.0
f7e47000-f7e48000 r--p 00003000 09:02 528861                             /lib/libattr.so.1.1.0
f7e48000-f7e49000 rw-p 00004000 09:02 528861                             /lib/libattr.so.1.1.0
f7e49000-f7fbf000 r-xp 00000000 09:02 931658                             /lib/libc-2.14.1.so
f7fbf000-f7fc1000 r--p 00176000 09:02 931658                             /lib/libc-2.14.1.so
f7fc1000-f7fc2000 rw-p 00178000 09:02 931658                             /lib/libc-2.14.1.so
f7fc2000-f7fc5000 rw-p 00000000 00:00 0
f7fc5000-f7fcd000 r-xp 00000000 09:02 540829                             /lib/libacl.so.1.1.0
f7fcd000-f7fce000 r--p 00007000 09:02 540829                             /lib/libacl.so.1.1.0
f7fce000-f7fcf000 rw-p 00008000 09:02 540829                             /lib/libacl.so.1.1.0
f7fdc000-f7fdd000 rw-p 00000000 00:00 0
f7fdd000-f7ffc000 r-xp 00000000 09:02 931657                             /lib/ld-2.14.1.so
f7ffc000-f7ffd000 r--p 0001e000 09:02 931657                             /lib/ld-2.14.1.so
f7ffd000-f7ffe000 rw-p 0001f000 09:02 931657                             /lib/ld-2.14.1.so
fffdd000-ffffe000 rw-p 00000000 00:00 0                                  [stack]
ffffe000-fffff000 r-xp 00000000 00:00 0                                  [vdso]

Program received signal SIGABRT, Aborted.
0xffffe425 in __kernel_vsyscall ()
(gdb) bt
#0  0xffffe425 in __kernel_vsyscall ()
#1  0xf7e79d1f in raise () from /lib/libc.so.6
#2  0xf7e7b5a5 in abort () from /lib/libc.so.6
#3  0xf7eb3f07 in ?? () from /lib/libc.so.6
#4  0xf7eba972 in ?? () from /lib/libc.so.6
#5  0xf7ebc31d in ?? () from /lib/libc.so.6
#6  0xf7ebf1d7 in calloc () from /lib/libc.so.6
#7  0xf7ef8480 in ?? () from /lib/libc.so.6
#8  0xf7efb844 in ?? () from /lib/libc.so.6
#9  0xf7f002c5 in ?? () from /lib/libc.so.6
#10 0xf7f00c67 in re_search () from /lib/libc.so.6
#11 0x0804f047 in ?? ()
#12 0x0804e542 in ?? ()
#13 0x0804ed2b in ?? ()
#14 0x08049b5b in ?? ()
#15 0xf7e656e3 in __libc_start_main () from /lib/libc.so.6
#16 0x08049c45 in ?? ()
Backtrace stopped: Not enough registers or memory available to unwind further

32bit jama sed-test # emerge --info
Portage 2.2.0_alpha72 (default/linux/x86/10.0/desktop/kde, gcc-4.6.2, glibc-2.14.1-r0, 3.1.0-gentoo i686)
=================================================================
System uname: Linux-3.1.0-gentoo-i686-AMD_Phenom-tm-_II_X4_965_Processor-with-gentoo-2.1
Timestamp of tree: Tue, 08 Nov 2011 07:30:01 +0000
app-shells/bash:          4.2_p10
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.2-r3, 3.2.2
dev-util/cmake:           2.8.6-r3
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.1
sys-apps/openrc:          0.9.4
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.68
sys-devel/automake:       1.11.1-r1
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            4.6.2
sys-devel/gcc-config:     1.4.1-r1
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 2.6.39 (virtual/os-headers)
sys-libs/glibc:           2.14.1
Repositories: gentoo portage-local
Installed sets: @system
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="* -@EULA RTCW-ETEULA PUEL dlj-1.1 skype-eula AdobeFlash-10.1 Oracle-BCLA-JavaSE"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=barcelona -pipe -ftree-vectorize"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.0/conf /usr/share/openvpn/easy-rsa /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo"
CXXFLAGS="-O2 -march=barcelona -pipe -ftree-vectorize"
DISTDIR="/distfiles"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles news parallel-fetch preserve-libs protect-owned sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://gentoo.mirror.web4u.cz/distfiles/"
LANG="en_US"
LC_ALL="cs_CZ.utf8"
LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu"
LINGUAS="cs en en_US en_GB"
MAKEOPTS="-j1"
PKGDIR="/binpkgs"
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="/tmpwork"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow X a52 aac aalib acl acpi aiglx aio alsa amr apache2 bash-completion berkdb bidi bluetooth branding bzip2 cairo ccache cdda cdparanoia cdr cdrom cgi cli consolekit cracklib crypt curl cxx dba dbus declarative dga dio dri dts dvb dvd dvdr emboss encode exif fam fbcon ffmpeg firefox flac flash fmod font-server ftp gb gd gdu gif gkrellm glib glut gnutls gpg2-experimental gpgme gpm gzip iconv icq imagemagick imap imlib innodb ipv6 irc irda jabber java java5 javascript jikes joystick jpeg kdehiddenvisibility kipi kpathsea kqemu krb4 lame lcms libcaca libnotify libwww linuxthreads-tls lirc live lm_sensors logrotate mad maildir matroska mime mng modules mozilla mozsvg mp3 mp4 mpeg mudflap mysql mysqli ncurses network nls nntp nocd nptl nptlonly nsplugin nvidia ogg openal opengl openmp opera oss pam pango pcre pdf phonon php pic plasma png policykit pop posix ppds pppd python3 qt3support qt4 readline rss rsync rtc samba sasl screen sdl semantic-desktop session silc slang smartcard smime smtp sndfile sockets spell ssh ssl startup-notification stream subversion svg svgz symlink sysfs tcpd tetex theora threads tiff truetype udev unicode usb utempter uudeview v4l v4l2 vdpau vdr videos vim vorbis wxwindows x264 x86 xanim xcb xcomposite xinerama xinetd xml xmlreader xmlrpc xorg xosd xpm xscreensaver xsl xulrunner xv xvid zip zlib zvbi" 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 auth_digest authn_anon authn_dbd 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 dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" APACHE2_MPMS="worker" 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="keyboard mouse evdev joystick" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="cs en en_US en_GB" LIRC_DEVICES="devinput" NETBEANS_MODULES="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="vesa nv v4l nouveau nvidia" 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, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS



Reproducible: Always

Steps to Reproduce:
1. download attached test.txt
2. sed 's/^\(.*\SUBDIRS .*\=.*\)tests\(.*\)$/\1\2/' test.txt > test.out
3.
Actual Results:  
sed fails with SIGABRT

Expected Results:  
sed exits fine without any change in file

I can reproduce it only on x86, amd64 doesn't seem affected
Comment 1 Martin Jansa 2011-11-08 13:05:48 UTC
Created attachment 291971 [details]
test.txt

gobject/Makefile.in from dev-libs/glib-2.30.1-r1 where it can be reproduced
Comment 2 SpanKY gentoo-dev 2011-11-21 21:53:59 UTC
i can't reproduce:
$ qlist -Iv sed glibc
sys-apps/sed-4.2.1-r1
sys-libs/glibc-2.14.1
$ portageq envvar CFLAGS
-O2 -pipe -march=i686 -Wall -g
$ sed 's/^\(.*\SUBDIRS .*\=.*\)tests\(.*\)$/\1\2/' test.txt >/dev/null
$

your -ftree-vectorize looks suspicious though.  can you rebuild glibc/sed without that ?
Comment 3 Martin Jansa 2011-11-24 10:05:06 UTC
Hi, I've tried to rebuild glibc and sed without -ftree-vectorize and then even without -march=barcelona -pipe (so only CFLAGS="-O2") and still I have this issue. 

I'll try to reboot to this chroot directly when I'm at home to see if it happens only when chrooted from 64bit.

Regards,
Comment 4 whitehawk 2011-11-26 20:26:40 UTC
This might be related, I get this sed error when I run revdep-rebuild -ip
(sed also dies while called during binutils build, I don't know what's the output then.. still looking)

*** glibc detected *** sed: free(): invalid next size (fast): 0x09beb9f0 ***
======= Backtrace: =========
/lib/libc.so.6(+0x6ebff)[0x6f7a8bff]
/lib/libc.so.6(+0x7056b)[0x6f7aa56b]
/lib/libc.so.6(cfree+0x6e)[0x6f7ad78e]
/lib/libc.so.6(+0xb0efd)[0x6f7eaefd]
/lib/libc.so.6(+0xb70f6)[0x6f7f10f6]
/lib/libc.so.6(re_search+0x34)[0x6f7f1a74]
sed[0x80520f7]
======= Memory map: ========
08048000-08059000 r-xp 00000000 08:02 21639124   /bin/sed
08059000-0805a000 r--p 00010000 08:02 21639124   /bin/sed
0805a000-0805b000 rw-p 00011000 08:02 21639124   /bin/sed
0805b000-08060000 rw-p 00000000 00:00 0 
09be8000-09c09000 rw-p 00000000 00:00 0          [heap]
6f200000-6f221000 rw-p 00000000 00:00 0 
6f221000-6f300000 ---p 00000000 00:00 0 
6f3c7000-6f3e0000 r-xp 00000000 08:02 31591313   /lib/libgcc_s.so.1
6f3e0000-6f3e1000 r--p 00018000 08:02 31591313   /lib/libgcc_s.so.1
6f3e1000-6f3e2000 rw-p 00019000 08:02 31591313   /lib/libgcc_s.so.1
6f3fe000-6f533000 r--p 001c7000 08:02 12322164   /usr/lib/locale/locale-archive
6f533000-6f733000 r--p 00000000 08:02 12322164   /usr/lib/locale/locale-archive
6f733000-6f734000 rw-p 00000000 00:00 0 
6f734000-6f738000 r-xp 00000000 08:02 21889116   /lib/libattr.so.1.1.0
6f738000-6f739000 r--p 00003000 08:02 21889116   /lib/libattr.so.1.1.0
6f739000-6f73a000 rw-p 00004000 08:02 21889116   /lib/libattr.so.1.1.0
6f73a000-6f897000 r-xp 00000000 08:02 21434602   /lib/libc-2.14.1.so
6f897000-6f898000 ---p 0015d000 08:02 21434602   /lib/libc-2.14.1.so
6f898000-6f89a000 r--p 0015d000 08:02 21434602   /lib/libc-2.14.1.so
6f89a000-6f89b000 rw-p 0015f000 08:02 21434602   /lib/libc-2.14.1.so
6f89b000-6f89e000 rw-p 00000000 00:00 0 
6f89e000-6f8a6000 r-xp 00000000 08:02 21650561   /lib/libacl.so.1.1.0
6f8a6000-6f8a7000 r--p 00007000 08:02 21650561   /lib/libacl.so.1.1.0
6f8a7000-6f8a8000 rw-p 00008000 08:02 21650561   /lib/libacl.so.1.1.0
6f8ba000-6f8bd000 rw-p 00000000 00:00 0 
6f8bd000-6f8c4000 r--s 00000000 08:02 12322163   /usr/lib/gconv/gconv-modules.cache
6f8c4000-6f8c5000 rw-p 00000000 00:00 0 
6f8c5000-6f8c6000 r-xp 00000000 00:00 0          [vdso]
6f8c6000-6f8e3000 r-xp 00000000 08:02 21434453   /lib/ld-2.14.1.so
6f8e3000-6f8e4000 r--p 0001c000 08:02 21434453   /lib/ld-2.14.1.so
6f8e4000-6f8e5000 rw-p 0001d000 08:02 21434453   /lib/ld-2.14.1.so
77f54000-77f76000 rw-p 00000000 00:00 0          [stack]



-----emerge info------

Portage 2.1.10.38 (default/linux/x86/10.0/desktop, gcc-4.5.3, glibc-2.14.1-r0, 3.0.9-tuxonice-1 i686)
=================================================================
System uname: Linux-3.0.9-tuxonice-1-i686-Intel-R-_Core-TM-2_Duo_CPU_L9400_@_1.86GHz-with-gentoo-2.1
Timestamp of tree: Sat, 26 Nov 2011 08: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.2.2
dev-util/cmake:           2.8.6-r3
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.1
sys-apps/openrc:          0.9.6
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.11.1-r1
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            4.5.3-r1
sys-devel/gcc-config:     1.5-r2
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 2.6.39 (virtual/os-headers)
sys-libs/glibc:           2.14.1
Repositories: gentoo x-portage roslin science gamerlay-stable proaudio lordvan sunrise xwing oss-overlay
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="* -@EULA cadsoft dlj-1.1 skype-eula AdobeFlash-10.1"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=native -O3 -pipe -fomit-frame-pointer -fforce-addr -falign-functions=64 -fprefetch-loop-arrays -fno-tree-vectorize"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/locale.gen /usr/share/gnupg/qualified.txt /usr/share/openvpn/easy-rsa"
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="-march=native -O3 -pipe -fomit-frame-pointer -fforce-addr -falign-functions=64 -fprefetch-loop-arrays -fno-tree-vectorize"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles metadata-transfer news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://gentoo.inf.elte.hu ftp://gentoo.inf.elte.hu  ftp://ftp2.gentoo.hu/gentoo/"
LANG="hu_HU.UTF-8"
LC_ALL="hu_HU.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="hu en en_GB de it"
MAKEOPTS="-j3"
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="/usr/local/portage /var/lib/layman/roslin /var/lib/layman/science /var/lib/layman/gamerlay /var/lib/layman/pro-audio /var/lib/layman/lordvan /var/lib/layman/sunrise /var/lib/layman/xwing /var/lib/layman/oss-overlay"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi adns alsa ares atlas audiofile avahi bash-completion bidi bluetooth bonobo branding bzip2 cairo caps cdda cli consolekit cracklib crypt cscope cups curl cxx dbus divx4linux dri dts dv eds emboss encode evo exif fam fbcon ffmpeg fftw flac flash freetds fuse gb gd gdbm gdu gif ginac glade gnome gnome-keyring gnutls gphoto2 gpm gstreamer gtk gtk3 gtkhtml hal hybrid-auth iconv icu id3tag idn ifc imagemagick imap imlib ipv6 jabber jack java jikes jingle jpeg ladspa lcms ldap lesstif libffi libgda libnotify libsamplerate lzo mad maildir mcal memlimit mmx mmx2 mmxext mng modplug modules mozilla mp3 mp4 mpeg msn mudflap mule ncurses networkmanager newspr nhc98 nls nocd nptl nptlonly nsplugin ntp offensive ogg opengl openmp pam pango pcmcia pcre pdf perl plotutils plugins png policykit ppds pppd prelude qt-static qt3support quicktime rar readline resolvconf samba sasl session slang slp smp sndfile snmp sound sox speex spell sqlite sse sse2 sse3 ssl ssse3 startup-notification svg sysfs tcpd theora threads tiff truetype type1 udev unicode usb v4l2 vaapi videos vorbis webkit wifi wmf x264 x86 xcb xcomposite xface xinerama xml xml2 xorg xpm xulrunner xv xvid zlib" ALSA_CARDS="hda-intel" 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" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="hu en en_GB de it" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="i810 i915 intel" 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, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 5 Martin Jansa 2011-11-28 17:11:50 UTC
Hopefully I'll test after reboot today, but I've noticed weird \S escape
"sed 's/^\(.*\SUBDIRS .*\=.*\)tests\(.*\)$/\1\2/' test.txt >/dev/null" still fails, but
"sed 's/^\(.*SUBDIRS .*\=.*\)tests\(.*\)$/\1\2/' test.txt >/dev/null" works without SIGABRT.

So removing extra \ from this sed call (I'm not aware of S or = having special meaning in regexp) in glib recipe seems good work around until sed is fixed. Can you please do it or should I report another bug?
Comment 6 SpanKY gentoo-dev 2011-12-01 18:54:55 UTC
i'd rather find/fix the actual problem
Comment 7 Martin Jansa 2011-12-02 22:08:53 UTC
I also cannot reproduce it after reboot to 32bit system.. so the important part is probably chroot, maybe whitehawk has it without chroot?
Comment 8 whitehawk 2011-12-16 21:22:11 UTC
I don't use chroot. I thought it was perhaps because I used -O3 optimizations, so I went back to O2 recompiled..

It seems that the solution is that I added LC_ALL=en_GB.UTF-8 in front of emerge.. I guess sed has problems with hu_HU.UTF-8 which is my default locale. Wouldn't be the first time with sed...

So what is your locale in chroot?
Comment 9 Martin Jansa 2011-12-23 09:08:30 UTC
Yes it's somehow related to locale too, I still cannot reproduce it outside chroot (from my main 64bit installation or after rebooting to it), but with en_US.UTF-8 it doesn't fail:

32bit jama sed-test # export LC_ALL=en_US.UTF-8
32bit jama sed-test # ./test.sh
32bit jama sed-test # unset LC_ALL
32bit jama sed-test # ./test.sh
32bit jama sed-test # export LC_ALL=cs_CZ.UTF-8
32bit jama sed-test # ./test.sh
*** glibc detected *** sed: double free or corruption (!prev): 0x09edce48 ***

locale-gen doesn't help:
32bit jama sed-test # locale-gen
 * Generating 2 locales (this might take a while) with 1 jobs
 *  (1/2) Generating en_US.UTF-8 ... [ ok ]
 *  (2/2) Generating cs_CZ.UTF-8 ... [ ok ]
 * Generation complete

32bit jama sed-test # locale
LANG=en_US
LC_CTYPE="cs_CZ.UTF-8"
LC_NUMERIC="cs_CZ.UTF-8"
LC_TIME="cs_CZ.UTF-8"
LC_COLLATE="cs_CZ.UTF-8"
LC_MONETARY="cs_CZ.UTF-8"
LC_MESSAGES="cs_CZ.UTF-8"
LC_PAPER="cs_CZ.UTF-8"
LC_NAME="cs_CZ.UTF-8"
LC_ADDRESS="cs_CZ.UTF-8"
LC_TELEPHONE="cs_CZ.UTF-8"
LC_MEASUREMENT="cs_CZ.UTF-8"
LC_IDENTIFICATION="cs_CZ.UTF-8"
LC_ALL=cs_CZ.UTF-8

I've tried to unset LC_ALL and then set all LC_* one by one to see when it starts failing and no single option is causing this and it happens only if _ALL_ LC_* (well except LC_ALL) are set to something and LC_COLLATE is set to cs_CZ.UTF-8.

So this is failing too:
32bit jama sed-test # locale
LANG=en_US
LC_CTYPE=en_US.UTF-8
LC_NUMERIC=en_US.UTF-8
LC_TIME=en_US.UTF-8
LC_COLLATE=cs_CZ.UTF-8
LC_MONETARY=en_US.UTF-8
LC_MESSAGES=en_US.UTF-8
LC_PAPER=en_US.UTF-8
LC_NAME=en_US.UTF-8
LC_ADDRESS=en_US.UTF-8
LC_TELEPHONE=en_US.UTF-8
LC_MEASUREMENT=en_US.UTF-8
LC_IDENTIFICATION=en_US.UTF-8
LC_ALL=

but setting LC_COLLATE only isn't
32bit jama sed-test # unset LC_PAPER LC_ADDRESS LC_MONETARY LC_NUMERIC LC_TELEPHONE LC_TYPE LC_MESSAGES LC_IDENTIFICATION LC_COLLATE LC_MEASUREMENT LC_CTYPE LC_TIME LC_NAME
32bit jama sed-test # locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US
LC_CTYPE="en_US"
LC_NUMERIC="en_US"
LC_TIME="en_US"
LC_COLLATE="en_US"
LC_MONETARY="en_US"
LC_MESSAGES="en_US"
LC_PAPER="en_US"
LC_NAME="en_US"
LC_ADDRESS="en_US"
LC_TELEPHONE="en_US"
LC_MEASUREMENT="en_US"
LC_IDENTIFICATION="en_US"
LC_ALL=
32bit jama sed-test # ./test.sh
32bit jama sed-test # export LC_COLLATE=cs_CZ.UTF-8
32bit jama sed-test # ./test.sh
32bit jama sed-test #
Comment 10 SpanKY gentoo-dev 2012-01-03 02:37:35 UTC
what is your "test.sh" ?  my 32bit chroot doesn't crash in any of the locales mentioned here and the test file.
Comment 11 Martin Jansa 2012-01-03 07:24:41 UTC
(In reply to comment #10)
> what is your "test.sh" ?  my 32bit chroot doesn't crash in any of the locales
> mentioned here and the test file.

Ah sorry I didn't include that, just that line:
sed 's/^\(.*\SUBDIRS .*\=.*\)tests\(.*\)$/\1\2/' test.txt
but it was the same when called directly
Comment 12 Attila Tóth 2012-01-06 10:46:56 UTC
(In reply to comment #10)
> what is your "test.sh" ?  my 32bit chroot doesn't crash in any of the locales
> mentioned here and the test file.

I'd like to confirm this bug. It happens on two 32bit systems (Pentium-M and Athlon-MP). I'm also using Hungarian locale: hu_HU.UTF-8!
IMHO it's a nasty sed bug, which needs new glibc and certain locales to get triggered.

Output on one of my systems:
 * Configuring search environment for revdep-rebuild

 * Checking reverse dependencies
 * Packages containing binaries and libraries broken by a package update
 * will be emerged.

 * Collecting system binaries and libraries
 * Generated new 1_files.rr
 * Collecting complete LD_LIBRARY_PATH
*** glibc detected *** sed: double free or corruption (!prev): 0x11770008 ***
======= Backtrace: =========
/lib/libc.so.6(+0x6e41f)[0x4fe5a41f]
/lib/libc.so.6(+0x6fd33)[0x4fe5bd33]
/lib/libc.so.6(cfree+0x6d)[0x4fe5ee7d]
/lib/libc.so.6(+0xafc7d)[0x4fe9bc7d]
/lib/libc.so.6(+0xb5e15)[0x4fea1e15]
/lib/libc.so.6(re_search+0x34)[0x4fea2774]
sed(+0x8c04)[0x11757c04]
sed(+0x7a4e)[0x11756a4e]
sed(+0x8911)[0x11757911]
sed(main+0x3cb)[0x11751c0b]
/lib/libc.so.6(__libc_start_main+0xe6)[0x4fe06326]
sed(+0x2311)[0x11751311]
======= Memory map: ========
1174f000-1175f000 r-xp 00000000 08:02 591140     /bin/sed
1175f000-11760000 r--p 0000f000 08:02 591140     /bin/sed
11760000-11761000 rw-p 00010000 08:02 591140     /bin/sed
11761000-1178d000 rw-p 00000000 00:00 0          [heap]
4f900000-4f921000 rw-p 00000000 00:00 0
4f921000-4fa00000 ---p 00000000 00:00 0
4fa1d000-4fa38000 r-xp 00000000 08:02 1658262   
/usr/lib/gcc/i686-pc-linux-gnu/4.5.3/libgcc_s.so.1
4fa38000-4fa39000 r--p 0001a000 08:02 1658262   
/usr/lib/gcc/i686-pc-linux-gnu/4.5.3/libgcc_s.so.1
4fa39000-4fa3a000 rw-p 0001b000 08:02 1658262   
/usr/lib/gcc/i686-pc-linux-gnu/4.5.3/libgcc_s.so.1
4fa71000-4fbe5000 r--p 00203000 08:02 1084351   
/usr/lib/locale/locale-archive
4fbe5000-4fde5000 r--p 00000000 08:02 1084351   
/usr/lib/locale/locale-archive
4fde5000-4fde6000 rw-p 00000000 00:00 0
4fde6000-4fdea000 r-xp 00000000 08:02 2120899    /lib/libattr.so.1.1.0
4fdea000-4fdeb000 r--p 00003000 08:02 2120899    /lib/libattr.so.1.1.0
4fdeb000-4fdec000 rw-p 00004000 08:02 2120899    /lib/libattr.so.1.1.0
4fdec000-4ff47000 r-xp 00000000 08:02 2119387    /lib/libc-2.14.1.so
4ff47000-4ff49000 r--p 0015b000 08:02 2119387    /lib/libc-2.14.1.so
4ff49000-4ff4a000 rw-p 0015d000 08:02 2119387    /lib/libc-2.14.1.so
4ff4a000-4ff4d000 rw-p 00000000 00:00 0
4ff4d000-4ff54000 r-xp 00000000 08:02 2120900    /lib/libacl.so.1.1.0
4ff54000-4ff55000 r--p 00007000 08:02 2120900    /lib/libacl.so.1.1.0
4ff55000-4ff56000 rw-p 00008000 08:02 2120900    /lib/libacl.so.1.1.0
4ff83000-4ff86000 rw-p 00000000 00:00 0
4ff86000-4ff8d000 r--s 00000000 08:02 1084349   
/usr/lib/gconv/gconv-modules.cache
4ff8d000-4ff8e000 rw-p 00000000 00:00 0
4ff8e000-4ff8f000 r-xp 00000000 00:00 0          [vdso]
4ff8f000-4ffac000 r-xp 00000000 08:02 2119388    /lib/ld-2.14.1.so
4ffac000-4ffad000 r--p 0001c000 08:02 2119388    /lib/ld-2.14.1.so
4ffad000-4ffae000 rw-p 0001d000 08:02 2119388    /lib/ld-2.14.1.so
588a8000-588ca000 rw-p 00000000 00:00 0          [stack]
7174f000-7175f000 r-xp 00000000 08:02 591140     /bin/sed
afa1d000-afa38000 r-xp 00000000 08:02 1658262   
/usr/lib/gcc/i686-pc-linux-gnu/4.5.3/libgcc_s.so.1
afde6000-afdea000 r-xp 00000000 08:02 2120899    /lib/libattr.so.1.1.0
afdec000-aff47000 r-xp 00000000 08:02 2119387    /lib/libc-2.14.1.so
aff4d000-aff54000 r-xp 00000000 08:02 2120900    /lib/libacl.so.1.1.0
aff8e000-aff8f000 r-xp 00000000 00:00 0          [vdso]
aff8f000-affac000 r-xp 00000000 08:02 2119388    /lib/ld-2.14.1.so
 * Generated new 2_ldpath.rr
 * Checking dynamic linking consistency
Comment 13 Attila Tóth 2012-01-11 16:00:04 UTC
How come this bug hasn't been confirmed, yet?
Simple:
But a 32bit Gentoo install with a recent glibc. Make sure you have cs_CZ.UTF-8 or hu_HU.UTF-8 locale set (others might be affected as well - I guess some Eastern-European locales fromer users of iso-8859-2 codepage). Start a revdep-rebuild or start merging glibc. Observe the error.
This bug is nasty. It's a core bug. And it will surely affect a lot of people using non-western locale. Please pay attention to this.
Comment 14 Martin Jansa 2012-01-16 09:59:06 UTC
Upgrading glibc to 2.15 in my 32bit chroot resolved this issue.
Comment 15 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2012-01-19 14:00:04 UTC
I have this problem on amd64 during build of dev-libs/glib-2.30.2-r1

 * Applying glib-2.24-assert-test-failure.patch ...                                                                                                                                                                                   [ ok ]
*** glibc detected *** sed: double free or corruption (!prev): 0x00000000024cd4d0 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x76155)[0x7f8198506155]
/lib64/libc.so.6(cfree+0x6c)[0x7f819850b08c]
/lib64/libc.so.6(+0xbc63a)[0x7f819854c63a]
/lib64/libc.so.6(+0xc267e)[0x7f819855267e]
/lib64/libc.so.6(re_search+0x18)[0x7f8198553018]
sed[0x408022]
sed[0x406e3d]
sed[0x407cff]
sed[0x402d7c]
/lib64/libc.so.6(__libc_start_main+0xfd)[0x7f81984b222d]
sed[0x402709]

# emerge --info
Portage 2.2.0_alpha84 (default/linux/amd64/10.0/desktop/kde, gcc-4.5.3, glibc-2.14.1-r2, 3.2.1-gentoo x86_64)
=================================================================
System uname: Linux-3.2.1-gentoo-x86_64-Intel-R-_Xeon-R-_CPU_W3520_@_2.67GHz-with-gentoo-2.1
Timestamp of tree: Thu, 19 Jan 2012 08:45:01 +0000
distcc 3.1 x86_64-pc-linux-gnu [disabled]
ccache version 3.1.7 [disabled]
app-shells/bash:          4.2_p20
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.2-r3, 3.2.2
dev-util/ccache:          3.1.7
dev-util/cmake:           2.8.6-r4
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.1
sys-apps/openrc:          0.9.8.1
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.9.6-r3, 1.10.3, 1.11.2
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.2.4-r1, 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.2 (virtual/os-headers)
sys-libs/glibc:           2.14.1-r2
Repositories: gentoo caster
Installed sets: 
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA dlj-1.1 googleearth AdobeFlash-10 AdobeFlash-10.1 sun-bcla-java-vm Oracle-BCLA-JavaSE google-chrome"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -msse4 -mcx16 -msahf -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/openvpn/easy-rsa /usr/share/themes/oxygen-gtk/gtk-2.0 /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="-march=core2 -msse4 -mcx16 -msahf -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps=y"
FEATURES="assume-digests binpkg-logs clean-logs collision-protect distlocks ebuild-locks fail-clean fixlafiles news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox"
FFLAGS=""
GENTOO_MIRRORS="http://ftp.fi.muni.cz/pub/linux/gentoo/ http://ftp.spline.inf.fu-berlin.de/mirrors/gentoo/ http://gentoo.osuosl.org"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en cs"
MAKEOPTS="-j6 -l8"
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="/usr/local/portage/caster"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 amr ao audiofile avahi bash-completion berkdb blas bluetooth branding bzip2 cairo caps cdda cdr chm cjk cli consolekit cracklib crypt cups curl custom-optimization cxx dbus declarative djvu dri dts dvd dvdr dvi emboss encode exif fam ffmpeg fftw flac fontconfig fortran gdbm gdu ggi gif git gmp gnutls gpm gstreamer gtk iconv icq idn ipv6 irda jadetex java java6 javascript jce jpeg jpeg2k kde kipi kpathsea lapack lastfm latex lcms ldap libnotify lua lzma lzo mad maildir matroska mbox mmx mng modules mozdevelop moznoirc mp3 mp4 mpeg mplayer mtp mudflap multilib musicbrainz ncurses nls nptl nptlonly nsplugin ntfs nvidia obex objc ogg openal opengl openmp oscar pam pango pcre pdf perl pgo phonon plasma pmu png policykit ppds pppd pulseaudio python qt3support qt4 quicktime readline reiserfs rtc rtsp ruby samba sdl semantic-desktop session slang smp sockets sound speex spell sql sqlite sse sse2 sse3 sse4 ssl startup-notification subversion svg sysfs t1lib tcl tcpd theora threads tiff tk truetype udev unicode usb v4l2 vdpau vnc vorbis webdav webkit wmf x264 xcb xcomposite xine xinerama xml xorg xosd xpm xscreensaver xulrunner xv xvid 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="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en cs" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="nvidia" 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, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 16 Attila Tóth 2012-01-19 14:12:17 UTC
(In reply to comment #15)
> I have this problem on amd64 during build of dev-libs/glib-2.30.2-r1

Have you tried revdep-rebuild?
Let me guess: you are using some Eastern-European or other non-standard locales. I also think export LC_ALL=en_US.UTF-8 will workaround your problems.
Do you agree, that this is a serious issue in the core?
Comment 17 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2012-01-19 14:39:11 UTC
Created attachment 299301 [details]
Valgrind log of sed

Here's valgrind log of my case. I think it's almost clear that the problem is inside glibc. I tried searching briefly for relevant bugs or changelog entries in 2.15 but found nothing. I don't feel like installing 2.15 yet. Someone could try valgrind with 2.15 to see if the error is really gone or just doesn't by chance manifest as a detected heap corruption anymore.

This was with:
LANG=en_US.utf8
LC_CTYPE="en_US.utf8"
LC_NUMERIC="en_US.utf8"
LC_TIME="en_US.utf8"
LC_COLLATE=cs_CZ.utf8
LC_MONETARY="en_US.utf8"
LC_MESSAGES="en_US.utf8"
LC_PAPER="en_US.utf8"
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT="en_US.utf8"
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=


LANG=C removes the crash and valgrind is also clean
Comment 18 J.Taimr 2012-01-27 19:51:52 UTC
Exactly the same situation here.. :

LC_ALL=cs.CZ.utf8 => SIGABRT in emerge dev-libs/glib
LC_ALL=C and emerge dev-libs/glib works ok.
Comment 19 Mads 2012-01-30 12:05:28 UTC
The same with nb_NO.UTF-8
Comment 20 whitehawk 2012-02-05 15:06:37 UTC
there are several packages that need sed during install, some of them, like binutils fails if the locale is wrong.

But it should be clarified whether this is the fault of: certain locales, sed, or glibc?
Comment 21 Gergely POLONKAI 2012-02-13 18:28:39 UTC
Same here. glibc 2.14.1-r1, sed 4.2.1, locale hu_HU.UTF-8

Works like charm if I temporarily change my locale to C
Comment 22 Attila Tóth 2012-03-14 23:48:30 UTC
I just can't understand how this bug is still in an UNCONFIRMED status! It can be reliably triggered. There are several confirmations reported. It's still there. I have to switch locales to be able to emerge glibc. Is this normal? A simple revdep-rebuild also uncovers the bug, but won't block the operation. All you need is a locale, like hu_HU.utf8 and x86. Some locale of a country previously using latin2 character set also suffices. Maybe it's about sed, not glibc. But it's definitely there.
Comment 23 Attila Tóth 2012-03-15 00:08:05 UTC
(In reply to comment #22)
> I just can't understand how this bug is still in an UNCONFIRMED status! It
> can be reliably triggered. There are several confirmations reported. It's
> still there. I have to switch locales to be able to emerge glibc. Is this
> normal? A simple revdep-rebuild also uncovers the bug, but won't block the
> operation. All you need is a locale, like hu_HU.utf8 and x86. Some locale of
> a country previously using latin2 character set also suffices. Maybe it's
> about sed, not glibc. But it's definitely there.

I'm sorry: I wanted to say emerging glib, and not glibc.
Comment 24 SpanKY gentoo-dev 2012-04-09 19:52:01 UTC
Created attachment 308339 [details, diff]
fix from upstream glibc

see if this patch from upstream (added between 2.14.1 and 2.15) fixes things
Comment 25 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2012-04-12 09:47:13 UTC
(In reply to comment #24)
> Created attachment 308339 [details, diff] [details, diff]
> fix from upstream glibc
> 
> see if this patch from upstream (added between 2.14.1 and 2.15) fixes things

Yes, I was able to build glib without problems after rebuilding glibc with this. Valgrind was also clean. Thanks!
Comment 26 SpanKY gentoo-dev 2012-04-12 22:37:15 UTC
thanks for testing.  i've queued this into the glibc-2.14.1 patchset and it'll be in the next revbump (in the next few days).
Comment 27 J.Taimr 2012-04-14 09:05:50 UTC
(In reply to comment #26)
> thanks for testing.  i've queued this into the glibc-2.14.1 patchset and
> it'll be in the next revbump (in the next few days).

Hmm... it seems the patch is not used (yet). glibc-2.14.1-r2 emerged and:
dev-libs/glib-2.32.1 still suffers by this issue. Here, if in the environment
a) LC_ALL=cs_CZ.UTF-8 -----> crash during 'sed' phase of emerge
b) LC_ALL unset ---> crash during 'sed' phase of emerge
c) LC_ALL=C ---> pass
d) LC_ALL=en_US.UTF-8 ---> pass
e) LC_ALL=C ---> pass
Comment 28 J.Taimr 2012-04-14 09:32:41 UTC
(In reply to comment #27)
> (In reply to comment #26)
> > thanks for testing.  i've queued this into the glibc-2.14.1 patchset and
> > it'll be in the next revbump (in the next few days).
> 
> Hmm... it seems the patch is not used (yet). glibc-2.14.1-r2 emerged and:
> dev-libs/glib-2.32.1 still suffers by this issue. Here, if in the environment
> a) LC_ALL=cs_CZ.UTF-8 -----> crash during 'sed' phase of emerge
> b) LC_ALL unset ---> crash during 'sed' phase of emerge
> c) LC_ALL=C ---> pass
> d) LC_ALL=en_US.UTF-8 ---> pass
> e) LC_ALL=C ---> pass

ok. Portage resynced again... there is new version of glibc: glibc-2.14.1-r3. glibc upgraded and it is ok now.
Comment 29 Attila Tóth 2012-04-15 19:25:43 UTC
(In reply to comment #26)
> thanks for testing.  i've queued this into the glibc-2.14.1 patchset and
> it'll be in the next revbump (in the next few days).

Fix Works Fine for me! Thanks!