Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

glibc detected free(): invalid pointer:

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
17 posts • Page 1 of 1
Author
Message
jeffk
l33t
l33t
Posts: 671
Joined: Sat Sep 13, 2003 1:51 pm

glibc detected free(): invalid pointer:

  • Quote

Post by jeffk » Thu Mar 31, 2005 7:04 pm

What do I need to re-emerge to fix this problem? I'm getting this on mysql-administrator and smbc-1.2.1.

Code: Select all

$ mysql-administrator
*** glibc detected *** free(): invalid pointer: 0x081c80f0 ***
/usr/bin/mysql-administrator: line 9:  4127 Aborted                 $MYPATH/mysql-administrator-bin
Thanks.

Code: Select all

emerge info
Portage 2.0.51.19 (default-linux/x86/2004.0, gcc-3.4.3-20050110, glibc-2.3.4.20050125-r1, 2.6.11-gentoo-r4 i686)
=================================================================
System uname: 2.6.11-gentoo-r4 i686 mobile AMD Athlon(tm) XP-M 2000+
Gentoo Base System version 1.6.10
Python:              dev-lang/python-2.4-r3 [2.4 (#1, Mar 19 2005, 19:14:05)]
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
dev-lang/python:     2.4-r3
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.5
sys-devel/binutils:  2.15.92.0.2-r7
sys-devel/libtool:   1.5.14
virtual/os-headers:  2.6.8.1-r4
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -march=athlon-xp -mtune=athlon-xp -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /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/terminfo /etc/texmf/web2c /etc/env.d"
CXXFLAGS="-O2 -march=athlon-xp -mtune=athlon-xp -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distcc distlocks sfperms"
GENTOO_MIRRORS="ftp://mirrors.tds.net/gentoo http://mirror.datapipe.net/gentoo http://mirrors.tds.net/gentoo"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage /usr/local/overlays/bmg-main /usr/local/overlays/fluidportage"
SYNC="rsync://rsync.us.gentoo.org/gentoo-portage"
USE="x86 3dnow S3TC X aac aalib acl acpi adns aim alsa apache2 apm arts avi bash-completion berkdb bitmap-fonts bluetooth bonobo caps cddb cdf cdr chroot cle266 crypt cups curl dba dbus dga directfb divx4linux dv dvd dvdr emacs emboss encode esd evo expat faad fam fastcgi fbcon fbdev ffmpeg flac flash fluidsynth fmod font-server foomaticdb fortran freetds freetype fs gcj gd gdbm geoip ggi gif gimp gimpprint glade glut gnome gnomedb gphoto2 gpm gps graphviz gstreamer gtk gtk2 gtkhtml guile hal hbci icq ieee1394 imagemagick imap imlib imlib2 innodb jabber jack jack-tmpfs jpeg lcd lcms ldap libclamav libg++ libgda libwww lirc lua mad mbox md5sum mdb mikmod mmx mng mono mozdevelop mozilla moznocompose moznoirc moznomail mozsvg mozxmlterm mp3 mpeg mpeg4 msn mssql mysql nas ncurses nls nntp nodrm nomotif nptl odbc ofx oggvorbis openal opengl opie oscar oss pam pcmcia pcre pda pdflib perl plotutils png pnp postgis postgres psyco pthreads python qt quicktime readline rogue ruby samba sasl scanner sdl slang speedo speex spell sqlite sse ssl stencil-buffer svg svga tcpd tetex theora tiff transcode truetype truetype-fonts type1 type1-fonts unichrome usb v4l v4l2 vda vhosts virus-scan wmf wxwin wxwindows xine xml xml2 xmms xprint xv xvid yahoo yv12 zeo zlib zvbi video_cards_via"
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS
Top
ehud
n00b
n00b
Posts: 69
Joined: Sat May 15, 2004 4:18 pm
Location: Tel Aviv
Contact:
Contact ehud
Website

  • Quote

Post by ehud » Fri Apr 01, 2005 4:34 pm

The error you are seeing shows that there's a bug in mysql-administrator.

You can tell glibc to ignore the error and try to resume. Try this:

Code: Select all

MALLOC_CHECK_=1 mysql-administrator
or if you're using tcsh:

setenv MALLOC_CHECK_ 1
mysql-administrator
Top
Yasw
n00b
n00b
Posts: 3
Joined: Tue Jul 13, 2004 12:38 pm

  • Quote

Post by Yasw » Wed Apr 13, 2005 8:14 am

I got the same problem with gtksee and wmmisc after an glibc update. When i downgraded to glibc-20040808 the problem dissapeared, so the logical conclusion would be that something is wrong with glibc, or what?
Top
paulbiz
Guru
Guru
Posts: 508
Joined: Sun Feb 01, 2004 9:03 pm
Location: St. Louis, Missouri, USA

  • Quote

Post by paulbiz » Sat Apr 30, 2005 6:23 am

It is a feature of glibc to detect corruption before it happens. It is a bug in the program that caused it. Invalid pointer, free() of memory that's already gone, etc.

You can control it on a per-run basis by setting the MALLOC_CHECK_ environment variable. If you explicitly set this variable it performs even more strict tests than normal.

0 -- Do not generate an error message, and do not kill the program
1 -- Generate an error message, but do not kill the program
2 -- Do not generate an error message, but kill the program
3 -- Generate an error message and kill the program

There is a "nomalloccheck" USE flag for glibc. Perhaps setting that will turn off this feature? I haven't tried it (glibc compile is so fast!)

Code: Select all

[ Searching for packages matching glibc... ]
[ Colour Code : set unset ]
[ Legend        : Left column  (U) - USE flags from make.conf                     ]
[                  : Right column (I) - USE flags packages was installed with ]
[ Found these USE variables for sys-libs/glibc-2.3.5 ]
 U I
 + + nls           : <unknown>
 - - pic           : Build Position Independent Code. Needed for prelink or the hardened toolchain
 - - build         : !!internal use only!! DO NOT SET THIS FLAG YOURSELF!, used for creating build images and the first half of bootstrapping.
 + + nptl          : Enable support for Native POSIX Threads Library, the new threading module (requires linux-2.6 or better usually)
 - - nptlonly      : Disables building the linuxthreads fallback in glibc ebuilds that support building both linuxthreads and nptl.
 - - erandom       : Enable erandom/frandom support in glibc for ssp
 - - hardened      : activate default security enhancements for toolchain (gcc, glibc, binutils)
 - - debug         : Tells configure and the makefiles to build for debugging. Effects vary across packages, but generally it will at least add -g to CFLAGS. Remember to set FEATURES=nostrip too
 + + userlocales   : build only the locales specified in /etc/locales.build
 - - nomalloccheck : default to not performing some sanity checks that prevent and detect data corruption. this removes the small overhead introduced by the check.
 - - multilib      : On 64bit systems, if you want to be able to compile 32bit and 64bit binaries
 - - debug         : Tells configure and the makefiles to build for debugging. Effects vary across packages, but generally it will at least add -g to CFLAGS. Remember to set FEATURES=nostrip too
Top
rhill
Retired Dev
Retired Dev
User avatar
Posts: 1629
Joined: Fri Oct 22, 2004 9:58 am
Location: sk.ca

  • Quote

Post by rhill » Sat Apr 30, 2005 6:33 am

yep, the nomalloccheck USE flag disables these warnings. thanks for the info about MALLOC_CHECK_. i'm bookmarking this. :D
by design, by neglect
for a fact or just for effect
Top
paulbiz
Guru
Guru
Posts: 508
Joined: Sun Feb 01, 2004 9:03 pm
Location: St. Louis, Missouri, USA

  • Quote

Post by paulbiz » Sat Apr 30, 2005 6:57 am

dirtyepic wrote:yep, the nomalloccheck USE flag disables these warnings. thanks for the info about MALLOC_CHECK_. i'm bookmarking this. :D
"man malloc" and check the NOTES section at the bottom :)
Top
RaymondBeautrix
n00b
n00b
User avatar
Posts: 32
Joined: Sun Jul 03, 2005 10:49 pm

similar problem with firefox installer

  • Quote

Post by RaymondBeautrix » Thu Jul 14, 2005 7:05 pm

I've tried firefox 1.0.4 installer, alpha 1 installer, alpha 2 installer, and latest trunk installer with no success. I tried recompiling glibc with the "nomalloccheck" use flag and nothing changed. I tried to run the firefox installer with setting MALLOC_CHECK_=1 to avoid program termination, but this also failed as one can see below.

Code: Select all

BokuNoSekai firefox-installer # MALLOC_CHECK_=1 ./firefox-installer 
malloc: using debugging hooks 
malloc: using debugging hooks 
malloc: using debugging hooks 
malloc: using debugging hooks 
*** glibc detected *** free(): invalid pointer: 0x081e5d48 *** 
*** glibc detected *** free(): invalid pointer: 0x081e5d20 *** 
*** glibc detected *** free(): invalid pointer: 0x081e5ac0 *** 
*** glibc detected *** free(): invalid pointer: 0x081e5fd8 *** 
*** glibc detected *** free(): invalid pointer: 0x081e6008 *** 
*** glibc detected *** free(): invalid pointer: 0x081e6038 *** 
*** glibc detected *** free(): invalid pointer: 0x081e6068 *** 
*** glibc detected *** free(): invalid pointer: 0x081e6098 *** 
*** glibc detected *** free(): invalid pointer: 0x081e60c8 *** 
*** glibc detected *** free(): invalid pointer: 0x081e60f8 *** 
*** glibc detected *** free(): invalid pointer: 0x081e6128 *** 
*** glibc detected *** free(): invalid pointer: 0x081e5d98 *** 
*** glibc detected *** free(): invalid pointer: 0x081e5dc0 *** 
*** glibc detected *** free(): invalid pointer: 0x081e5de8 *** 
*** glibc detected *** free(): invalid pointer: 0x081e5e10 *** 
*** glibc detected *** free(): invalid pointer: 0x081e5e38 *** 
*** glibc detected *** free(): invalid pointer: 0x081e5d70 *** 
*** glibc detected *** free(): invalid pointer: 0x081e5e88 *** 
*** glibc detected *** free(): invalid pointer: 0x081e5e60 *** 
*** glibc detected *** free(): invalid pointer: 0x081e5ae0 *** 
*** glibc detected *** malloc(): memory corruption (fast): 0x081e5af0 *** 
./firefox-installer: line 72:  9084 Segmentation fault      "./${BINNAME}-bin" ${1+"$@"}	
I was told that this error might also relate to the cflags used for glibc. I use the following cflags.

Code: Select all

CFLAGS="-O3 -march=pentium4 -mtune=pentium4 -fforce-addr -momit-leaf-frame-pointer -fomit-frame-pointer -ftracer -pipe" 
CXXFLAGS="${CFLAGS} -fvisibility-inlines-hidden"
BobP recommended these cflags, even though may seem optimistic they're supposed to be very stable and reliable.

Even when I try to compile and install deer park alpha 1 or 2, when I try to run it nothing loads and firefox-bin shows up in my ProccessTable. I only have success when compiling 1.0.4, which is the version I'm trying to avoid because of its overall slow performance.

Any assistance would be greatly appreciated.

Thanks,
Ray
Top
frusware
n00b
n00b
Posts: 16
Joined: Sat Jun 12, 2004 9:40 pm

  • Quote

Post by frusware » Fri Sep 02, 2005 6:17 pm

I'm stuck with a similar problem with ipac-ng. I'm not exactly shure when the problem occured as I've done several "emerge -uDvp system" without restarting the firewall. When I try to run fetchipac -S I get

Code: Select all

a48056 ~ # fetchipac -S
*** glibc detected *** free(): invalid pointer: 0x08079428 ***
Aborted
I have already tried the MALLOC_CHECK_="1" environment variable, but it doesn't seem to help.

Code: Select all

a48056 ~ # MALLOC_CHECK_="1" fetchipac -S
malloc: using debugging hooks
*** glibc detected *** free(): invalid pointer: 0x08079430 ***
*** glibc detected *** free(): invalid pointer: 0x08069378 ***
*** glibc detected *** free(): invalid pointer: 0x08094370 ***
*** glibc detected *** free(): invalid pointer: 0x08084160 ***
*** glibc detected *** free(): invalid pointer: 0x080a6320 ***
*** glibc detected *** free(): invalid pointer: 0x08095fc0 ***
*** glibc detected *** free(): invalid pointer: 0x080b8450 ***
*** glibc detected *** free(): invalid pointer: 0x080a7f98 ***
 calloc failed
: Cannot allocate memory
From what I understood this could be related to CFLAGS and timings, so I tried recompiling ipac-ng with several other CFLAG settings but I still get the same error. Below is the output of emerge info. Does anybody have any idea how to resolve this?

Any feedback is greatly appreciated.
Alex.

Code: Select all

a48056 ~ # emerge info
Portage 2.0.51.22-r2 (default-linux/x86/2005.0, gcc-3.3.5-20050130, glibc-2.3.5-r1, 2.6.11-gentoo-r9 i686)
=================================================================
System uname: 2.6.11-gentoo-r9 i686 VIA Nehemiah
Gentoo Base System version 1.6.13
distcc 2.16 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
dev-lang/python:     2.2.3-r5, 2.3.5
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
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.15.92.0.2-r10
sys-devel/libtool:   1.5.18-r1
virtual/os-headers:  2.4.19-r1, 2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=i686 -msse -mmmx -mfpmath=sse -Os -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.1/share/config /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/bind /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -mcpu=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig buildpkg ccache digest distcc distlocks fixpackages sandbox sfperms strict"
GENTOO_MIRRORS="ftp://ftp.easynet.nl/mirror/gentoo/ ftp://ftp.snt.utwente.nl/pub/os/linux/gentoo http://ftp.easynet.nl/mirror/gentoo/ http://gentoo.inode.at/ http://ftp.snt.utwente.nl/pub/os/linux/gentoo http://gentoo.oregonstate.edu http://www.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="x86 X acpi alsa apache2 apm avi berkdb bitmap-fonts crypt cups curl dga directfb divx4linux dvd eds emboss encode esd fam fbcon flac foomaticdb fortran gd gdbm gif gnome gpm gstreamer gtk gtk2 guile imap imlib innodb java jpeg ldap libg++ libwww lirc mad mbox mikmod mmx motif mp3 mpeg mysql ncurses nls ogg oggvorbis opengl oss pam pdflib perl png python quicktime readline samba sasl sdl slang spell sse ssl svga tcltk tcpd threads tiff transcode truetype truetype-fonts type1-fonts vorbis xml xml2 xmms xv xvid zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
Top
nxsty
Veteran
Veteran
User avatar
Posts: 1556
Joined: Wed Jun 23, 2004 7:00 pm
Location: .se
Contact:
Contact nxsty
Website

  • Quote

Post by nxsty » Fri Sep 02, 2005 6:36 pm

dirtyepic wrote:yep, the nomalloccheck USE flag disables these warnings. thanks for the info about MALLOC_CHECK_. i'm bookmarking this. :D
Nomalloccheck was removed from 2.3.5-r1 so now it's always on by default. :(
Top
frusware
n00b
n00b
Posts: 16
Joined: Sat Jun 12, 2004 9:40 pm

  • Quote

Post by frusware » Fri Sep 02, 2005 7:07 pm

so there is no other way of suppressing the error message? Please don't tell me I have to emerge an older glibc.
Top
chtephan
Apprentice
Apprentice
User avatar
Posts: 266
Joined: Tue Feb 03, 2004 5:11 pm
Location: Offenburg, Germany
Contact:
Contact chtephan
Website

  • Quote

Post by chtephan » Fri Sep 02, 2005 7:19 pm

Suppressing the malloc check would be working around the symptoms.

Fact is that one of programs (or libraries) you are using is buggy and writes to memory it shouldn't. You could always recompile your glibc with the nomalloccheck USE flag, but the real question is how you can figure out what is poking around in your memory.

Valgrind is a tool that does that. I'm using a glibc with malloc checks for a long time now and I have seen this message, but it always went away after the bug was fixed. So simply disabling the check would be the "duck and cover" strategy.

Is it only firefox-installer or do you see this with other programs too. Finding a common denominator would ease helping the broken package. If you are a bit familiar with debugging you could also try valgrind.
Top
frusware
n00b
n00b
Posts: 16
Joined: Sat Jun 12, 2004 9:40 pm

  • Quote

Post by frusware » Fri Sep 02, 2005 7:36 pm

chtephan wrote: Is it only firefox-installer or do you see this with other programs too. Finding a common denominator would ease helping the broken package. If you are a bit familiar with debugging you could also try valgrind.
I agree, I rather not suppress the error and I would like to resolve it correctly (I'm getting the error in ipac-ng, not in the firefox-installer). I'll see what valgrind can turn up, but since I'm a lazy ass java programmer who never has to deal with allocating memory, it could take a while before I track down the bug in ipac-ng.
Top
zoltak
n00b
n00b
Posts: 40
Joined: Tue Mar 01, 2005 2:47 pm

ipac-ng problem resolved?

  • Quote

Post by zoltak » Wed Sep 14, 2005 11:51 pm

Has anyone managed to resolve this issue yet?
Top
frusware
n00b
n00b
Posts: 16
Joined: Sat Jun 12, 2004 9:40 pm

  • Quote

Post by frusware » Thu Sep 15, 2005 5:35 am

As chtephan pointed out, it's not so much a problem with glibc or your compiler, but it has to do with the lib/app doing something it's not supposed to do. For the original poster jeffk a fix in mysql-administrator and smbc are required and for me, a fix in ipac-ng.
Zoltak: What app/lib is returning the warning?
Top
zoltak
n00b
n00b
Posts: 40
Joined: Tue Mar 01, 2005 2:47 pm

  • Quote

Post by zoltak » Thu Sep 15, 2005 5:46 am

I was using ipac-ng
Top
speak2000
n00b
n00b
User avatar
Posts: 13
Joined: Sat Dec 10, 2005 6:15 pm

  • Quote

Post by speak2000 » Mon May 08, 2006 5:29 am

I know this topic is really old, but I've noticed this problem with some C++ programs I've written that implement the destructor and copy constructor. The trouble resides there (at least in my case).

Code: Select all

rm -r *
Oops.
Top
zoltak
n00b
n00b
Posts: 40
Joined: Tue Mar 01, 2005 2:47 pm

resolution

  • Quote

Post by zoltak » Mon May 08, 2006 6:11 am

I upgraded IPTABLES and IPACC. This fixed the issue. There was a bug in IPACC when referencing something in the new version of IPTABLES. Maybe its a bug in your code?

edit: typo!
Top
Post Reply

17 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Authors
Gentoo is a trademark of the Gentoo Foundation, Inc. and of Förderverein Gentoo e.V.
The contents of this document, unless otherwise expressly stated, are licensed under the CC-BY-SA-4.0 license.
The Gentoo Name and Logo Usage Guidelines apply.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy