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 589797 - alsasrc does not set GstAlsaSrc->handle to NULL after snd_pcm_close. causes crashes from places like gst_alsa_find_device_name
alsasrc does not set GstAlsaSrc->handle to NULL after snd_pcm_close. causes c...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other All
: Normal blocker
: 0.10.24
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-07-26 20:20 UTC by Balachandran. C
Modified: 2009-07-27 13:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
alsasrc: set alsasrc->handle back to NULL when closing device (856 bytes, patch)
2009-07-27 09:35 UTC, Tim-Philipp Müller
committed Details | Review

Description Balachandran. C 2009-07-26 20:20:26 UTC
Steps to reproduce:
1. 
2. 
3. 


Stack trace:


Other information:
Comment 1 Balachandran. C 2009-07-26 20:25:09 UTC
1) gstalsarc.c: 743: snd_pcm_close is not followed with alsa->handle = NULL;

2) also, on comparing gst_alsasrc_close and gstalsasink.c:gst_alsasink_close, some of the protection against errors seem to be missing. someone kindly take a look at this.

Comment 2 Tim-Philipp Müller 2009-07-27 09:35:33 UTC
Created attachment 139269 [details] [review]
alsasrc: set alsasrc->handle back to NULL when closing device
Comment 3 Jan Schmidt 2009-07-27 13:00:01 UTC
Seems sensible, and small enough to land in Thursday's release... please commit
Comment 4 Tim-Philipp Müller 2009-07-27 13:37:40 UTC
commit 01e0fdd86c65123130147f64be33606bf2cca26b
Author: Balachandran C <balachandran_c@rediffmail.com>
Date:   Mon Jul 27 10:29:27 2009 +0100

    alsasrc: set alsasrc->handle back to NULL when closing device
    
    Fixes crashes in gst_alsa_find_device_name() when probing or
    reading the device-name property (e.g. when doing a dot-file
    dump). Fixes #589797.

(Ignored the error handling issue here; not sure if this will ever be triggered, but even if I'm not sure if it's better to just leak the descriptor and reset the handle to NULL like alsasrc currently does, or to keep the handle open and return FALSE like alsasink does.)