Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 301800 - x11-plugins/wmix fails to malloc due to sYSMALLOc: Assertion error
Summary: x11-plugins/wmix fails to malloc due to sYSMALLOc: Assertion error
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Dockapp Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-22 03:59 UTC by maurerpe
Modified: 2010-02-23 11:02 UTC (History)
0 users

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


Attachments
Patches that fixes wmix (wmix-fix-free.patch,363 bytes, patch)
2010-01-22 04:01 UTC, maurerpe
Details | Diff
ebuild that applies the patch in attachment 217134 (wmix-3.1-r2.ebuild,955 bytes, text/plain)
2010-01-22 04:03 UTC, maurerpe
Details

Note You need to log in before you can comment on or make changes to this bug.
Description maurerpe 2010-01-22 03:59:01 UTC
When starting the wmix docapp, a nasty error appears:
$ wmix
wmix: malloc.c:3074: sYSMALLOc: Assertion `(old_top == (((mbinptr) (((char *) &((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct malloc_chunk, fd)))) && old_size == 0) || ((unsigned long) (old_size) >= (unsigned long)((((__builtin_offsetof (struct malloc_chunk, fd_nextsize))+((2 * (sizeof(size_t))) - 1)) & ~((2 * (sizeof(size_t))) - 1))) && ((old_top)->size & 0x1) && ((unsigned long)old_end & pagemask) == 0)' failed.
Aborted 

The program then exits.

Reproducible: Always

Steps to Reproduce:
1. Start wmix
2. Failure



I don't really understand the error, but my guess that it is caused by the program using malloc/free incorrectly and overrunning buffers.  Several calls after the true source of the problem, in a possibly unrealated section of code, the system malloc function in glibc detects that the heap has been corrupted and ends the program.

Google tells me that this bug can show up in a number of applications but is generally found on x86_64 systems running glibc 2.10.  However, glibc 2.10 is what detects the heap corruption, the program (wmix in this case) is still in error.

Searching another forum where users had similar issues similar issues found a patch to wmix that fixes the problem.  It appears it was not allocating enough memory when calling calloc.

$ emerge --info
Portage 2.2_rc61 (default/linux/amd64/10.0/desktop, gcc-4.4.2, glibc-2.10.1-r1, 2.6.32-gentoo x86_64)
=================================================================
System uname: Linux-2.6.32-gentoo-x86_64-AMD_Athlon-tm-_64_X2_Dual_Core_Processor_3800+-with-gentoo-2.0.1
Timestamp of tree: Sun, 17 Jan 2010 02:45:01 +0000
app-shells/bash:     4.0_p35
dev-java/java-config: 2.1.9-r2
dev-lang/python:     2.6.4
dev-util/cmake:      2.6.4-r3
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.0
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.4_p6, 1.5, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=athlon64 -mtune=native -msse3 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /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="-march=athlon64 -mtune=native -msse3 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixpackages news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
FFLAGS="-march=athlon64 -mtune=native -msse3 -O2 -pipe"
GENTOO_MIRRORS="ftp://gentoo.cites.uiuc.edu/pub/gentoo/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1"
LINGUAS="en_US en"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/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/java-overlay /usr/local/portage/layman/science /usr/local/overlays/maurerpe /usr/local/overlays/java-experimental"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X Xaw3d a52 aac acpi alsa amd64 amr apm archive bash-completion berkdb bidi binary-drivers branding brasero buffysize bzip2 cairo cdaudio cdb cdda cddb cdr cdrom cdsound chroot cli colordiff consolekit cpudetection cracklib crypt cups cxx dbus dga dri dts dv dvd dvdr emacs emboss emerald encode evo exif fam fat ffmpeg fftw firefox flac foomaticdb fortran ftp gd gdbm gif gimp glitz gmedia gmp gnome gnuplot gphoto2 gpm gs gstreamer gtk gtkspell guile gzip hal hfs iconv icu ieee1394 imagemagick ipv6 jack javascript jpeg jpeg2k kino kpathsea lame latex libffi libnotify libwww lm_sensors logrotate lucene lyx mad maildir mbox mdb mikmod mime mmx mmxext mng modules mopac7 mp2 mp3 mp4 mpeg mplayer mpqc mudflap multilib musepack nautilus ncurses networking nls nntp nptl nptlonly nsplugin ogg openal openbabel openexr opengl openmp openssl pam pcre pdf perl plotutils png pnm pop posix postscript ppds pppd print python qt3support quicktime raw readline realmedia reflection regex rtc sbcl scanner sdl session sharedmem smp sockets sound sox speex spell spl sqlite sqlite3 sse sse2 ssl startup-notification svg sysfs theora threads threadsafe thunar tiff toolkit-scroll-bars truetype unicode usb v4l v4l2 vorbis wma wmf wmp wxwindows x264 xcb xcomposite xine xml xorg xpm xulrunner xv xvid xvmc 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 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" CAMERAS="canon" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_US en" RUBY_TARGETS="ruby18" SANE_BACKENDS="hp" USERLAND="GNU" VIDEO_CARDS="nv vesa vga fbdev apm nvidia" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 maurerpe 2010-01-22 04:01:12 UTC
Created attachment 217134 [details, diff]
Patches that fixes wmix
Comment 2 maurerpe 2010-01-22 04:03:13 UTC
Created attachment 217136 [details]
ebuild that applies the patch in attachment 217134 [details, diff]

This fixed the issue on my system.
Comment 3 Michele Noberasco (RETIRED) gentoo-dev 2010-02-23 11:02:08 UTC
Fix is in Portage. Thanks for the submission!