Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 40446 - smpeg-xmms + xmms-imms causes xmms-1.2.10 to segfault on exit
Summary: smpeg-xmms + xmms-imms causes xmms-1.2.10 to segfault on exit
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Jeremy Huddleston (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-04 23:35 UTC by Jeremy Huddleston (RETIRED)
Modified: 2008-02-24 12:45 UTC (History)
2 users (show)

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 Jeremy Huddleston (RETIRED) gentoo-dev 2004-02-04 23:35:35 UTC
Note of an annoyance I want to look into.  With imms enabled, xmms segfaults on exit.  With it disabled, it exits gracefully.

$ qpkg -I -v -nc xmms
xfce-extra/xfce4-xmms-0.1.1
x11-themes/xmms-themes-0.0.3
dev-perl/Xmms-Perl-0.12
dev-python/pyxmms-2.02
media-sound/xmmsd-0.3
media-sound/xmmsctrl-1.6-r1
media-sound/noxmms-1.2.7
media-sound/xmms-1.2.9-r2
media-video/smpeg-xmms-0.3.5-r1
media-plugins/xmms-lyrc-0.2
media-plugins/xmms-sndfile-1.2
media-plugins/xmms-arts-0.6.0
media-plugins/xmms-midi-0.03
media-plugins/xmms-musepack-0.98-r1
media-plugins/modplugxmms-2.04
media-plugins/xmms-jess-2.9.1
media-plugins/xmms-finespectrum-1.0.1_alpha1
media-plugins/xmms-ladspa-0.7
media-plugins/xmms-infinity-0.2
media-plugins/xmms-imms-1.0
media-plugins/xmms-scrobbler-0.3.1
media-plugins/xmms-cdread-0.14a-r1
media-plugins/efxmms-0.0.3
media-plugins/xmms-null-0.3
media-plugins/xmms-cdcover-0.2
media-plugins/xmms-mad-0.5.6
media-plugins/dumb-xmms-0.1
media-plugins/xmms-lirc-1.4
media-plugins/xmms-alarm-0.3.3
media-plugins/xmms-shell-0.99.3-r1
media-plugins/alsa-xmms-0.9.12
media-plugins/eq-xmms-0.5
media-plugins/xmms-nebulus-0.6.0
media-plugins/xmms-crossfade-0.3.4

CFLAGS="-march=pentium3 -mcpu=pentium3 -pipe -g"
CXXFLAGS="-march=pentium3 -mcpu=pentium3 -pipe -g"

(gdb) bt
#0  0x40fefd74 in ?? ()
#1  0x411a68af in std::basic_filebuf<char, std::char_traits<char> >::close() ()
   from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/libstdc++.so.5
#2  0x41ddc50d in Imms::~Imms() () from /usr/lib/xmms/Visualization/libimms.so
#3  0x41dd8b68 in imms_cleanup () from /usr/lib/xmms/Visualization/libimms.so
#4  0x41dd998c in cleanup () from /usr/lib/xmms/Visualization/libimms.so
#5  0x08060bf7 in enable_vis_plugin (i=3, enable=0) at visualization.c:120
#6  0x08063207 in cleanup_plugins () at pluginenum.c:475
#7  0x08075613 in mainwin_quit_cb () at main.c:963
#8  0x0806bbc6 in pbutton_button_release_cb (widget=0x8179978, event=0x820e040, 
    button=0x817b290) at pbutton.c:71
#9  0x0806b6ae in handle_release_cb (wlist=0x8144c48, widget=0x8179978, event=0x820e040)
    at widget.c:90
#10 0x08075e96 in mainwin_release (widget=0x8179978, event=0x820e040, callback_data=0x0)
    at main.c:1235
#11 0x401516ec in gtk_marshal_BOOL__POINTER () from /usr/lib/libgtk-1.2.so.0
(gdb) frame 3
#3  0x41dd8b68 in imms_cleanup () from /usr/lib/xmms/Visualization/libimms.so

Note that imms doesn't honor the user set CFLAGS, so that needs to be done too...
Comment 1 Jeremy Huddleston (RETIRED) gentoo-dev 2004-02-05 00:31:14 UTC
updated imms to use user set CFLAGS... so now I have a better bt...

