[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,
ALCbackend_Playback);
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
/usr/ports/audio/openal-soft/work/openal-soft-1.17.2/Alc/backends/oss.c:807
#2 0x0000000801d490fb in
ALCossBackendFactory_ALCbackendFactory_createBackend (obj=0x801f7d318
<ALCossBackendFactory_getFactory.factory>, a=0x8229b6000, b=ALCbackend_Playb
ack) at
/usr/ports/audio/openal-soft/work/openal-soft-1.17.2/Alc/backends/oss.c:738
#3 0x0000000801d1e8c7 in alcOpenDevice (deviceName=0x8221ff3d8 "") at
/usr/ports/audio/openal-soft/work/openal-soft-1.17.2/Alc/ALc.c:3380
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
> DEFINE_ALCBACKENDFACTORY_VTABLE(ALCossBackendFactory);
which is called from here:
> device->Backend = V(factory,createBackend)(device,
ALCbackend_Playback);
So this looks like a memory corruption case.
Yuri
More information about the openal
mailing list