Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 101100 - sharutils-4.4 uses an unitialized variable and crashes
Summary: sharutils-4.4 uses an unitialized variable and crashes
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Games (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Daniel Black (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-02 08:10 UTC by Ivan Yosifov
Modified: 2005-08-02 15:10 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Yosifov 2005-08-02 08:10:21 UTC
home ~ # emerge -pv quake2-icculus

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild   R   ] games-fps/quake2-icculus-0.16.1  +X -aalib -arts -dedicated
+ipv6 -joystick -noqmax +opengl +rogue* +sdl +svga +xatrix* 0 kB

Total size of downloads: 0 kB
home ~ # emerge quake2-icculus
Calculating dependencies ...done!
>>> emerge (1 of 1) games-fps/quake2-icculus-0.16.1 to /
>>> md5 files   ;-) quake2-icculus-0.16.1.ebuild
>>> md5 files   ;-) files/README-postinstall
>>> md5 files   ;-) files/0.16-gentoo-path.patch
>>> md5 files   ;-) files/quake2.xpm
>>> md5 files   ;-) files/digest-quake2-icculus-0.16.1
>>> md5 files   ;-) files/0.16-rogue-nan.patch
>>> md5 files   ;-) files/0.16-Makefile-gentoo-opts.patch
>>> md5 files   ;-) files/quake2-icculus-0.16.1-amd64.patch
>>> md5 src_uri ;-) quake2-r0.16.1.tar.gz
>>> md5 src_uri ;-) maxpak.pak
>>> md5 src_uri ;-) roguesrc320.shar.Z
>>> md5 src_uri ;-) xatrixsrc320.shar.Z
>>> Unpacking source...
>>> Unpacking quake2-r0.16.1.tar.gz to /var/tmp/portage/quake2-icculus-0.16.1/work
 * Applying quake2-icculus-0.16.1-amd64.patch ...                              
    [ ok ] * Applying 0.16-Makefile-gentoo-opts.patch ...                      
              [ ok ] * Applying 0.16-gentoo-path.patch ...                     
                        [ ok ]>>> Unpacking roguesrc320.shar.Z to
/var/tmp/portage/quake2-icculus-0.16.1/work/quake2-r0.16.1/src/rogue
>>> Unpacking roguesrc320.shar to
/var/tmp/portage/quake2-icculus-0.16.1/work/quake2-r0.16.1/src/rogue
*** glibc detected *** realloc(): invalid pointer: 0x0804b66c ***
/usr/portage/games-fps/quake2-icculus/quake2-icculus-0.16.1.ebuild: line 50: 
1778 Aborted                 env PATH=${T}:${PATH} unshar ${shar}

!!! ERROR: games-fps/quake2-icculus-0.16.1 failed.
!!! Function src_unpack, Line 60, Exitcode 134
!!! unpacking roguesrc320.shar failed
!!! If you need support, post the topmost build error, NOT this status message.

home ~ #


Reproducible: Always
Steps to Reproduce:





Portage 2.0.51.22-r2 (default-linux/x86/2005.0, gcc-3.4.4, glibc-2.3.5-r1,
2.6.12-gentoo-r7 i686)
=================================================================
System uname: 2.6.12-gentoo-r7 i686 Intel(R) Pentium(R) 4 CPU 3.20GHz
Gentoo Base System version 1.6.13
dev-lang/python:     2.3.5, 2.4.1-r1
sys-apps/sandbox:    1.2.11
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.18-r1
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium4 -mtune=pentium4 -fomit-frame-pointer
-momit-leaf-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env
/usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config
/var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/splash /etc/terminfo /etc/texmf/web2c
/etc/env.d"
CXXFLAGS="-O2 -march=pentium4 -mtune=pentium4 -fomit-frame-pointer
-momit-leaf-frame-pointer -pipe -fvisibility-inlines-hidden"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://gentoo.ITDNet.net/gentoo"
LANG="en_US.utf8"
LC_ALL="en_US.utf8"
LINGUAS="en"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X acl alsa apache2 avi berkdb bitmap-fonts bonobo cdr crypt cups curl
directfb doc dvd dvdr eds emboss encode flac foomaticdb gd gdbm gif gnome gpm
gstreamer gtk gtk2 guile hal imagemagick imlib ipv6 ithreads java jpeg junit kde
kdeenablefinal ldap libg++ libwww mad mikmod mmap mmx motif mozilla mp3 mpeg
mysql ncurses nls nptl nvidia ogg oggvorbis opengl pam pdflib perl pic plotutils
png postgres pthreads python qt quicktime readline sdl session sharedmem spell
sse sse2 ssl svga symlink tcltk tcpd tetex threads tiff truetype truetype-fonts
type1-fonts unicode usb vorbis xine xml xml2 xmms xv zlib linguas_en
userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LDFLAGS
Comment 1 Chris Gianelloni (RETIRED) gentoo-dev 2005-08-02 08:19:09 UTC
Well, for starters, I would try rebuilding without the crazy CFLAGS.  Try just
CFLAGS="-pipe" and see if it helps.  You might also want to try recompiling
sharutils/glibc with these new CFLAGS.
Comment 2 Ivan Yosifov 2005-08-02 08:48:10 UTC
I will try that ( I am rebuilding glibc as I type this ), yet I think the CFLAGS
are rather sane, but an experiment won't hurt.
Comment 3 SpanKY gentoo-dev 2005-08-02 09:01:45 UTC
not a bug in quake2-icculus

looks like your coreutils and/or toolchain is broken

should probably drop down your CFLAGS and re-emerge them
Comment 4 Ivan Yosifov 2005-08-02 09:10:02 UTC
Please do 
ebuild /usr/portage/app-arch/sharutils/sharutils-4.4.ebuild unpack
and open /var/tmp/portage/sharutils-4.4/work/sharutils-4.4/src/unshar.c with
your favourite editor. Notice at line 438:

              name_buffer = (name_buffer == NULL)
                ? malloc (buflen)
                : realloc (name_buffer, buflen);

This is the bombing realloc. Please correct me if I am wrong, but name_buffer is
used uninitialized - it is defined just as char* name_buffer; ( line 361 ), so
it has a random non-NULL value and the trenarry-if tries to realloc it and fails.

Also, the rebuild of glibc and sharutils just completed - and did not help.
Comment 5 Ivan Yosifov 2005-08-02 09:19:22 UTC
Reopening, and changed the title to better reflect the problem. This is not a
games bug, you may need to reasign it.
Comment 6 Ivan Yosifov 2005-08-02 09:27:02 UTC
Also, downgrading sharutils from 4.4 to 4.2.1-r11 fixes the quake2 emerge problem.
Comment 7 Daniel Black (RETIRED) gentoo-dev 2005-08-02 15:10:46 UTC
fixed in 4.4-r1 - thank you I've I'm going to email the current upstream 
maintainer.