Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Cannot build current/i386 on Linux/x86_64: buffer overflow detected



In article 
<f27d37330811181309n3e48628by90867fedaa53fd39%mail.gmail.com@localhost>,
Alexey Vyskubov <tascafoo%gmail.com@localhost> wrote:
>Hello,
>
>I tried to build current (checked out today) for i386 on Linux x86_64.
>The compilation fails with the following error:
>
>#     build  libgcc/libgcc.a
>rm -f libgcc.a
>/home/alexey/NetBSD/src/../tooldir/bin/i386--netbsdelf-ar cq libgcc.a
>`NM=/home/alexey/NetBSD/src/../tooldir/bin/i386--netbsdelf-nm
>NM=/home/alexey/NetBSD/src/../tooldir/bin/i386--netbsdelf-nm
>MKTEMP=/home/alexey/NetBSD/src/../tooldir/bin/nbmktemp
>/home/alexey/NetBSD/src/../tooldir/bin/nblorder _muldi3.o _negdi2.o
>_lshrdi3.o _ashldi3.o _ashrdi3.o _cmpdi2.o _ucmpdi2.o _floatdidf.o
>_floatdisf.o _fixunsdfsi.o _fixunssfsi.o _fixunsdfdi.o _fixdfdi.o
>_fixunssfdi.o _fixsfdi.o _fixxfdi.o _fixunsxfdi.o _floatdixf.o
>_fixunsxfsi.o _fixtfdi.o _fixunstfdi.o _floatditf.o _clear_cache.o
>_enable_execute_stack.o _trampoline.o __main.o _absvsi2.o _absvdi2.o
>_addvsi3.o _addvdi3.o _subvsi3.o _subvdi3.o _mulvsi3.o _mulvdi3.o
>_negvsi2.o _negvdi2.o _ctors.o _ffssi2.o _ffsdi2.o _clz.o _clzsi2.o
>_clzdi2.o _ctzsi2.o _ctzdi2.o _popcount_tab.o _popcountsi2.o
>_popcountdi2.o _paritysi2.o _paritydi2.o _powisf2.o _powidf2.o
>_powixf2.o _powitf2.o _mulsc3.o _muldc3.o _mulxc3.o _multc3.o
>_divsc3.o _divdc3.o _divxc3.o _divtc3.o _eprintf.o __gcc_bcmp.o
>_divdi3.o _moddi3.o _udivdi3.o _umoddi3.o _udiv_w_sdiv.o _udivmoddi4.o
>| /home/alexey/NetBSD/src/../tooldir/bin/nbtsort -q`
>*** buffer overflow detected ***:
>/home/alexey/NetBSD/src/../tooldir/bin/i386--netbsdelf-ar terminated
>======= Backtrace: =========
>/lib/libc.so.6(__fortify_fail+0x37)[0x7f256b6d9887]
>/lib/libc.so.6[0x7f256b6d7750]
>/lib/libc.so.6[0x7f256b6d6ae9]
>/lib/libc.so.6(_IO_default_xsputn+0x96)[0x7f256b652116]
>/lib/libc.so.6(_IO_padn+0xfa)[0x7f256b645aca]
>/lib/libc.so.6(_IO_vfprintf+0x27a4)[0x7f256b623e24]
>/lib/libc.so.6(__vsprintf_chk+0x9d)[0x7f256b6d6b8d]
>/lib/libc.so.6(__sprintf_chk+0x80)[0x7f256b6d6ad0]
>/home/alexey/NetBSD/src/../tooldir/bin/i386--netbsdelf-ar[0x40887a]
>/home/alexey/NetBSD/src/../tooldir/bin/i386--netbsdelf-ar[0x406c1e]
>/home/alexey/NetBSD/src/../tooldir/bin/i386--netbsdelf-ar[0x40910e]
>/home/alexey/NetBSD/src/../tooldir/bin/i386--netbsdelf-ar[0x40f9b9]
>/home/alexey/NetBSD/src/../tooldir/bin/i386--netbsdelf-ar[0x403bc7]
>/home/alexey/NetBSD/src/../tooldir/bin/i386--netbsdelf-ar[0x40401d]
>/home/alexey/NetBSD/src/../tooldir/bin/i386--netbsdelf-ar[0x404ac7]
>/lib/libc.so.6(__libc_start_main+0xe6)[0x7f256b5f8466]
>/home/alexey/NetBSD/src/../tooldir/bin/i386--netbsdelf-ar[0x401ec9]
>======= Memory map: ========
>00400000-00470000 r-xp 00000000 fe:01 297761
>  /home/alexey/NetBSD/tooldir/bin/i386--netbsdelf-ar
>0066f000-00670000 r--p 0006f000 fe:01 297761
>  /home/alexey/NetBSD/tooldir/bin/i386--netbsdelf-ar
>00670000-00671000 rw-p 00070000 fe:01 297761
>  /home/alexey/NetBSD/tooldir/bin/i386--netbsdelf-ar
>00671000-00675000 rw-p 00671000 00:00 0
>02102000-023f9000 rw-p 02102000 00:00 0                                  [heap]
>7f256b3c2000-7f256b3d8000 r-xp 00000000 fe:01 8552690
>  /lib/libgcc_s.so.1
>7f256b3d8000-7f256b5d8000 ---p 00016000 fe:01 8552690
>  /lib/libgcc_s.so.1
>7f256b5d8000-7f256b5d9000 r--p 00016000 fe:01 8552690
>  /lib/libgcc_s.so.1
>7f256b5d9000-7f256b5da000 rw-p 00017000 fe:01 8552690
>  /lib/libgcc_s.so.1
>7f256b5da000-7f256b743000 r-xp 00000000 fe:01 8552490
>  /lib/libc-2.8.90.so
>7f256b743000-7f256b942000 ---p 00169000 fe:01 8552490
>  /lib/libc-2.8.90.so
>7f256b942000-7f256b946000 r--p 00168000 fe:01 8552490
>  /lib/libc-2.8.90.so
>7f256b946000-7f256b947000 rw-p 0016c000 fe:01 8552490
>  /lib/libc-2.8.90.so
>7f256b947000-7f256b94c000 rw-p 7f256b947000 00:00 0
>7f256b94c000-7f256b96b000 r-xp 00000000 fe:01 8552467
>  /lib/ld-2.8.90.so
>7f256bb4a000-7f256bb4c000 rw-p 7f256bb4a000 00:00 0
>7f256bb5d000-7f256bb6a000 rw-p 7f256bb5d000 00:00 0
>7f256bb6a000-7f256bb6b000 r--p 0001e000 fe:01 8552467
>  /lib/ld-2.8.90.so
>7f256bb6b000-7f256bb6c000 rw-p 0001f000 fe:01 8552467
>  /lib/ld-2.8.90.so
>7fff73b57000-7fff73b6c000 rw-p 7ffffffea000 00:00 0                      
>[stack]
>7fff73bff000-7fff73c00000 r-xp 7fff73bff000 00:00 0                      [vdso]
>ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0
>  [vsyscall]
>Aborted
>
>*** Failed target:  libgcc.a
>
>Am I doing something wrong?

build ar (the tool) with symbols and try again. A lot of code in binutils
uses sprintf instead of snprintf and there might be a bug. Do you have a
core-dump?

christos



Home | Main Index | Thread Index | Old Index