After playing an ogg audio file (or video with audio) (through oss) a segfauilt occurs

RESOLVED FIXED

Status

()

Core
Audio/Video
RESOLVED FIXED
8 years ago
7 years ago

People

(Reporter: Cliff Wright, Assigned: Cliff Wright)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

8 years ago
User-Agent:       Mozilla/5.0 (X11; U; NetBSD i386; en-US; rv:1.9.2.3) Gecko/20100412 Firefox/3.6.3
Build Identifier: Mozilla/5.0 (X11; U; NetBSD i386; en-US; rv:1.9.2.3) Gecko/20100412

Bug tracked to a stream object being freed while in use.
File mozilla-1.9.2/media/libsydneyaudio/src/sydney_audio_oss.c
Also since the thread that is writing to the audio device is not waited for with a join the _POSIX_THREAD_THREADS_MAX is counted against on NetBSD.
In sa_stream_destroy, the steam object can be freed before the request to stop is serviced. The patch I used to fix this is :
--- sydney_audio_oss.c.sav      2010-04-12 13:21:06.000000000 -0700
+++ sydney_audio_oss.c  2010-04-28 14:40:04.000000000 -0700
@@ -258,6 +258,7 @@
 int
 sa_stream_destroy(sa_stream_t *s) {
   int result = SA_SUCCESS;
+  pthread_t thread_id_sav = s->thread_id;
 
   if (s == NULL) {
     return SA_SUCCESS;
@@ -281,6 +282,9 @@
 
   pthread_mutex_unlock(&s->mutex);
 
+  /* wait for thread to stop */
+  pthread_join(thread_id_sav, NULL);
+
   /*
    * Release resources.
    */

Reproducible: Always

Steps to Reproduce:
1.URL to firefox 3.6.3 file:///audiosample.ogg
2.
3.
Created attachment 442224 [details] [diff] [review]
patch v0

Thanks, the patch looks good.  I've reformatted it a little and updated the update.sh/README_MOZILLA files in the attached patch.
Attachment #442224 - Flags: review?(chris.double)
Assignee: nobody → cliff
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

Updated

8 years ago
Attachment #442224 - Flags: review?(chris.double) → review+
Keywords: checkin-needed
Whiteboard: [needs landing]
http://hg.mozilla.org/mozilla-central/rev/c34e4f1eb78a
Status: ASSIGNED → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
Keywords: checkin-needed
Whiteboard: [needs landing]
Duplicate of this bug: 605861
You need to log in before you can comment on or make changes to this bug.