(gdb) bt
#0  0x40fefd74 in ?? ()
#1  0x411a68af in std::basic_filebuf<char, std::char_traits<char> >::close() ()
   from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/libstdc++.so.5
#2  0x411a65fd in std::basic_filebuf<char, std::char_traits<char> >::~basic_filebuf() ()
   from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/libstdc++.so.5
#3  0x411a9dff in std::basic_ofstream<char, std::char_traits<char> >::~basic_ofstream()
    () from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/libstdc++.so.5
#4  0x41de6ddd in ~Imms (this=0x819b698) at imms.cc:45
#5  0x41de3019 in imms_cleanup () at plugin.cc:73
#6  0x41de3c08 in cleanup () at interface.c:53
#7  0x08060bf7 in enable_vis_plugin (i=3, enable=0) at visualization.c:120
#8  0x08063207 in cleanup_plugins () at pluginenum.c:475
#9  0x08075613 in mainwin_quit_cb () at main.c:963
#10 0x0806bbc6 in pbutton_button_release_cb (widget=0x817ab10, event=0x8179850, 
    button=0x817c618) at pbutton.c:71
#11 0x0806b6ae in handle_release_cb (wlist=0x8144c24, widget=0x817ab10, event=0x8179850)
    at widget.c:90
#12 0x08075e96 in mainwin_release (widget=0x817ab10, event=0x8179850, callback_data=0x0)
    at main.c:1235
#13 0x401516ec in gtk_marshal_BOOL__POINTER () from /usr/lib/libgtk-1.2.so.0
(gdb) frame 4
#4  0x41de6ddd in ~Imms (this=0x819b698) at imms.cc:45
45      string last_song;
Current language:  auto; currently c++
(gdb) frame 5
#5  0x41de3019 in imms_cleanup () at plugin.cc:73
73          delete imms;
(gdb) frame 6
#6  0x41de3c08 in cleanup () at interface.c:53
53          imms_cleanup();
Current language:  auto; currently c
Comment 2 Jeremy Huddleston (RETIRED) gentoo-dev 2004-02-26 03:08:52 UTC
Still happening with latest versions...

$ qpkg -I -v -nc xmms
xfce-extra/xfce4-xmms-0.1.1
x11-themes/xmms-themes-0.0.3
dev-perl/Xmms-Perl-0.12
dev-python/pyxmms-2.02
media-sound/xmmsd-0.3
media-sound/xmmsctrl-1.6-r1
media-sound/noxmms-1.2.7
media-sound/xmms-1.2.10
media-video/smpeg-xmms-0.3.5-r1
media-plugins/xmms-lyrc-0.2
media-plugins/xmms-sndfile-1.2
media-plugins/xmms-arts-0.6.0
media-plugins/xmms-midi-0.03
media-plugins/xmms-musepack-0.98-r2
media-plugins/xmms-jack-0.8.1
media-plugins/modplugxmms-2.04
media-plugins/xmms-jess-2.9.1
media-plugins/xmms-finespectrum-1.0.1_alpha1
media-plugins/xmms-ladspa-0.7
media-plugins/xmms-infinity-0.2
media-plugins/xmms-scrobbler-0.3.1
media-plugins/xmms-sexypsf-0.4.4
media-plugins/xmms-cdread-0.14a-r1
media-plugins/efxmms-0.0.3
media-plugins/xmms-null-0.3
media-plugins/xmms-cdcover-0.2
media-plugins/xmms-mad-0.5.6
media-plugins/dumb-xmms-0.1
media-plugins/xmms-lirc-1.4
media-plugins/xmms-alarm-0.3.3
media-plugins/xmms-shell-0.99.0-r1
media-plugins/alsa-xmms-0.9.12
media-plugins/eq-xmms-0.5
media-plugins/xmms-imms-1.0.1
media-plugins/xmms-nebulus-0.6.0
media-plugins/xmms-crossfade-0.3.4
Comment 3 Jeremy Huddleston (RETIRED) gentoo-dev 2004-02-26 20:42:24 UTC
Reduced test case:
xmms-1.2.10
xmpeg-xmms-0.3.5-r1
xmms-imms-1.0.0

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 30674)]
0x40fa0a50 in ?? ()
(gdb) bt
#0  0x40fa0a50 in ?? ()
#1  0x41152538 in std::basic_filebuf<char, std::char_traits<char> >::_M_destroy_internal_buffer() () from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/libstdc++.so.5
#2  0x41152360 in std::basic_filebuf<char, std::char_traits<char> >::close() () from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/libstdc++.so.5
#3  0x41152010 in std::basic_filebuf<char, std::char_traits<char> >::~basic_filebuf() () from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/libstdc++.so.5
#4  0x41155ed2 in std::basic_ofstream<char, std::char_traits<char> >::~basic_ofstream() () from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/libstdc++.so.5
#5  0x4132e2a4 in ~Imms (this=0x817af30) at imms.cc:66
#6  0x4132a593 in imms_cleanup () at plugin.cc:73
#7  0x4132b261 in cleanup () at interface.c:56
#8  0x0806432d in enable_vis_plugin ()
#9  0x081718f4 in ?? ()
#10 0x41354b60 in use_autooff () from /usr/lib/xmms/Visualization/libimms.so
#11 0x41354b60 in use_autooff () from /usr/lib/xmms/Visualization/libimms.so
#12 0x08173a30 in ?? ()
#13 0x40222a68 in g_list_position () from /usr/lib/libglib-1.2.so.0
#14 0x081718c4 in ?? ()
#15 0x08066603 in cleanup_plugins ()
#16 0xbfffe700 in ?? ()
#17 0x08170b70 in ?? ()
#18 0x0816dda0 in ?? ()
#19 0x08170b70 in ?? ()
#20 0x0816dda0 in ?? ()
#21 0x0807fc13 in mainwin_quit_cb ()
gins.php?details=2
Comment 4 Jeremy Huddleston (RETIRED) gentoo-dev 2004-03-09 11:07:16 UTC
that should be smpeg-xmms

