<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>91618</bug_id>
          
          <creation_ts>2005-05-05 14:42 0000</creation_ts>
          <short_desc>Soundtracker 0.6.7 crashes on start (frees invalid pointer)</short_desc>
          <delta_ts>2006-04-02 11:01:11 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Applications</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <keywords>InCVS</keywords>
          <priority>P2</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>lionsphil@dsl.pipex.com</reporter>
          <assigned_to>sound@gentoo.org</assigned_to>
          <cc>tcort@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>lionsphil@dsl.pipex.com</who>
            <bug_when>2005-05-05 14:42:30 0000</bug_when>
            <thetext>Soundtracker crashes when started. The &quot;Tip of the Day&quot; and another window I have been unable to catch in time flash up briefly first. The error message is below.

Reproducible: Always
Steps to Reproduce:
1) Emerge the current version of soundtracker (see &apos;Additional Information&apos; for USE flags).
2) Run &quot;soundtracker&quot; from a terminal.

The command line arguments do not seem to matter: I have the same result with none, a MOD file, &quot;--help&quot;, and &quot;--version&quot;.
Actual Results:  
The following error message is output to the terminal:

*** glibc detected *** free(): invalid pointer: 0xbffff2d0 ***
Aborted

Expected Results:  
No crash. ;)

Exact version and USE flags for soundtracker:
media-sound/soundtracker-0.6.7  +alsa -debug -esd -gnome +jack +nls -oss

And the following versions of/flags for alsa-lib, JACK, GTK+:
media-libs/alsa-lib-1.0.8  -doc +jack
media-plugins/alsa-jack-1.0.8
x11-libs/gtk+-1.2.10-r11 -debug +nls


