![]() |
|
Occasional hang in al_detach_voice() when closing my application |
monacogp
Member #14,588
September 2012
|
Hi there! Please can somebody help me! Finished my game, but I just have this one bug that I can't seem to fix. When I quit my game, my code does the following: step 1 - Iterates through my list of sounds instances, stopping and destroying them. Very occasionally my code hangs in al_detach_voice(). I'd say it happens about once every 30 game runs. Seems to happen more when running a Release build. Hardly ever happens when running a debug build. Even though I was pretty sure I was detaching things in the correct order, I decided to see what happened if I detached the mixer before the voice. Running a debug build I must have started and stopped my application about 50 times, until eventually I got it to hang. I have attached the stack trace below. Unfortunately, I don't have stack trace of when I was detaching the voice before the mixer (but hopefully you can see from the stack trace attached, the first thing al_detach_mixer() does if the voice is not detached, is call al_detach_voice()): ntdll.dll!_KiFastSystemCallRet@0() I'm a bit concerned as the bug sounds exactly like this one entitled "(A5) random crash on al_detach_voice()" which doesn't look as if it was ever resolved: Hope someone can help, many thanks if you read this far! Ben |
thebignic
Member #14,419
July 2012
|
Are you running this on Windows XP? I only had my issue on XP. Never had it on Win 7 or iOS.
|
monacogp
Member #14,588
September 2012
|
Hi! I've seen it hang On WinXP and Vista. I have a mate who's running my game on window 7 and he hasn't seen the hang yet.. |
Peter Wang
Member #23
April 2000
|
It's most likely a bug in Allegro. Can you make a small test case to reproduce the issue? 1#include <allegro5/allegro.h>
2#include <allegro5/allegro_audio.h>
3#include <allegro5/allegro_native_dialog.h>
4#include <stdio.h>
5
6int main(void)
7{
8 ALLEGRO_TEXTLOG *log;
9 int i;
10
11 al_init();
12 log = al_open_native_text_log("stress test", ALLEGRO_TEXTLOG_NO_CLOSE);
13 for (i = 0; ; i++) {
14 al_install_audio();
15 al_reserve_samples(16);
16// al_rest(0.001);
17 al_uninstall_audio();
18 al_append_native_text_log(log, "%d\n", i);
19 }
20 return 0;
21}
Also, I added quite a few logging statements to the DirectSound driver on the 5.1 branch just now. If you can, build with Allegro in debug mode and post the allegro.log file when you get a crash.
|
monacogp
Member #14,588
September 2012
|
Sure thing, I'd be happy to give that a try :O) But please forgive me, but I'm having trouble working out how to build allegro :O( You said you'd made some recent changes to the 5.1 branch. Where can I get those? I found a link to some 5.1.3 unstable sources (here http://sourceforge.net/projects/alleg/files/allegro-unstable/), so I decided a good place to start would be to see if I could build these first. I read the README_msvc.txt, I'm building with MSVC 2008, I've got the Microsoft SDKs v6.0A and v7.0A installed, I have the DirectX SDK (June 2010) installed. I went to my c:\allergo_src\build directory and typed "cmake-gui ..", chose to do a vc9.0 (2008) build, clicked configure and got lots of warnings:- Do I need to sort out all of these warnings to in order to build allegro? Am I on the right track?? I feel a bit stupid :OP Many thanks, Ben |
Thomas Fjellstrom
Member #476
June 2000
![]() |
monacogp said: You said you'd made some recent changes to the 5.1 branch. Where can I get those? You'll want to check out the files from the version control repo: http://www.liballeg.org/git.html Quote: Do I need to sort out all of these warnings to in order to build allegro? Am I on the right track?? I feel a bit stupid :OP You only need to care about those warnings if you want to use the addons that caused those warnings. -- |
monacogp
Member #14,588
September 2012
|
Hi there! Thanks for the help, I managed to run Peter's test using the 5.1 source I git from http://www.liballeg.org/git.html :O) First I built the 5.1 sources and test code in Debug mode, I let the test run for about 15mins, it did about 50000 iterations of the for loop. The logfile grew to about 200MB, but it didn't crash/hang so I stopped it. I then decided to build the 5.1 sources and test code Release mode (just wanted to see if I could get it to crash/hang using the 5.1 sources). Could only figure out how to build allegro in RelWithDebInfo DLLs so I used those. Left the test running for 15mins, but it still didn't crash/hang within that time so I stopped it. I then decided to build the test code with my 5.0.7 Debug sources (pre-built ones I downloaded a while ago). Left the test for 15mins, no crash/hang within that time. I then decided to build the test code with my 5.0.7 Release sources. It hung immediately in al_unistall_audio(). But I noticed if I commented in the "al_rest(0.001)" line it would run fine. One thing that is probably not worth mentioning, when using the 5.1 sources, if I clicked on any minimized window on my task bar while running the test, it trigged the assert call stack below. After I read what was in the call stack, I just made sure I didn't click on anything during subsequent test runs. msvcr90d.dll!_NMSG_WRITE(int rterrnum=10) Line 198 C |
Peter Wang
Member #23
April 2000
|
monacogp said: But I noticed if I commented in the "al_rest(0.001)" line it would run fine. Yes, there was a bug in the DirectSound driver. Fixed only on the 5.1 branch so far. I only tested in wine so thanks for testing it. I'll see about the other bug, if I remember.
|
monacogp
Member #14,588
September 2012
|
Much appreciated, thanks Peter |
Peter Wang
Member #23
April 2000
|
The assertion failure is probably because al_install_audio failed, but the test program continues anyway. I don't know why it would fail.
|
|