Re: [LAU] Simple, easy multithreaded circular buffer library for Linux?

From: Ken Restivo <ken@email-addr-hidden>
Date: Mon Oct 20 2008 - 21:47:38 EEST

On Mon, Oct 20, 2008 at 04:02:49PM +0200, Olivier Guilyardi wrote:
> Ken Restivo wrote:
>
> > Program received signal SIGSEGV, Segmentation fault.
> > [Switching to Thread 1082132816 (LWP 17164)]
> > 0xffffffffff600808 in ?? ()
> >
> > (gdb) bt
> > #0 0xffffffffff600808 in ?? ()
> > #1 0x00002b53c56aa7f0 in sched_getcpu () from /lib/libc.so.6
> > #2 0x0000000000400941 in reader_start (arg=0x0) at test-int-array.c:50
> > #3 0x00002b53c53cd3f7 in start_thread () from /lib/libpthread.so.0
> > #4 0x00002b53c56b993d in clone () from /lib/libc.so.6
> >
> > (gdb) f 1
> > #1 0x00002b53c56aa7f0 in sched_getcpu () from /lib/libc.so.6
> >
> > (gdb) f 2
> > #2 0x0000000000400941 in reader_start (arg=0x0) at test-int-array.c:50
> > 50 printf("reader started on cpu %d\n", sched_getcpu());
> >
> >
> > (gdb) i thr
> > 4 Thread 1090525520 (LWP 17165) 0x00002b53c56b9901 in clone () from /lib/libc.so.6
> > 3 Thread 47638797092576 (LWP 17156) 0x00002b53c56b9901 in clone () from /lib/libc.so.6
> > * 2 Thread 1082132816 (LWP 17164) 0xffffffffff600808 in ?? ()
> > 1 LWP 17156 0x00002b53c56b9901 in clone () from /lib/libc.so.6
>
> Okay, sched_getcpu() is causing a lot of trouble (not always available,
> segfault'ing, ...). It's gone.
>
> Please update to r310.

Ah, indeed, now we are getting somewhere:

$ svn update
make test-int-array.c
U portaudio/pa_ringbuffer.c
A fons_lfq
eA fons_lfq/ringbuffer.h
; maA fons_lfq/ringbuffer.cpp
A test-bit-circle.c
U Makefile
A run-tests.sh
D alltests.sh
Updated to revision 314.

$ make; make test
cc -Wall -I. -lpthread -I./jack -o test-int-array-jack \
                test-int-array.c jack/ringbuffer.c
cc -Wall -I. -lpthread -I./portaudio -o test-int-array-portaudio \
                test-int-array.c portaudio/ringbuffer.c portaudio/pa_ringbuffer.c
cc -Wall -I. -lpthread -I./portaudio -o test-int-array-portaudio-nobarrier \
                -DNO_MEMORY_BARRIER \
                test-int-array.c portaudio/ringbuffer.c portaudio/pa_ringbuffer.c
portaudio/pa_ringbuffer.c:127:2: warning: #warning Memory barriers deactivated as requested
cc -Wall -I. -lpthread -I./jack -o test-int-array-jack-fix1 \
                test-int-array.c jack/ringbuffer-fix1.c
c++ -Wall -I. -lpthread -I./fons_lfq -o test-int-array-lfq \
                test-int-array.c fons_lfq/ringbuffer.cpp
cc -Wall -I. -lpthread -I./jack -o test-bit-circle-jack \
                test-bit-circle.c jack/ringbuffer.c
cc -Wall -I. -lpthread -I./portaudio -o test-bit-circle-portaudio \
                test-bit-circle.c portaudio/ringbuffer.c portaudio/pa_ringbuffer.c
cc -Wall -I. -lpthread -I./portaudio -o test-bit-circle-portaudio-nobarrier \
                -DNO_MEMORY_BARRIER \
                test-bit-circle.c portaudio/ringbuffer.c portaudio/pa_ringbuffer.c
portaudio/pa_ringbuffer.c:127:2: warning: #warning Memory barriers deactivated as requested
cc -Wall -I. -lpthread -I./jack -o test-bit-circle-jack-fix1 \
                test-bit-circle.c jack/ringbuffer-fix1.c
c++ -Wall -I. -lpthread -I./fons_lfq -o test-bit-circle-lfq \
                test-bit-circle.c fons_lfq/ringbuffer.cpp
./run-tests.sh bit-circle 512 jack jack-fix1 portaudio portaudio-nobarrier lfq

test-bit-circle-jack - starting (5s max) - buffer size: 512
||- FAILURE: 2 != 514

test-bit-circle-jack-fix1 - starting (5s max) - buffer size: 512
||- FAILURE: 2 != 514

test-bit-circle-portaudio - starting (5s max) - buffer size: 512
||||||||||||||||---------- SUCCESS

test-bit-circle-portaudio-nobarrier - starting (5s max) - buffer size: 512
||||-|||||-|||||||----- SUCCESS

test-bit-circle-lfq - starting (5s max) - buffer size: 512
||||||||||||||||------------- SUCCESS

./run-tests.sh int-array 16 jack jack-fix1 portaudio portaudio-nobarrier lfq

test-int-array-jack - starting (20s max) - array/buffer size: 8/16
[reader started] [writer started] [flowing] 49104 != 49100 at offset 0
FAILURE in chunk 24552

test-int-array-jack-fix1 - starting (20s max) - array/buffer size: 8/16
[reader started] [writer started] [flowing]
SUCCESS

test-int-array-portaudio - starting (20s max) - array/buffer size: 8/16
[reader started] [writer started] [flowing]

SUCCESS

test-int-array-portaudio-nobarrier - starting (20s max) - array/buffer size: 8/16
[reader started] [writer started] [flowing] SUCCESS

test-int-array-lfq - starting (20s max) - array/buffer size: 8/16
[reader started] [writer started] [flowing] SUCCESS

-ken
_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@email-addr-hidden
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-user
Received on Tue Oct 21 00:15:04 2008

This archive was generated by hypermail 2.1.8 : Tue Oct 21 2008 - 00:15:04 EEST