After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 102025 - [Patch] Crash on exit/stop if sound was already in use
[Patch] Crash on exit/stop if sound was already in use
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins
0.5.0
Other other
: Normal normal
: 0.4.0
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2002-12-27 00:55 UTC by Martin Schlemmer
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gstreamer-0.5.0-segfault-on-state_change.patch (575 bytes, patch)
2002-12-27 00:57 UTC, Martin Schlemmer
none Details | Review
gst-plugins-0.5.0-never-return-on-oss-busy.patch (1.44 KB, patch)
2002-12-27 17:58 UTC, Martin Schlemmer
none Details | Review
gst-plugins-0.4.2-never-return-on-oss-busy.patch (1.21 KB, patch)
2002-12-27 17:59 UTC, Martin Schlemmer
none Details | Review

Description Martin Schlemmer 2002-12-27 00:55:53 UTC
Its primarily with rhythmbox-0.4.1.  If the sound device (OSS) was in use
before rhythmbox are started, and you either:

 1) start to play a song, and then pause it

 2) exit

gstreamer segfault.

gdb output of crash:

----------------------------------------
# gdb /usr/bin/rhythmbox 
GNU gdb 5.3
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) run
Starting program: /usr/bin/rhythmbox 
[New Thread 16384 (LWP 4438)]
INFO ( 4438: 0) Initializing GStreamer Core Library version 0.5.0 
INFO ( 4438: 0) CPU features: (00000000) MMX SSE 
registry: loaded user_registry in 0.000195 seconds
          (/root/.gstreamer/registry.xml)
registry: loaded global_registry in 0.097420 seconds
          (/var/lib/cache/gstreamer-0.5/registry.xml)
building level
building level
building level
building level
building level
building level
building level
building level
building level
building level
building level
building level
building level
building level
building level
[New Thread 32769 (LWP 4447)]
[New Thread 16386 (LWP 4448)]
[New Thread 32771 (LWP 4449)]
building level
building level
[New Thread 49156 (LWP 4450)]
[New Thread 65541 (LWP 4451)]

** (rhythmbox:4451): WARNING **: osscommon: unable to open the sound device
(in use ?)


Program received signal SIGINT, Interrupt.

Thread 65541 (LWP 4451)

  • #0 kill
    from /lib/libc.so.6
  • #1 pthread_kill
    from /lib/libpthread.so.0
  • #2 raise
    from /lib/libpthread.so.0
  • #3 rb_debug_stop_in_debugger
    at rb-debug.c line 137
  • #4 log_handler
  • #5 g_logv
    from /usr/lib/libglib-2.0.so.0
  • #6 g_log
    from /usr/lib/libglib-2.0.so.0
  • #7 gst_osscommon_open_audio
    from /usr/lib/gstreamer-0.5/libgstossaudio.so
  • #8 gst_osssink_change_state
    from /usr/lib/gstreamer-0.5/libgstossaudio.so
  • #9 gst_element_set_state
    at gstelement.c line 1938
  • #10 gst_bin_change_state
    at gstbin.c line 582
  • #11 gst_thread_main_loop
    at gstthread.c line 592
  • #12 g_thread_create_proxy
    from /usr/lib/libglib-2.0.so.0
  • #13 pthread_start_thread
    from /lib/libpthread.so.0
  • #14 pthread_start_thread_event
    from /lib/libpthread.so.0

Comment 1 Martin Schlemmer 2002-12-27 00:57:47 UTC
Created attachment 13233 [details] [review]
gstreamer-0.5.0-segfault-on-state_change.patch
Comment 2 Martin Schlemmer 2002-12-27 00:58:56 UTC
Above patch fixes this problem.  Its probibly more a kludge than the
real fix.

Ask if more info are needed.
Comment 3 Martin Schlemmer 2002-12-27 01:07:33 UTC
Sorry for this horde of posts, but it is late (or early rather) :/

Should have mentioned that I have had the same issues with
gstreamer 0.4.1 and 0.4.2 and rhythmbox 0.4.0.  I do not use
much else that make use of gstreamer, and have not had time
before to verify that this will fix the issue for those versions
as well, but I do imagine so.
Comment 4 Martin Schlemmer 2002-12-27 01:18:22 UTC
Yes, I am an idiot ... now it does not play at all.  Ill go to bed
now and have a look again tomorrow.
Comment 5 Martin Schlemmer 2002-12-27 17:58:39 UTC
Created attachment 13244 [details] [review]
gst-plugins-0.5.0-never-return-on-oss-busy.patch
Comment 6 Martin Schlemmer 2002-12-27 17:59:34 UTC
Created attachment 13245 [details] [review]
gst-plugins-0.4.2-never-return-on-oss-busy.patch
Comment 7 Martin Schlemmer 2002-12-27 18:05:28 UTC
Ok, the problem is that in linux you cannot open /dev/dsp (or
whatever) without O_NONBLOCK if the device are in use, as it
then never returns.  We thus need to open it O_NONBLOCK, and
then use fcntl() to set it to blocking mode.  This is at least
what both esound and mplayer does.

Attached is two patches, one for gst-plugins-0.5.0 and one
for gst-plugins-0.4.2, althoug the latter are just for reference
or whatever.


---------------------------------------------------
# gdb /usr/bin/gst-launch
GNU gdb 5.3
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and
you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) run filesrc
location=/space/MP3/Nine_Days/Radiohead-Karma_Police_\(live\).mp3 !
mad ! osssink
Starting program: /usr/bin/gst-launch filesrc
location=/space/MP3/Nine_Days/Radiohead-Karma_Police_\(live\).mp3 !
mad ! osssink
[New Thread 16384 (LWP 32035)]
INFO (32035: 0) Initializing GStreamer Core Library version 0.5.0
INFO (32035: 0) CPU features: (00000000) MMX SSE
registry: loaded user_registry in 0.000111 seconds
          (/root/.gstreamer/registry.xml)
registry: loaded global_registry in 0.099663 seconds
          (/var/lib/cache/gstreamer-0.5/registry.xml)
GStreamer-INFO: 0 live buffer(s)
GStreamer-INFO: 0 live bufferpool(s)
GStreamer-INFO: 0 live event(s)
RUNNING pipeline

** (process:32035): WARNING **: osscommon: unable to open the sound
device (in use ?)


Program received signal SIGINT, Interrupt.

Thread 16384 (LWP 32035)

  • #0 open
    from /lib/libc.so.6
  • #1 __JCR_LIST__
    from /usr/lib/gstreamer-0.5/libgstossaudio.so
  • #2 gst_osscommon_open_audio
    at gstosscommon.c line 293
  • #3 gst_osssink_change_state
    at gstosssink.c line 577
  • #4 gst_element_set_state
    at gstelement.c line 1938
  • #5 gst_bin_change_state
    at gstbin.c line 582
  • #6 gst_pipeline_change_state
    at gstpipeline.c line 168
  • #7 gst_element_set_state
    at gstelement.c line 1938
  • #8 main
    at gst-launch.c line 239
  • #9 __libc_start_main
    from /lib/libc.so.6

Comment 8 Christian Fredrik Kalager Schaller 2003-01-12 11:42:36 UTC
Patch applied to CVS and will be in 0.5.2, thanks Martin!