SIGSEGV using arts for audio output (backtrace included)

linux(i686) 2.6.4
gcc version 3.3.3
sdl 1.2.7
kde 3.2.1 compiled from source
glibc-2.3.1

SDL is using arts output under kde if artsd is running (and when apps such as
xmms are running using arts also).

When calling SDL_CloseAudio() , there is a SIGSEGV (the bug) and a deadlock

pthread_getconcurrency() <<<< deadlock here…??
pthread_getconcurrency()
sem_timedwait()
pthread_mutex_lock()
free()
SDL_WaitThread()
SDL_AudioQuit()
SDL_QuitSubSystem()
SDL_Quit()
SDL_Parachute()
mallopt() (libc.so.6) <<<<< SIGSEGV here
__pthread_clock_settime()
__libc_sigaction()
free()
delete
delete[]
Arts::ByteDataPacket::~ByteDataPacket()
Arts::AsyncStream::freePacket(Arts::GenericDataPacket*)
(libmcop.so.1)
Arts::AsyncPort::processedPacket(Arts::GenericDataPacket*)
Arts::AsyncNetSend::processed() (libartsflow.so.1)
_dispatch_Arts_FlowSystem_Sender_00()
[…]
Arts::SimpleSoundServer_stub::detach(Arts::ByteSoundProducer)
Sender::close()
arts_backend_close_stream()
arts_close_stream()
ARTSC_CloseAudio()

It’s looks like a bug into arts (the SIGSEGV part) but I’m not sure since
there is a Deadlock Part in SDL :slight_smile:

Perhaps SDL is using arts in a wrong way? (or why xmms won’t crash when
stoping/playing or reloading multiple times?)

I don’t know why arts make a sigsegv on closing one of its stream. xmms seems
to be ok with open/close multiple time…

if anyone as comment/answers

William.

Forget me, this was a nasty bug of mine

As the doc says :

AudioSpec.size is filled by driver with the buffer size that will be used, and
the AudioSpec.samples is NOT filled by driver in the ‘obtain’ AudioSpec
SDL_OpenAudio(&desired,&obtained) is called.

This may lead to an obtained Struct which is not consistent : samples !=
size/sample_size. My code was counting on .samples to give me the size for my
mixing buffer, it was wrong. I was trashing arbitrary memory if
samples<size/sample_size. Hence the strange bug/deadlocks/sigsegv.

My mistake.On Sunday 04 April 2004 00:56, William Petiot wrote:

SDL is using arts output under kde if artsd is running (and when apps such
as xmms are running using arts also).

When calling SDL_CloseAudio() , there is a SIGSEGV (the bug) and a deadlock