the imms code looks good, and I walked through it with the dev, and I believe the problem to be smpeg trashing some memory that doesn't belong to it...  so i'll look into that next...
Comment 5 Jeremy Huddleston (RETIRED) gentoo-dev 2004-03-13 03:07:48 UTC
moved smpeg-xmms to ~arch because of this...
Comment 6 Josh Glover (RETIRED) gentoo-dev 2004-04-13 18:45:22 UTC
This may well be our problem:

valgrind -v --logfile=xmms.log xmms

==23081== 1 errors in context 1 of 6:
==23081== Invalid read of size 4
==23081==    at 0x805F493: get_input_playing (input.c:516)
==23081==    by 0x80631CA: cleanup_plugins (pluginenum.c:475)
==23081==    by 0x807573F: mainwin_quit_cb (main.c:964)
==23081==    by 0x806BBED: pbutton_button_release_cb (pbutton.c:71)
==23081==    Address 0x41AE7550 is 8 bytes inside a block of size 16 free'd
==23081==    at 0x40029D5B: free (in /usr/lib/valgrind/vgskin_memcheck.so)
==23081==    by 0x4046B2B2: g_free (in /usr/lib/libglib-1.2.so.0.0.10)
==23081==    by 0x8062F5C: cleanup_plugins (pluginenum.c:415)
==23081==    by 0x807573F: mainwin_quit_cb (main.c:964)

I have verified that this only occurs when the xmms-imms plugin is enabled. The error occurs whether smpeg-xmms is installed or not. Here is the offending section from pluginenum.c:415

        g_list_free(ip_data->input_list);
        g_free(ip_data);

Unfortunately, valgrind prevents the segfault from occurring. However, it makes sense for the above error to be related to the segfault--it does occur at a logical time in the shutdown process. I will take gdb in there and see if I cannot find out more.

Comment 7 Josh Glover (RETIRED) gentoo-dev 2004-04-15 06:11:47 UTC
The issue that valgrind detects would be caused by something like this:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main( void ) {

  char      *foo = NULL;
  char      *bar = NULL;
  unsigned   tri = 0xffffff;

  foo = malloc( 16 );
  bar = &foo[8];

  memcpy( bar, &tri, sizeof( unsigned ) );

  free( foo );

  memcpy( &tri, bar, sizeof( unsigned ) );

  return 0;

} // main()
Comment 8 Jeremy Huddleston (RETIRED) gentoo-dev 2004-06-15 16:48:43 UTC
this bug is too obsecure for me to care about any more, and xmms-xmmsmplayer is a better solution anyways...