# *** glibc detected *** malloc(): memory corruption

## musv

Hi there, 

I wasn't really sure, where to put that problem. Ok, the story so far:

I'm running a HTPC with vdr as TV Backend and XBMC as frontend. Until last week everything worked fine. On the weekend I made a system update and now XBMC refuses to work. 

When I start the X-Server it starts automatically XBMC. When XBMC has finished starting up I get immediately the following error message:

```
X.Org X Server 1.11.4

Release Date: 2012-01-27

X Protocol Version 11, Revision 0

Build Operating System: Linux 3.4.4-gentoo x86_64 Gentoo

Current Operating System: Linux htpc 3.2.14-gentoo #3 SMP Sat Jun 16 10:08:48 CEST 2012 x86_64

Kernel command line: BOOT_IMAGE=/boot/bzImage-3214 root=/dev/sda2 quiet ro CONSOLE=/dev/tty1 acpi_enforce_resources=lax

Build Date: 04 July 2012  05:42:57PM

 

Current version of pixman: 0.26.0

   Before reporting problems, check http://wiki.x.org

   to make sure that you have the latest version.

Markers: (--) probed, (**) from config file, (==) default setting,

   (++) from command line, (!!) notice, (II) informational,

   (WW) warning, (EE) error, (NI) not implemented, (??) unknown.

(==) Log file: "/var/log/Xorg.0.log", Time: Wed Jul  4 18:43:52 2012

(==) Using config file: "/etc/X11/xorg.conf"

(==) Using config directory: "/etc/X11/xorg.conf.d"

(==) Using system config directory "/usr/share/X11/xorg.conf.d"

The XKEYBOARD keymap compiler (xkbcomp) reports:

> Warning:          Type "ONE_LEVEL" has 1 levels, but <RALT> has 2 symbols

>                   Ignoring extra symbols

Errors from xkbcomp are not fatal to the X server

*** glibc detected *** /usr/lib64/xbmc/xbmc.bin: malloc(): memory corruption: 0x00007fc958002550 ***
```

See the last line. After that XBMC freezes. I can kill XBMC and restart with the same result. Using an alternative TV Frontend (xineliboutput) works stable with vdpau acceleration. 

The strange things:

First of all I reverted XBMC back from 11.0_p76 to 11.0_p70 which I used for many months without problems. Didn't help.

Next trial was to downgrade the Nvidia-driver from 302.17 to 295.59 - no change

Next: downgrade vdr from 1.7.28 to 1.7.27 - no change

Next: downgrade xorg-server from 12.2 to 11.4 including rebuild of all drivers - no change.

started XBMC with another user to check for a possible misconfiguration - no change.

downgraded the kernel from 3.4.4. to 3.2.14 - nothing

Filesystem is checked and clean

emerge --info

```
Portage 2.1.11.3 (default/linux/amd64/10.0, gcc-4.6.3, glibc-2.15-r2, 3.2.14-gentoo x86_64)

=================================================================

System uname: Linux-3.2.14-gentoo-x86_64-Intel-R-_Atom-TM-_CPU_D525_@_1.80GHz-with-gentoo-2.1

Timestamp of tree: Sat, 30 Jun 2012 08:00:01 +0000

distcc 3.1 x86_64-pc-linux-gnu [disabled]

app-shells/bash:          4.2_p29

dev-lang/python:          2.7.3-r2, 3.2.3-r1

dev-util/cmake:           2.8.8-r3

dev-util/pkgconfig:       0.26

sys-apps/baselayout:      2.1-r1

sys-apps/openrc:          0.10.3

sys-apps/sandbox:         2.5

sys-devel/autoconf:       2.13, 2.69

sys-devel/automake:       1.11.5, 1.12.1

sys-devel/binutils:       2.22-r1

sys-devel/gcc:            4.6.3

sys-devel/gcc-config:     1.7.3

sys-devel/libtool:        2.4.2

sys-devel/make:           3.82-r3

sys-kernel/linux-headers: 3.4 (virtual/os-headers)

sys-libs/glibc:           2.15-r2

Repositories: gentoo Local-Overlay vdr-devel oss-overlay

ACCEPT_KEYWORDS="amd64 ~amd64"

ACCEPT_LICENSE="* -@EULA"

CBUILD="x86_64-pc-linux-gnu"

CFLAGS="-march=atom -O2 -pipe"

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/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"

CXXFLAGS="-march=atom -O2 -pipe"

DISTDIR="/var/portage/distfiles"

EMERGE_DEFAULT_OPTS="--quiet-build=n"

FCFLAGS="-O2 -pipe"

FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles news parallel-fetch parse-eapi-ebuild-head protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox"

FFLAGS="-O2 -pipe"

GENTOO_MIRRORS="http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/ http://gentoo.mneisen.org/ http://de-mirror.org/distro/gentoo/ http://gentoo.supp.name/ http://gentoo.krasko.sk/"

LANG="de_DE.UTF-8"

LDFLAGS="-Wl,-O1 -Wl,--as-needed"

LINGUAS="de pt_BR"

MAKEOPTS="-j5"

PKGDIR="/usr/portage/packages"

PORTAGE_CONFIGROOT="/"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/usr/portage/local/local-overlay /usr/portage/local/layman/vdr-devel /usr/portage/local/layman/oss-overlay"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="X a52 aac aalib acpi aften alsa amd64 apache2 ass bash-completion berkdb bluetooth bluray branding bs2b btrfs bzip2 cli consolekit crossdev crypt css ctrls cups cxx dbus dri dts dv dvb dvd exif fat ffmpeg fftw flac fontconfig fortran g3dvl gd gif gmp gphoto2 gpm gsm gstreamer gtk gudev gzip hddtemp hwdb iconv imagemagick imlib jpeg jpeg2k lame lcd lcdfilter lcms libcaca libsamplerate lirc live lm_sensors lzma lzo mad matroska mime mms mmx mmxext mng modules mp3 mp4 mpeg mplayer mudflap multilib musepack mysql mysqli mythtv ncurses network nls nptl ogg opengl openmp openssl osdmenu pam pcre png pnm policykit pppd python python3 qt3support quicktime radio rar raw readline rtc rtmp sdl session smp sndfile sqlite sqlite3 sse sse2 ssl ssse3 strong-optimization svg tcpd theora threads tiff truetype udev unicode v4l v4l2 vcd vdpau vorbis wav wavpack wma wmf x264 xcb xcomposite xft xorg xrandr xv xvid xvmc xz zip zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="imon imonlcd" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="de pt_BR" LIRC_DEVICES="inputlirc devinput imon imon_24g imon_knob imon_lcd imon_pad imon_rsc" PHP_TARGETS="php5-3" PYTHON_TARGETS="python3_2 python2_7" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="nvidia nouveau vesa" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"

Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
```

----------

## Hu

You updated to a new version of glibc with stricter memory corruption checks.  Your XBMC has always been buggy, and now your system is telling you about it.  You need to find a version of XBMC that does not corrupt the heap.  If such a version exists, it will likely be a recent release.

----------

## musv

The problem was the last version of XBMC-Addon-xvdr:

https://github.com/pipelka/xbmc-addon-xvdr/issues/54

It's strange, that a plugin - even not activated can crash the whole software.

----------

## nightkid

i'll post here in case someone stumbles upon the same issue.

had the same error, installed mplayer2 during my investigation, mplayer2 worked after complaining about a few deprecated entries in the config file. Once i've disabled those, both mplayer and mplayer2 started working. In my case, the malloc error was caused by menu=1.

bottom line: always try a default config before complaining  :Wink: 

----------

