Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SFML 2.1 Crashes somewhere in my Audio Function on Windows 7  (Read 4480 times)

0 Members and 1 Guest are viewing this topic.

Acumen

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
SFML 2.1 Crashes somewhere in my Audio Function on Windows 7
« on: October 10, 2013, 09:13:54 pm »
So I am just looking where to start on this one and to see if anyone else has the same issue. It is hard for me to debug as I no longer have access to the machine and was only running a release, but I did see it with my own eyes.

I could tell from my log file that my program crashed from something in my audio function, but only with a new version of my program created with SFML 2.1. I had an older version of my program from one of the 2.0 release candidates and was able to run that without crashing. I am 99% sure none of the code in the audio function changed, only the SFML version.

The interesting thing is that the new version ran just fine if I set it to Windows 7 compatibility mode, or any other version of Windows for that matter. This was on a 32 bit Windows 7 home premium machine, no I am not even sure why there is a Window 7 compatibility mode on it.. I was thinking it might have been from a conflict with installed openAL or libsnd dll's that were already on the machine, but I changed their names temporarily and had the same issue. Maybe that wasn't the right way to accomplish anything but it was the only thing I came up with at the time.

Anyway I have the dmp file and pdb so I should be able to track it down a bit more if nobody has any ideas, although I have no experience with dump files so it will probably take me a while to figure out how to read anything useful, maybe I should just bite the bullet and learn how to do it anyway.

Please advise!

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: SFML 2.1 Crashes somewhere in my Audio Function on Windows 7
« Reply #1 on: October 10, 2013, 10:21:48 pm »
I could tell from my log file that my program crashed from something in my audio function, but only with a new version of my program created with SFML 2.1. I had an older version of my program from one of the 2.0 release candidates and was able to run that without crashing. I am 99% sure none of the code in the audio function changed, only the SFML version.
Welcome to undefined behaviour. Just because your code doesn't change, doesn't mean that the effects it has and the way it interacts with other components doesn't change, and that even between consecutive runs of exactly the same executable file on exactly the same machine. You could have just got lucky with the previous version of SFML and not so lucky with the current version. Unless you can reproduce it (which I guess you can't given the circumstances), you can't really file a proper bug report since you don't even know the cause of the crash...

I would recommend doing proper housekeeping and running sanitizers on your code. This includes memory checkers, race condition detectors, etc. More often than not, subtle mistakes that are caught by those tools are the cause of such behaviour. If you can reproduce it, you can continue on and minimize the test case down to something manageable and post it here.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

Acumen

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Re: SFML 2.1 Crashes somewhere in my Audio Function on Windows 7
« Reply #2 on: October 10, 2013, 11:53:14 pm »
Why would it run fine in compatibility every time, and crash in non compatibility every time? I think it was more likely some sort of openAL conflict no?

A bit more on the computer, it was a Dell Alienware M17x, which I believe has an onboard soundcard and a Sound Blaster Recon3Di. Possibly there was a problem associated with the fact there were two cards?

It crashed on the very first instance of my function, which looking at the code will only do the following:

audio.Listener.setPosition(x,y,z);
audio.Listener.setDirection(x1,y1,z1);

audio.music.play();

Not much to go wrong there, and everything initialized just fine. There were no warnings in my console window so that should mean it loaded the music file.
« Last Edit: October 10, 2013, 11:58:07 pm by Acumen »