Debian Bug report logs -
#406754
portaudio19: FTBFS: #error Memory barriers are not defined on this system.
Reported by: Kurt Roeckx <kurt@roeckx.be>
Date: Sat, 13 Jan 2007 18:03:02 UTC
Severity: serious
Found in version 19+svn20070113-1
Fixed in version portaudio19/19+svn20070125-1
Done: Mikael Magnusson <mikma@users.sourceforge.net>
Bug is archived. No further changes may be made.
Forwarded to portaudio@techweb.rfa.org
Toggle useless messages
Report forwarded to debian-bugs-dist@lists.debian.org, Debian VoIP Team <pkg-voip-maintainers@lists.alioth.debian.org>:
Bug#406754; Package portaudio19.
(full text, mbox, link).
Acknowledgement sent to Kurt Roeckx <kurt@roeckx.be>:
New Bug report received and forwarded. Copy sent to Debian VoIP Team <pkg-voip-maintainers@lists.alioth.debian.org>.
(full text, mbox, link).
Message #5 received at submit@bugs.debian.org (full text, mbox, reply):
Package: portaudio19
Version: 19+svn20070113-1
Severity: serious
Hi,
Your package is failing to build on most arches with the following
error:
src/common/pa_ringbuffer.c:100:11: error: #error Memory barriers are not define d on this system. You can still compile by defining ALLOW_SMP_DANGERS, but SMP safety will not be guaranteed.
Kurt
Information forwarded to debian-bugs-dist@lists.debian.org, Debian VoIP Team <pkg-voip-maintainers@lists.alioth.debian.org>:
Bug#406754; Package portaudio19.
(full text, mbox, link).
Acknowledgement sent to Mikael Magnusson <mikma264@gmail.com>:
Extra info received and forwarded to list. Copy sent to Debian VoIP Team <pkg-voip-maintainers@lists.alioth.debian.org>.
(full text, mbox, link).
Message #10 received at 406754@bugs.debian.org (full text, mbox, reply):
Bjorn Roche wrote:
> Now, it should work on Linux x86, Linux PPC, Mac OS X
> and FreeBSD. On other systems (I don't know what else uses these
> ring-buffers, other than Jack/Linux and CoreAudio) it should fail to
> compile, but give the user enough info to compile without SMP safety if
> they want (by defining ALLOW_SMP_DANGERS, which should probably have a
> better name).
>
> Any feedback before I commit (especially from someone familiar with
> x86)?
What about other architectures? The Debian portaudio19 package I'm
maintaining together with the Debian VoIP team fails to build on most
architectures. (Reported in Debian BTS #406754[1])
error:
src/common/pa_ringbuffer.c:100:11: error: #error Memory barriers are not
define d on this system. You can still compile by defining
ALLOW_SMP_DANGERS, but SMP safety will not be guaranteed.
PortAudio V19 used to build on all architectures: alpha, amd64, arm,
hppa ,i386, ia64, m68k, mips, mipsel, powerpc, s390 and sparc.
Any solution?
Please, keep CC to 406754-forwarded@bugs.debian.org in replies.
Mikael
[1]http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=406754
Reply sent to Mikael Magnusson <mikma264@gmail.com>:
You have marked Bug as forwarded.
(full text, mbox, link).
Information forwarded to debian-bugs-dist@lists.debian.org, Debian VoIP Team <pkg-voip-maintainers@lists.alioth.debian.org>:
Bug#406754; Package portaudio19.
(full text, mbox, link).
Acknowledgement sent to Bjorn Roche <bjorn@xowave.com>:
Extra info received and forwarded to list. Copy sent to Debian VoIP Team <pkg-voip-maintainers@lists.alioth.debian.org>.
(full text, mbox, link).
Message #18 received at 406754@bugs.debian.org (full text, mbox, reply):
On Jan 13, 2007, at 4:15 PM, Mikael Magnusson wrote:
> Bjorn Roche wrote:
>
>> Now, it should work on Linux x86, Linux PPC, Mac OS X and FreeBSD.
>> On other systems (I don't know what else uses these ring-buffers,
>> other than Jack/Linux and CoreAudio) it should fail to compile,
>> but give the user enough info to compile without SMP safety if
>> they want (by defining ALLOW_SMP_DANGERS, which should probably
>> have a better name).
>> Any feedback before I commit (especially from someone familiar
>> with x86)?
>
> What about other architectures? The Debian portaudio19 package I'm
> maintaining together with the Debian VoIP team fails to build on
> most architectures. (Reported in Debian BTS #406754[1])
>
> error:
> src/common/pa_ringbuffer.c:100:11: error: #error Memory barriers
> are not define d on this system. You can still compile by defining
> ALLOW_SMP_DANGERS, but SMP safety will not be guaranteed.
>
> PortAudio V19 used to build on all architectures: alpha, amd64,
> arm, hppa ,i386, ia64, m68k, mips, mipsel, powerpc, s390 and sparc.
>
> Any solution?
>
As the error message says, you can compile by defining
ALLOW_SMP_DANGERS (-DALLOW_SMP_DANGERS). This will not cause problems
for single processor machines, but could cause problems on SMP (same
as with the old code). Alternatively, if you could tell us what the
appropriate memory barriers are (or if none are needed) for the
platform and a way to detect it using #defines, I'll fix it.
bjorn
-----------------------------
Bjorn Roche
XO Wave
Digital Audio Production and Post-Production Software
http://www.xowave.com
http://blog.bjornroche.com
http://myspace.com/xowave
Message #20 received at 406754-forwarded@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
Bjorn Roche wrote:
>
>
> As the error message says, you can compile by defining ALLOW_SMP_DANGERS
> (-DALLOW_SMP_DANGERS). This will not cause problems for single processor
> machines, but could cause problems on SMP (same as with the old code).
> Alternatively, if you could tell us what the appropriate memory barriers
> are (or if none are needed) for the platform and a way to detect it
> using #defines, I'll fix it.
>
> bjorn
>
My proposition is to conditional compile the ringbuffer, and I'm
including a patch.
Btw, according to Linux journal[1] the x86 memory barriers should be
usable on AMD64:
Although it is possible in theory to create a parallel program that
works on some x86 CPUs but fails on AMD64 due to this difference in
memory-consistency model, in practice this difference has little
effect on porting code from x86 to AMD64.
Mikael
[1]http://www.linuxjournal.com/article/8212
[pa_cond_ringbuffer.patch (text/x-diff, inline)]
Sun Jan 14 15:19:28 CET 2007 mikma@users.sourceforge.net
* pa_cond_ringbuffer
Conditional compile the ringbuffer only if jack or macapi is enabled.
diff -rN -u old-working/configure.in new-working/configure.in
--- old-working/configure.in 2007-01-14 15:29:20.000000000 +0100
+++ new-working/configure.in 2007-01-14 15:29:20.000000000 +0100
@@ -139,7 +139,7 @@
dnl Mac OS X configuration
AC_DEFINE(PA_USE_COREAUDIO)
- OTHER_OBJS="src/os/mac_osx/pa_mac_hostapis.o src/os/unix/pa_unix_util.o src/hostapi/coreaudio/pa_mac_core.o src/hostapi/coreaudio/pa_mac_core_utilities.o src/hostapi/coreaudio/pa_mac_core_blocking.o";
+ OTHER_OBJS="src/os/mac_osx/pa_mac_hostapis.o src/os/unix/pa_unix_util.o src/hostapi/coreaudio/pa_mac_core.o src/hostapi/coreaudio/pa_mac_core_utilities.o src/hostapi/coreaudio/pa_mac_core_blocking.o src/common/pa_ringbuffer.o";
LIBS="-framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon";
PADLL="libportaudio.dylib";
SHARED_FLAGS="-framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon -dynamiclib";
@@ -274,7 +274,7 @@
if [[ $have_jack = "yes" ] && [ $with_jack != "no" ]] ; then
DLL_LIBS="$DLL_LIBS $JACK_LIBS"
CFLAGS="$CFLAGS $JACK_CFLAGS"
- OTHER_OBJS="$OTHER_OBJS src/hostapi/jack/pa_jack.o"
+ OTHER_OBJS="$OTHER_OBJS src/hostapi/jack/pa_jack.o src/common/pa_ringbuffer.o"
AC_DEFINE(PA_USE_JACK)
fi
diff -rN -u old-working/Makefile.darwin new-working/Makefile.darwin
--- old-working/Makefile.darwin 2007-01-14 15:29:20.000000000 +0100
+++ new-working/Makefile.darwin 2007-01-14 15:29:20.000000000 +0100
@@ -38,7 +38,7 @@
LT_AGE=0
-OTHER_OBJS = src/os/mac_osx/pa_mac_hostapis.o src/os/unix/pa_unix_util.o src/hostapi/coreaudio/pa_mac_core.o src/hostapi/coreaudio/pa_mac_core_utilities.o src/hostapi/coreaudio/pa_mac_core_blocking.o
+OTHER_OBJS = src/os/mac_osx/pa_mac_hostapis.o src/os/unix/pa_unix_util.o src/hostapi/coreaudio/pa_mac_core.o src/hostapi/coreaudio/pa_mac_core_utilities.o src/hostapi/coreaudio/pa_mac_core_blocking.o src/common/pa_ringbuffer.o
PALIB = libportaudio.a
PADLL = libportaudio
diff -rN -u old-working/Makefile.in new-working/Makefile.in
--- old-working/Makefile.in 2007-01-14 15:29:20.000000000 +0100
+++ new-working/Makefile.in 2007-01-14 15:29:20.000000000 +0100
@@ -51,7 +51,6 @@
src/common/pa_debugprint.o \
src/common/pa_front.o \
src/common/pa_process.o \
- src/common/pa_ringbuffer.o \
src/common/pa_skeleton.o \
src/common/pa_stream.o \
src/common/pa_trace.o
Information forwarded to debian-bugs-dist@lists.debian.org, Debian VoIP Team <pkg-voip-maintainers@lists.alioth.debian.org>:
Bug#406754; Package portaudio19.
(full text, mbox, link).
Acknowledgement sent to Falk Hueffner <falk@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian VoIP Team <pkg-voip-maintainers@lists.alioth.debian.org>.
(full text, mbox, link).
Message #25 received at 406754@bugs.debian.org (full text, mbox, reply):
Hi,
the correct solution is to use __sync_synchronize as fallback, which
is a full memory barrier defined by gcc (starting from 4.1) for all
platforms. It is also desirable to use this on all platforms that
don't differentiate read/write/full barriers, since it gives the
compiler better opportunities to optimize.
--
Falk
Information forwarded to debian-bugs-dist@lists.debian.org, Debian VoIP Team <pkg-voip-maintainers@lists.alioth.debian.org>:
Bug#406754; Package portaudio19.
(full text, mbox, link).
Acknowledgement sent to Mikael Magnusson <mikma@users.sourceforge.net>:
Extra info received and forwarded to list. Copy sent to Debian VoIP Team <pkg-voip-maintainers@lists.alioth.debian.org>.
(full text, mbox, link).
Message #30 received at 406754@bugs.debian.org (full text, mbox, reply):
Falk Hueffner wrote:
> Hi,
>
> the correct solution is to use __sync_synchronize as fallback, which
> is a full memory barrier defined by gcc (starting from 4.1) for all
> platforms. It is also desirable to use this on all platforms that
> don't differentiate read/write/full barriers, since it gives the
> compiler better opportunities to optimize.
>
Do you have a patch? I tried to use __sync_synchronize on i386, but it
doesn't generate any synchronization code in the assembler output.
Mikael
--- old-working/src/common/pa_ringbuffer.c 2007-01-29
11:27:55.000000000 +0100
+++ new-working/src/common/pa_ringbuffer.c 2007-01-29
11:27:55.000000000 +0100
@@ -86,9 +86,9 @@
# define PaUtil_ReadMemoryBarrier() asm volatile("sync":::"memory")
# define PaUtil_WriteMemoryBarrier() asm volatile("sync":::"memory")
# elif defined( __i386__ ) || defined( __i486__ ) || defined(
__i586__ ) || defined( __i686__ )
-# define PaUtil_FullMemoryBarrier() asm volatile("mfence":::"memory")
-# define PaUtil_ReadMemoryBarrier() asm volatile("lfence":::"memory")
-# define PaUtil_WriteMemoryBarrier() asm volatile("sfence":::"memory")
+# define PaUtil_FullMemoryBarrier() __sync_synchronize
+# define PaUtil_ReadMemoryBarrier() __sync_synchronize
+# define PaUtil_WriteMemoryBarrier() __sync_synchronize
# else
# ifdef ALLOW_SMP_DANGERS
# warning Memory barriers not defined on this system or system
unknown
Information forwarded to debian-bugs-dist@lists.debian.org, Debian VoIP Team <pkg-voip-maintainers@lists.alioth.debian.org>:
Bug#406754; Package portaudio19.
(full text, mbox, link).
Acknowledgement sent to Falk Hueffner <falk@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian VoIP Team <pkg-voip-maintainers@lists.alioth.debian.org>.
(full text, mbox, link).
Message #35 received at 406754@bugs.debian.org (full text, mbox, reply):
Mikael Magnusson <mikma@users.sourceforge.net> writes:
> Falk Hueffner wrote:
>> Hi,
>> the correct solution is to use __sync_synchronize as fallback, which
>> is a full memory barrier defined by gcc (starting from 4.1) for all
>> platforms. It is also desirable to use this on all platforms that
>> don't differentiate read/write/full barriers, since it gives the
>> compiler better opportunities to optimize.
>>
>
> Do you have a patch? I tried to use __sync_synchronize on i386, but it
> doesn't generate any synchronization code in the assembler output.
Sorry, you need __sync_synchronize(). (Does __sync_synchronize on its
own not generate a warning?)
--
Falk
Information forwarded to debian-bugs-dist@lists.debian.org, Debian VoIP Team <pkg-voip-maintainers@lists.alioth.debian.org>:
Bug#406754; Package portaudio19.
(full text, mbox, link).
Acknowledgement sent to Mikael Magnusson <mikma@users.sourceforge.net>:
Extra info received and forwarded to list. Copy sent to Debian VoIP Team <pkg-voip-maintainers@lists.alioth.debian.org>.
(full text, mbox, link).
Message #40 received at 406754@bugs.debian.org (full text, mbox, reply):
Falk Hueffner wrote:
> Mikael Magnusson <mikma@users.sourceforge.net> writes:
>
>> Falk Hueffner wrote:
>>> Hi,
>>> the correct solution is to use __sync_synchronize as fallback, which
>>> is a full memory barrier defined by gcc (starting from 4.1) for all
>>> platforms. It is also desirable to use this on all platforms that
>>> don't differentiate read/write/full barriers, since it gives the
>>> compiler better opportunities to optimize.
>>>
>> Do you have a patch? I tried to use __sync_synchronize on i386, but it
>> doesn't generate any synchronization code in the assembler output.
>
> Sorry, you need __sync_synchronize(). (Does __sync_synchronize on its
> own not generate a warning?)
>
According to [1]
"gcc does not implement __sync_synchronize() as a full memory barrier on
X86, in spite of the documentation."
Do you know what architecture __sync_synchronize() is implemented as a
full memory barrier?
PortAudio implements native memory barriers for i386 and powerpc. We can
use __sync_synchronize() for other architectures if it's implemented as
a full memory barrier on those. Otherwise we need to disable JACK on
those architectures (already committed to SVN).
Mikael
[1]http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2047.html
Tags added: pending
Request was from Mark Purcell <msp@debian.org>
to control@bugs.debian.org.
(Sun, 25 Mar 2007 16:06:10 GMT) (full text, mbox, link).
Reply sent to Mikael Magnusson <mikma@users.sourceforge.net>:
You have taken responsibility.
(full text, mbox, link).
Notification sent to Kurt Roeckx <kurt@roeckx.be>:
Bug acknowledged by developer.
(full text, mbox, link).
Message #47 received at 406754-close@bugs.debian.org (full text, mbox, reply):
Source: portaudio19
Source-Version: 19+svn20070125-1
We believe that the bug you reported is fixed in the latest version of
portaudio19, which is due to be installed in the Debian FTP archive:
libportaudio2_19+svn20070125-1_i386.deb
to pool/main/p/portaudio19/libportaudio2_19+svn20070125-1_i386.deb
libportaudiocpp0_19+svn20070125-1_i386.deb
to pool/main/p/portaudio19/libportaudiocpp0_19+svn20070125-1_i386.deb
portaudio19-dev_19+svn20070125-1_i386.deb
to pool/main/p/portaudio19/portaudio19-dev_19+svn20070125-1_i386.deb
portaudio19-doc_19+svn20070125-1_all.deb
to pool/main/p/portaudio19/portaudio19-doc_19+svn20070125-1_all.deb
portaudio19_19+svn20070125-1.diff.gz
to pool/main/p/portaudio19/portaudio19_19+svn20070125-1.diff.gz
portaudio19_19+svn20070125-1.dsc
to pool/main/p/portaudio19/portaudio19_19+svn20070125-1.dsc
portaudio19_19+svn20070125.orig.tar.gz
to pool/main/p/portaudio19/portaudio19_19+svn20070125.orig.tar.gz
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 406754@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Mikael Magnusson <mikma@users.sourceforge.net> (supplier of updated portaudio19 package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.7
Date: Sun, 25 Mar 2007 17:04:32 +0100
Source: portaudio19
Binary: libportaudiocpp0 libportaudio2 portaudio19-doc portaudio19-dev
Architecture: source i386 all
Version: 19+svn20070125-1
Distribution: unstable
Urgency: low
Maintainer: Debian VoIP Team <pkg-voip-maintainers@lists.alioth.debian.org>
Changed-By: Mikael Magnusson <mikma@users.sourceforge.net>
Description:
libportaudio2 - Portable audio I/O - shared library
libportaudiocpp0 - Portable audio I/O C++ bindings - shared library
portaudio19-dev - Portable audio I/O - development files
portaudio19-doc - Portable audio I/O - documentation
Closes: 406754
Changes:
portaudio19 (19+svn20070125-1) unstable; urgency=low
.
[ Mikael Magnusson ]
* Update to svn 20070125 (r1174)
* Disable JACK and ringbuffer on all architectures except i386 and
powerpc. (Closes: #406754: FTBFS: #error Memory barriers are not
defined on this system)
Files:
427552df892457098852a94ab4acc658 1059 sound optional portaudio19_19+svn20070125-1.dsc
928d9325fb1f22a553a0e31805e1d581 1090591 sound optional portaudio19_19+svn20070125.orig.tar.gz
638c463c60d13421994a00e231c12a04 5653 sound optional portaudio19_19+svn20070125-1.diff.gz
4d65973d4d8d62a8be7888546f0c0a28 524706 doc optional portaudio19-doc_19+svn20070125-1_all.deb
eb6e14afbe0a074b198ffbab0033de71 63540 libs optional libportaudio2_19+svn20070125-1_i386.deb
d88d58ad8c5f20a5fb5393aabfaa1f21 114792 devel optional portaudio19-dev_19+svn20070125-1_i386.deb
b2a34f7d4dc3ec59bf117fa705a89e09 21902 libs optional libportaudiocpp0_19+svn20070125-1_i386.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFGBp34oCzanz0IthIRAoRiAJ43RpkzQMo8nvkluPrrHQzvhIgSbACfcaQv
xEmF7ttOl0alAQ7rr84DcqU=
=vt/x
-----END PGP SIGNATURE-----
Bug archived.
Request was from Debbugs Internal Request <owner@bugs.debian.org>
to internal_control@bugs.debian.org.
(Mon, 25 Jun 2007 22:28:45 GMT) (full text, mbox, link).
Send a report that this bug log contains spam.
Debian bug tracking system administrator <owner@bugs.debian.org>.
Last modified:
Fri Jan 5 14:47:58 2018;
Machine Name:
beach
Debian Bug tracking system
Debbugs is free software and licensed under the terms of the GNU
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.
Copyright © 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson,
2005-2017 Don Armstrong, and many other contributors.