[gst-devel] [PATCH] SMP race condition in gstatomic.h

David I. Lehn dlehn at vt.edu
Thu Sep 5 09:04:04 CEST 2002

* Cameron Hutchison <camh+gst at xdna.net> [20020905 04:09]:
> I've been banging my head against a bug in gstreamer for the last few
> days (bug #92261). This bug can be triggered by the command:
> $ gst-launch sinesrc ! { queue ! fakesink }
> After a random number of iterations an assertion is violated when trying
> to unref a buffer.
> The problem is that the SWAP functions/macros in gstatomic.h are not
> being compiled for SMP. That header uses the __SMP__ conditional macro,
> but nothing sets that macro.
> Following the method used in <asm/atomic.h>, I've changed __SMP__ to
> CONFIG_SMP (defined in <linux/config.h>). This fixes the problem
> ("lock ;" now gets included in the asm code).

Good catch.  However, I'm not sure CONFIG_SMP is portable enough between
*BSDs and Linux and Hurd and win32 and whatever else this code might run
on.  Perhaps we need a configure check of some sort that we can force
things to build for SMP.


More information about the gstreamer-devel mailing list