FS#24970 - [sed] segfault in hu_HU.UTF8 locale

Attached to Project: Arch Linux
Opened by Tibor Vago (oreggin) - Thursday, 30 June 2011, 20:46 GMT
Last edited by Allan McRae (Allan) - Tuesday, 27 December 2011, 22:22 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Allan McRae (Allan)
Architecture x86_64
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
When I try to compile binutils from source what downloaded from ftp.gnu.org it fails with the following error message:

-------------------------------------------------------------------------
. . .
make[2]: Entering directory `/var/tmp/cross/binutils-2.21.1/build/intl'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/var/tmp/cross/binutils-2.21.1/build/intl'
make[2]: Entering directory `/var/tmp/cross/binutils-2.21.1/build/bfd'
creating bfdver.h
rm -f elf32-target.h
sed -e s/NN/32/g < ../../bfd/elfxx-target.h > elf32-target.new
mv -f elf32-target.new elf32-target.h
rm -f elf64-target.h
sed -e s/NN/64/g < ../../bfd/elfxx-target.h > elf64-target.new
mv -f elf64-target.new elf64-target.h
rm -f targmatch.h
sed -f ../../bfd/targmatch.sed < ../../bfd/config.bfd > targmatch.new
*** glibc detected *** sed: double free or corruption (!prev): 0x0000000000facce0 ***
======= Backtrace: =========
/lib/libc.so.6(+0x7366a)[0x7f9d5d65d66a]
/lib/libc.so.6(cfree+0x6c)[0x7f9d5d66154c]
/lib/libc.so.6(+0xb586e)[0x7f9d5d69f86e]
/lib/libc.so.6(+0xbb59d)[0x7f9d5d6a559d]
/lib/libc.so.6(re_search+0x18)[0x7f9d5d6a5f08]
sed[0x407942]
sed[0x40676d]
sed[0x40762f]
sed[0x4026dc]
/lib/libc.so.6(__libc_start_main+0xed)[0x7f9d5d60b17d]
sed[0x4020c9]
======= Memory map: ========
00400000-00410000 r-xp 00000000 08:01 262218 /bin/sed
0060f000-00610000 rw-p 0000f000 08:01 262218 /bin/sed
00610000-00618000 rw-p 00000000 00:00 0
00f37000-00fbb000 rw-p 00000000 00:00 0 [heap]
7f9d58000000-7f9d58021000 rw-p 00000000 00:00 0
7f9d58021000-7f9d5c000000 ---p 00000000 00:00 0
7f9d5ce59000-7f9d5ce6e000 r-xp 00000000 08:01 276750 /usr/lib/libgcc_s.so.1
7f9d5ce6e000-7f9d5d06e000 ---p 00015000 08:01 276750 /usr/lib/libgcc_s.so.1
7f9d5d06e000-7f9d5d06f000 rw-p 00015000 08:01 276750 /usr/lib/libgcc_s.so.1
7f9d5d06f000-7f9d5d3e6000 r--p 00000000 08:01 286498 /usr/lib/locale/locale-archive
7f9d5d3e6000-7f9d5d3ea000 r-xp 00000000 08:01 6321 /lib/libattr.so.1.1.0
7f9d5d3ea000-7f9d5d5e9000 ---p 00004000 08:01 6321 /lib/libattr.so.1.1.0
7f9d5d5e9000-7f9d5d5ea000 rw-p 00003000 08:01 6321 /lib/libattr.so.1.1.0
7f9d5d5ea000-7f9d5d741000 r-xp 00000000 08:01 4172 /lib/libc-2.14.so
7f9d5d741000-7f9d5d941000 ---p 00157000 08:01 4172 /lib/libc-2.14.so
7f9d5d941000-7f9d5d945000 r--p 00157000 08:01 4172 /lib/libc-2.14.so
7f9d5d945000-7f9d5d946000 rw-p 0015b000 08:01 4172 /lib/libc-2.14.so
7f9d5d946000-7f9d5d94b000 rw-p 00000000 00:00 0
7f9d5d94b000-7f9d5d952000 r-xp 00000000 08:01 8482 /lib/libacl.so.1.1.0
7f9d5d952000-7f9d5db52000 ---p 00007000 08:01 8482 /lib/libacl.so.1.1.0
7f9d5db52000-7f9d5db53000 rw-p 00007000 08:01 8482 /lib/libacl.so.1.1.0
7f9d5db53000-7f9d5db72000 r-xp 00000000 08:01 4177 /lib/ld-2.14.so
7f9d5dd49000-7f9d5dd4d000 rw-p 00000000 00:00 0
7f9d5dd6d000-7f9d5dd71000 rw-p 00000000 00:00 0
7f9d5dd71000-7f9d5dd72000 r--p 0001e000 08:01 4177 /lib/ld-2.14.so
7f9d5dd72000-7f9d5dd73000 rw-p 0001f000 08:01 4177 /lib/ld-2.14.so
7f9d5dd73000-7f9d5dd74000 rw-p 00000000 00:00 0
7fff2cccd000-7fff2ccf0000 rw-p 00000000 00:00 0 [stack]
7fff2cdff000-7fff2ce00000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
/bin/sh: 1. sor: 26777 Félbeszakítva sed -f ../../bfd/targmatch.sed < ../../bfd/config.bfd > targmatch.new
make[2]: *** [targmatch.h] Error 134
make[2]: Leaving directory `/var/tmp/cross/binutils-2.21.1/build/bfd'
make[1]: *** [all-bfd] Error 2
make[1]: Leaving directory `/var/tmp/cross/binutils-2.21.1/build'
make: *** [all] Error 2
-------------------------------------------------------------------------

Additional info:
If I issue the following command then binutils compile without any problem:
LANG="en_US.UTF8" make

I don't use testing repos.

Steps to reproduce:
- extract binutils source to anywhere
- execute the configure script with or without any options
- issue make command with LANG="hu_HU.UTF8" locale

Maybe it is a sed bug.
This task depends upon

Closed by  Allan McRae (Allan)
Tuesday, 27 December 2011, 22:22 GMT
Reason for closing:  Fixed
Additional comments about closing:  glibc-2.15 in [testing]
Comment by Tibor Vago (oreggin) - Thursday, 30 June 2011, 21:00 GMT
Related installed packages:
- core/sed 4.2.1-3 (base)
- core/binutils 2.21.1-1 (base)
- core/gcc 4.6.1-1 (base-devel)
- core/gcc-libs 4.6.1-1 (base)
- core/glibc 2.14-4 (base)
- core/make 3.82-3 (base-devel)

I was try rerun locale-gen without success.
Comment by Allan McRae (Allan) - Friday, 01 July 2011, 01:30 GMT
Definitely not a binutils issues. Either a sed or glibc one.

Replicate with the attached (nearly) minimal testcase:
LANG="hu_HU.UTF-8" sed -f targmatch.sed < config.bfd
Comment by András Bíró (bbandi) - Tuesday, 02 August 2011, 19:00 GMT
I can confirm this bug (tried to compile avr-binutils 2.17). LANG="en_EN.UTF-8" resolved it. I think I have this bug since I updated glibc to 2.14, but I'm not sure.
Comment by Allan McRae (Allan) - Wednesday, 03 August 2011, 12:02 GMT
The bug just appears to be exposed by glibc-2.14. Valgrind shows me something strange goes on in memory usage with glibc-2.13 too.

Reported upstream with no response...

Loading...