-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XAudio2 bit flips via voltage sag when using AVX256 instructions at the same as I destroy source voices? #20
Comments
I've since made several attempts to create a repro case, all of which have evaporated. I might just mark |
I have indeed marked |
Managed a repro, collected symbols, and really dug in. I believe my CPU is mis-executing instructions, possibly due to a voltage spike induced bit-flip from XAudio using fancy instructions in combination with other spikes in activity being put on the cores by process shutdown. XAudio2 Thread+ XAudio2_9.dll!OAPIPELINE::MatrixMixFromInt16DiagonalAvx(struct OAPIPELINE::SMatrixMixParameters const *) Unknown
XAudio2_9.dll!LEAPFX::CAudioSRC::Process(unsigned int,struct XAPO_PROCESS_BUFFER_PARAMETERS const *,unsigned int,struct XAPO_PROCESS_BUFFER_PARAMETERS *,int) Unknown
XAudio2_9.dll!LEAPCORE::CSWVoice::Process(unsigned int) Unknown
XAudio2_9.dll!LEAPCORE::CGraphManager::ProcessVoiceChains(unsigned int) Unknown
XAudio2_9.dll!LEAPCORE::CGraphManager::ProcessGraph(unsigned int) Unknown
XAudio2_9.dll!LEAPCORE::CGraphManager::GraphThreadProc(unsigned __int64) Unknown
XAudio2_9.dll!CThreadBase::StaticGraphThreadProc(void *) Unknown
kernel32.dll!BaseThreadInitThunk�() Unknown
ntdll.dll!RtlUserThreadStart�() Unknown
00007FFB5858A15E jmp OAPIPELINE::MatrixMixFromInt16DiagonalAvx+565h (07FFB5858A165h)
+00007FFB5858A160 vmovups ymm2,ymmword ptr [rbp]
00007FFB5858A165 movsx eax,word ptr [r8-14h]
00007FFB5858A16A mov dword ptr [rbp+0E0h],eax
00007FFB5858A170 movsx eax,word ptr [r8-12h]
00007FFB5858A175 mov dword ptr [rbp+0E4h],eax
The instruction is dereferencing RBP but that points at a wildly different address than the read address that's supposedly exploding. However, RDI matches exactly, and is one bit flip away from RBP in encoding: https://wiki.osdev.org/X86-64_Instruction_Encoding#Registers
Main ThreadThe main thread callstack shows the crash occurs while handling WM_CLOSE, well before destroying the IXAudio2 or trying to invoke atexit stuff / invoke ExitProcess. In fact, the main thread has only just begun to attempt to tear down the very first voice,
|
Managed a 3rd repro, exact same xaudio2+main thread callstacks. Also stepped all the way through to the same logic in a regular non-misexecuting execution of xaudio2 to verify I see this instruction stream - e.g. the disassembly is semi-trustworthy. Got a second machine out of cold storage and had it running through windows updates preparing to attempt a repro on it, only for it to die on me. Replacement power brick on the way in case that's all that bit the bullet. Clearly XAudio2 is cursed by gremlins. |
Bacterius wants to blame a silicon/microcode bug. Which I guess is also possible? The system in question is a ~4.5 years old heavily abused NUC that compiled a lot of stuff and is fed through a piddly little 120W power brick. |
Have I perhaps been mislead by trusting VS's debugger pointing out the vmovups a little too much? Probably! |
Unsound if XAudio2 threads outlive main?Had a once-off XAudio2 thread crash when tearing down my snake clone with a leaked IXAudio2 instance. Worth investigating.
The text was updated successfully, but these errors were encountered: