
[Audio] Crash in AudioContext::CreateContext on x64
Posted Friday, 17 July, 2009 - 18:33 by erluk| Project: | The Open Toolkit library |
| Version: | 0.9.9-1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
System: Vista 64bit
Soundcard: XFi Xtreme Music
Assembly target platform: both Any CPU and x64
Issue:
When calling Alc.GetInteger on line 349 in AudioContext.cs, there is an unhandled StackOverflowException. This can be reproduced by running any of the OpenAL examples from the example browser.


Comments
#11
I am sorry, the file I attached is a x86 binary. I've attached the correct one to this post.
However, there seems to be something very wrong with this binary. The openal-info program crashes with an invalid context error (this is the program that comes with OpenAL Soft). OpenTK also fails to load this binary, for some unknown reason. Finally, I can confirm the StackOverflowException on Alc.GetInteger, when using Creative's installer - openal-info works correctly, so I suspect an issue in OpenTK, possibly some form of stack corruption (a real stack overflow is simply not possible here).
Things suddenly became more interesting...
#12
Indeed, we are corrupting the stack. Quoting from the specs:
6.3.8 Integer Query
void alcGetIntegerv(ALCdevice * deviceHandle, ALCenum token, ALCsizei size,ALCint *dest);
[...]
The application has to specifythe size of the destination buffer provided (in ALCint values).
We are specifying the buffer size in bytes (4 times larger than the correct).
However, the problem remains even after fixing this. Investigating.
#13
Issue fixed in rev. 1980.
Indeed, this was an instance of stack corruption.
Alc.GetIntegerdidn't use the 'pin-buffer-and-pass-pointer' pattern used in the rest of OpenTK, causing issues when you called it like this:This code works correctly now.
I have also added an array overload for convenience:
#14
I can confirm the fix, thanks for the quick response.
#15
Closing bugs fixed in 0.9.8-2 and 0.9.9-1.
#16