Closed Bug 562488 Opened 14 years ago Closed 14 years ago

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

Categories

(Core :: Audio/Video, defect)

x86
NetBSD
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: cliff, Assigned: cliff)

References

Details

Attachments

(1 file)

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.
Attached patch patch v0Splinter Review
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
Attachment #442224 - Flags: review?(chris.double) → review+
Keywords: checkin-needed
Whiteboard: [needs landing]
http://hg.mozilla.org/mozilla-central/rev/c34e4f1eb78a
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Keywords: checkin-needed
Whiteboard: [needs landing]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: