[openal] OpenAL fails with OSS on FreeBSD

Yuri yuri at rawbw.com
Thu Dec 1 12:35:43 EST 2016

On 12/01/2016 04:04, Chris Robinson wrote:
> Hmm, this is a bit odd. The only reason it should fail to open an OSS 
> device without an (EE) error being printed is if the provided device 
> name isn't recognized. "OSS Default" should certainly be recognized. 
> Otherwise, if no name is specified (indicating the default device) or 
> a recognized name is given, it can only fail if open() fails, and in 
> that case it should print something like
> AL lib: (EE) ALCplaybackOSS_open: Could not open /dev/dsp: No such 
> file or directory
> which I don't see here. Are you sure the correct name is being passed 
> into alcOpenDevice? What if you pass in NULL instead?

Looking into it in the debugger.

In alcOpenDevice: deviceName is passed as "OSS Default", but it gets 
overwritten within this line:

 >        device->Backend = V(factory,createBackend)(device, 

At the moment of overwrite, the stack is:

(gdb) bt
#0  0x000000080a64ba54 in memset () from /lib/libc.so.7
#1  0x0000000801d499ed in ALCossBackendFactory_createBackend 
(UNUSED_self=0x801f7d318 <ALCossBackendFactory_getFactory.factory>, 
device=0x8229b6000, type=ALCbackend_Playbac
k) at 
#2  0x0000000801d490fb in 
ALCossBackendFactory_ALCbackendFactory_createBackend (obj=0x801f7d318 
<ALCossBackendFactory_getFactory.factory>, a=0x8229b6000, b=ALCbackend_Playb
ack) at 
#3  0x0000000801d1e8c7 in alcOpenDevice (deviceName=0x8221ff3d8 "") at 

Debugger shows the memory is overwritten in 
ALCossBackendFactory_createBackend bu a memset inside this line:

 > NEW_OBJ(backend, ALCplaybackOSS)(device);

it is called from here


which is called from here:

 >        device->Backend = V(factory,createBackend)(device, 

So this looks like a memory corruption case.


More information about the openal mailing list