Portage 2.0.51.19 (default-linux/x86/2005.0, gcc-3.3.5-20050130, glibc-2.3.4.
20041102-r1, 2.6.11-gentoo-r4 i686)
=================================================================
System uname: 2.6.11-gentoo-r4 i686 Mobile Intel(R) Celeron(R) CPU 1.80GHz
Gentoo Base System version 1.4.16
Python:              dev-lang/python-2.3.5 [2.3.5 (#1, Apr 30 2005, 16:52:34)]
dev-lang/python:     2.3.5
sys-apps/sandbox:    [Not Present]
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.4
sys-devel/binutils:  2.15.92.0.2-r7
sys-devel/libtool:   1.5.16
virtual/os-headers:  2.6.8.1-r2, 2.4.19-r1
ACCEPT_KEYWORDS=&quot;x86&quot;
AUTOCLEAN=&quot;yes&quot;
CFLAGS=&quot;-O3 -march=i686 -funroll-loops -pipe&quot;
CHOST=&quot;i686-pc-linux-gnu&quot;
CONFIG_PROTECT=&quot;/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/
X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/
dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/
config/ /usr/share/texmf/xdvi/ /var/qmail/control&quot;
CONFIG_PROTECT_MASK=&quot;/etc/gconf /etc/terminfo /etc/env.d&quot;
CXXFLAGS=&quot;-O3 -march=i686 -funroll-loops -pipe&quot;
DISTDIR=&quot;/usr/portage/distfiles&quot;
FEATURES=&quot;autoaddcvs autoconfig ccache distlocks fixpackages sandbox sfperms 
strict userpriv usersandbox&quot;
GENTOO_MIRRORS=&quot;ftp://ftp.heanet.ie/pub/gentoo/ http://mirrors.sec.informatik.
tu-darmstadt.de/gentoo/&quot;
MAKEOPTS=&quot;-j2&quot;
PKGDIR=&quot;/usr/portage/packages&quot;
PORTAGE_TMPDIR=&quot;/var/tmp&quot;
PORTDIR=&quot;/usr/portage&quot;
SYNC=&quot;rsync://rsync.uk.gentoo.org/gentoo-portage&quot;
USE=&quot;x86 X aalib alsa apm avi bash-completion berkdb bitmap-fonts crypt cups 
curl dga divx4linux emboss fbcon flac foomaticdb fortran gdbm gif gpm gtk gtk2 
guile ipv6 jack jack-tmpfs java jikes jpeg libcaca libg++ libwww mad mikmod mmx 
mng motif mozsvg mp3 mpeg ncurses nls ogg oggvorbis opengl pam pcmcia pdflib 
perl png pnp postgres python qt quicktime readline ruby sdl slang spell sse ssl 
svg tcltk tcpd tetex tiff truetype truetype-fonts type1-fonts unicode usb vorbis 
wmf wxwindows xml xml2 xmms xv xvid zlib userland_GNU kernel_linux libc_glibc&quot;
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, 
PORTDIR_OVERLAY</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>kalthare@freeshell.org</who>
            <bug_when>2005-08-14 22:06:04 0000</bug_when>
            <thetext>I&apos;m having this problem too. You can workaround it by removing the &apos;alsa&apos; USE
flag. Not ideal, I know, but at least the program will start.

Here&apos;s a backtrace:

#0  0xb788e841 in kill () at string2.h:1000
#1  0xb79f1ed1 in pthread_kill (thread=14953, signo=0) at signals.c:69
#2  0xb79f2268 in __pthread_raise (sig=-1214283788) at signals.c:200
#3  0xb788e5a4 in *__GI_raise (sig=6) at raise.c:34
#4  0xb788fbcd in *__GI_abort () at abort.c:88
#5  0xb78c0cb5 in __libc_message (do_abort=2,
    fmt=0xb796f060 &quot;*** glibc detected *** %s: 0x%s ***\n&quot;)
    at libc_fatal.c:145
#6  0xb78ca8f6 in malloc_printerr (action=2, str=0x0, ptr=0x0)
    at malloc.c:5523
#7  0xb78c95df in _int_free (av=0xb797b9e0, mem=0xbf8a2540) at malloc.c:4233
#8  0xb78c826f in *__GI___libc_free (mem=0xbf8a2540) at malloc.c:3404
#9  0xb7b5eb06 in snd_seq_port_subscribe_free (obj=0xbf8a2540) at seq.c:2312
#10 0x08092a6d in midi_init () at midi-09x.c:310
#11 0x0806f461 in main (argc=1, argv=0xbf8a2624) at main.c:235</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>marka@desert.cx</who>
            <bug_when>2005-09-04 08:12:52 0000</bug_when>
            <thetext>Created an attachment (id=67640)
Removes an unnecessary &amp; harmful call to snd_seq_port_subscribe_free

Here&apos;s a patch that fixes the crash on startup. It&apos;s really trivial so
hopefully a new ebuild won&apos;t take too long.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>tcort@gentoo.org</who>
            <bug_when>2006-01-12 12:29:15 0000</bug_when>
            <thetext>Created an attachment (id=76936)
soundtracker-0.6.7-r1.ebuild

I verified that the patch is correct. It removes a line in midi_init() in
app/midi-09x.c that free()&apos;s a variable called &quot;port_sub&quot;. Removing the line
doesn&apos;t cause a memory leak as the variable is allocated on the stack by the
line snd_seq_port_subscribe_alloca(&amp;port_sub). free()&apos;ing that memory caused
the crash. The crash doesn&apos;t happen all of the time because the line that
causes the error is in a block of code that only gets executed if
snd_seq_subscribe_port( midi_handle, port_sub) returns an error.

This ebuild applies the patch in attachement #67640. Download the patch to
soundtracker-0.6.7-invalid-free-fix.patch and put it in the files directory.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>tcort@gentoo.org</who>
            <bug_when>2006-04-02 11:01:11 0000</bug_when>
            <thetext>New revision that applies the patch committed to CVS. Thanks for the patch Mark.</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>67640</attachid>
            <date>2005-09-04 08:12 0000</date>
            <desc>Removes an unnecessary &amp; harmful call to snd_seq_port_subscribe_free</desc>
            <filename>soundtracker-crashfix.patch</filename>
            <type>text/plain</type>
            <data encoding="base64">ZGlmZiAtcnVOIC1YIC9ob21lL21hcmthL2RpZmYtaWdub3JlLnR4dCBzb3VuZHRyYWNrZXItMC42
Ljcub3JpZy9hcHAvbWlkaS0wOXguYyBzb3VuZHRyYWNrZXItMC42LjcvYXBwL21pZGktMDl4LmMK
LS0tIHNvdW5kdHJhY2tlci0wLjYuNy5vcmlnL2FwcC9taWRpLTA5eC5jCTIwMDMtMDUtMTcgMDc6
MzM6MTMuMDAwMDAwMDAwIC0wNDAwCisrKyBzb3VuZHRyYWNrZXItMC42LjcvYXBwL21pZGktMDl4
LmMJMjAwNS0wOS0wNCAxMDo0OTozOC4wMDAwMDAwMDAgLTA0MDAKQEAgLTMwNyw3ICszMDcsNiBA
QAogCiAgICAgICByYyA9IHNuZF9zZXFfc3Vic2NyaWJlX3BvcnQoIG1pZGlfaGFuZGxlLCBwb3J0
X3N1Yik7CiAgICAgICBpZiAocmMgPCAwKSB7Ci0Jc25kX3NlcV9wb3J0X3N1YnNjcmliZV9mcmVl
KHBvcnRfc3ViKTsKIAljbG9zZV9oYW5kbGUoIG1pZGlfaGFuZGxlKTsKIAltaWRpX2hhbmRsZSA9
IE5VTEw7CiAJZ193YXJuaW5nKCAiZXJyb3Igc3Vic2NyaWJpbmcgc2VxdWVuY2VyIHBvcnQgKCVz
KVxuIiwgIHNuZF9zdHJlcnJvcihyYykpOwo=
</data>        

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>76936</attachid>
            <date>2006-01-12 12:29 0000</date>
            <desc>soundtracker-0.6.7-r1.ebuild</desc>
            <filename>soundtracker-0.6.7-r1.ebuild</filename>
            <type>text/plain</type>
            <data encoding="base64">IyBDb3B5cmlnaHQgMTk5OS0yMDA1IEdlbnRvbyBGb3VuZGF0aW9uCiMgRGlzdHJpYnV0ZWQgdW5k
ZXIgdGhlIHRlcm1zIG9mIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSB2MgojICRIZWFk
ZXI6ICQKCklVU0U9Im5scyBlc2QgZ25vbWUgb3NzIGFsc2EgamFjayIKCmluaGVyaXQgZXV0aWxz
IGZsYWctby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