Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 257725 - net-ftp/gftp crashes if MALLOC_CHECK_ is set
Summary: net-ftp/gftp crashes if MALLOC_CHECK_ is set
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: High critical (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-05 05:06 UTC by Evan Teran
Modified: 2009-05-27 16:30 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 Evan Teran 2009-02-05 05:06:27 UTC
I have a kde4.2 install setup (and working quite nicely). However, I noticed today that gftp would not run and would simple exit immediately with the message: "Aborted"

After digging around, I discovered that the environment variable MALLOC_CHECK_ was set to 2 and was causing the issue. doing an "unset MALLOC_CHECK_" causes gftp to run correctly again.

I'd never seen this variable before, so I dug around and discovered that startkde from kde4.2 sets it. I believe that this is a bug in gftp-gtk because an abort due to enabling a debug allocator can really only mean that the application is somehow at fault.

I've tried rebuilding gftp in case it was a library version issue, but like I said, simply removing the environment variable causes the problem to go away.

setting MALLOC_CHECK_=1 makes the gftp still run but with LOTS of errors looking like this:

"*** glibc detected *** /usr/bin/gftp-gtk: free(): invalid pointer: 0x08ac49f0 ***"

looks like gftp-gtk has some issues.

Reproducible: Always

Steps to Reproduce:
MALLOC_CHECK_=2 gftp
Actual Results:  
exits immediately with "Aborted"

Expected Results:  
It should run correctly

Portage 2.2_rc20 (default/linux/x86/2008.0/desktop, gcc-4.3.2, glibc-2.6.1-r0, 2.6.27-gentoo-r7 i686)
=================================================================                                    
System uname: Linux-2.6.27-gentoo-r7-i686-Intel-R-_Core-TM-2_Duo_CPU_T7700_@_2.40GHz-with-glibc2.0   
Timestamp of tree: Thu, 05 Feb 2009 02:35:01 +0000                                                   
malloc: using debugging hooks                                                                        
malloc: using debugging hooks                                                                        
app-shells/bash:     3.2_p39                                                                         
dev-java/java-config: 1.3.7-r1, 2.1.6-r1                                                             
dev-lang/python:     2.5.2-r7                                                                        
dev-util/cmake:      2.6.2-r1                                                                        
sys-apps/baselayout: 1.12.11.1                                                                       
sys-apps/sandbox:    1.2.18.1-r2                                                                     
sys-devel/autoconf:  2.13, 2.63                                                                      
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2                                       
sys-devel/binutils:  2.18-r3                                                                         
sys-devel/gcc-config: 1.4.0-r4                                                                       
sys-devel/libtool:   1.5.26                                                                          
virtual/os-headers:  2.6.27-r2                                                                       
ACCEPT_KEYWORDS="x86"                                                                                
CBUILD="i686-pc-linux-gnu"                                                                           
CFLAGS="-march=native -O3 -fomit-frame-pointer -pipe"                                                
CHOST="i686-pc-linux-gnu"                                                                            
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/4.2/env /usr/kde/4.2/share/config /usr/kde/4.2/shutdown /usr/share/config /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=native -O3 -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="collision-protect distlocks fixpackages parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LC_ALL="en_US"
LDFLAGS="-Wl,-O1"
LINGUAS="en_US"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
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="   "
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 accessibility acl acpi alsa apache2 arts avahi bash-completion berkdb bluetooth boost branding bzip2 cairo captury cdr chroot cli cracklib crypt cups curl cvs dbus debugger dell dhcp divx doc dri dvd dvdr dvdread eds emboss encode esd evo examples expat fam fat ffmpeg firefox flac gdbm gif glibc-omitfp glitz gmp gnome gnutls google-gadgets gpm gstreamer gtk hal htmlhandbook iconv imagemagick innodb inotify ipod ipv6 ipw3945 isdnlog jadetex java java6 jpeg jpeg2k kde kdeenablefinal kdehiddenvisibility kdeprefix kqemu lame ldap lesstif libnotify libwww lm_sensors mad mdnsresponder-compat midi mikmod mjpeg mmap mmx mng mono mp3 mp4 mpeg mpeg2 mplayer mudflap mysql ncurses network-cron nls nptl nptlonly nsplugin ntfs nvidia ogg openal openexr opengl openmp openssl oss pam pango pcap pch pcre pdf perl phonon php plasma pmu png posix ppds pppd python qt3 qt3support qt4 quicktime readline reflection rtc samba sdl session smp sockets spell spl sqlite sqlite3 sse sse2 ssl ssse3 startup-notification subversion svg sysfs tcl tcpd templates theora threads tiff tivo tk truetype unicode usb userlocales utempter v4l vcd vim-syntax vnc vorbis webkit wifi win32codecs wireshark wmf wmp wxwindows x86 xanimxcomposite xft xine xinerama xml xorg xpm xrandr xrender xscreensaver xulrunner xv xvid zeroconf zip 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 asymcopy 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" ELIBC="glibc" INPUT_DEVICES="keyboard mouse synaptics evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_US" USERLAND="GNU" VIDEO_CARDS="nvidia"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Gilles Dartiguelongue (RETIRED) gentoo-dev 2009-02-05 07:03:25 UTC
which version of gftp are we talking about ? if you don't have it yet, please try 2.0.19. Upstream will also need a proper backtrace of the problem.

http://www.gentoo.org/proj/en/qa/backtraces.xml

Also please note that gnome herd and upstream do not support optimization levels above -O2, so please also try to reproduce your problem when compiling with -O2.
Comment 2 Evan Teran 2009-02-05 17:10:36 UTC
I am using 2.0.19, and I will it recompiling with -O2. I'll post the results
Comment 3 Evan Teran 2009-02-05 17:13:19 UTC
OK, it seems that -O2 does not trigger the problem, which is good news (though I personally don't agree with not supporting -O3, but it is there project and they can do what they please).

Would it make sense to filter -O3 in the ebuild like some other packages? In fact, if gnome as a whole doesn't support -O3, it would likely make sense to have all gnome packages filter out -O3. That way users don't have to special case some packages.
Comment 4 Gilles Dartiguelongue (RETIRED) gentoo-dev 2009-02-05 17:30:30 UTC
filtering -O3 doesn't make sense, finding the specific optimization that fails though would be a good idea. Upstream (and us as a consequence) not supporting -O3 is just the consequence of gcc doing crazy things at the optimization level.
Though it is generally fine with 99.99% packages it occasionally breaks things hard like gtk+ back in 2.8/2.10 release or something.

If you could provide a backtrace maybe that would lead us to a real bug in either gdm or gcc.
Comment 5 Evan Teran 2009-02-05 18:35:50 UTC
I will do my best to help you track this down. Are there recommended flags for getting a useful backtrace?

I doubt we'll find a bug in gcc, while it's possible. Personally, as a developer, I've found that every single time that my code does something different when I crank up optimizations, it has been because I broke some subtle rule in the c/c++ standard.

Anyway, let me know which flags to use (and should I recompile my libc with debugging info too?) and I'll try to help track down the bug.
Comment 6 Evan Teran 2009-02-05 18:37:20 UTC
Sorry, I didn't see your previous link to the backtraces page, I'll read it and give you the results later on.

Thanks.
Comment 7 Gilles Dartiguelongue (RETIRED) gentoo-dev 2009-05-23 12:12:17 UTC
for the record I wasn't able to reproduce this bug by just building gftp with -O3.

Built gftp with:
USE="gtk" CFLAGS="-O3 -march=native -ftree-vectorize -pipe -g" emerge -1 gftp

$ emerge --info
Portage 2.2_rc33 (default/linux/amd64/2008.0, gcc-4.3.3, glibc-2.10.1-r0, 2.6.29-gentoo-r1 x86_64)
=================================================================
System uname: Linux-2.6.29-gentoo-r1-x86_64-Intel-R-_Core-TM-2_Duo_CPU_T7500_@_2.20GHz-with-gentoo-2.0.0
Timestamp of tree: Sat, 23 May 2009 06:15:02 +0000
ccache version 2.4 [enabled]
app-shells/bash:     4.0_p24
dev-lang/python:     2.6.2
dev-util/ccache:     2.4-r8
dev-util/cmake:      2.6.4
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.4.3-r2
sys-apps/sandbox:    1.9
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.5, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.19.1-r1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.28-r1
ACCEPT_KEYWORDS="amd64 ~amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=native -ftree-vectorize -pipe -g"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /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 /etc/udev/rules.d"
CXXFLAGS="-O2 -march=native -ftree-vectorize -pipe -g"
DISTDIR="/var/tmp/distfiles"
FEATURES="ccache distcc distlocks fixpackages multilib-strict parallel-fetch preserve-libs protect-owned sandbox sfperms sign splitdebug strict unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://ftp.free.fr/mirrors/ftp.gentoo.org/ http://mirror.ovh.net/gentoo-distfiles/ ftp://mirror.ovh.net/gentoo-distfiles/"
LANG="fr_FR.UTF-8"
LC_ALL="fr_FR.UTF-8"
LDFLAGS="-Wl,-O1,--as-needed,--hash-style=gnu"
LINGUAS="en fr ja zh zh_CN"
MAKEOPTS="-j4"
PKGDIR="/var/tmp/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/layman/graaff /usr/local/portage/layman/gentopia /usr/local/portage/layman/voip /usr/local/portage/layman/sunrise /usr/local/portage/layman/desktop-effects /home/eva/devel/overlays/gentoo-misc /home/eva/devel/overlays/gnome"
SYNC="rsync://rsync.be.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 applet asyncns avahi avi bash-completion bluetooth bzip2 cairo cdr cjk cli consolekit cracklib crypt cups dbus dri dvd dvdr dvdread eds epiphany evo fam ffmpeg flac galago gedit glade glitz gmp gnome gnome-keyring gnutls gpm gstreamer hal iconv ipv6 isdnlog jpeg laptop ldap libnotify lirc mad matroska midi mmx mp3 mpeg mudflap multilib nautilus ncurses networkmanager nfs nls nntp nptl nptlonly nsplugin ntpl ogg openct opengl openmp pam pcre pdf perl png pppd python readline reflection session smp spell spl sse sse2 ssl ssse3 startup-notification svg sysfs tcpd theora threads unicode v4l v4l2 vim-syntax vorbis x264 xattr xcb xinerama xml xmp xorg 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="dav dav_fs authn_file auth_digest authz_groupfile authz_host dir mime" APACHE2_MPMS="event" ELIBC="glibc" INPUT_DEVICES="keyboard mouse synaptics evdev" KERNEL="linux" LINGUAS="en fr ja zh zh_CN" LIRC_DEVICES="macmini" USERLAND="GNU" VIDEO_CARDS="i810 intel vesa fbdev"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 8 Evan Teran 2009-05-27 16:30:33 UTC
Yea, I haven't seen this bug crop up in a while. I dunno if it is the newer libglib or the fact that I've upgraded to gcc 4.4. But it seems to no longer be an issue.