Crash Playing MOD Files (s3m, it)

Hi there,

I went write just a simple command line player to listen to some MOD tracker music (when I could have instead downloaded a player, but oh well. I did that anyway actually)

The sound plays, but FMOD crashes part-way through playing. It happens at the same point, but seems to be different with the two files I’ve tried.

https://modarchive.org/index.php?request=view_by_moduleid&query=69713

This crashes at about 48 seconds in.

https://modarchive.org/index.php?request=view_by_moduleid&query=55696

This crashes at about 4 minutes and 7 seconds in.

It doesn’t crash under FMODEx, and I just downloaded the latest version of FMOD to try this out.

I converted the first to a different module format, .it, and it crashed within a few seconds.

Here’s my code, it’s incredibly basic and a bit sloppy, but it was merely a test. I tried a few different things and got the same result.

Edit: Wow, the code formatting here is broken, here’s a pastebin instead:

https://pastebin.com/kuCPpD4r

I should mention that I get no output from FMOD when it crashes when using the debug version.

Is this an FMOD bug, or am I making a coding mistake?

Hi,
I played those files with your code and dont get a crash. Can you say what version of FMOD you used, and what the debugger showed when it crashed? callstack? asm code?

Did you try putting the filenames into fmod’s playstream example to see if it changed anything?

Your code looks basic enough so I can’t see any issues

The call stack is all in closed source FMOD code, and since I don’t have a commercial license I don’t have the debug symbols for it. My revision.txt file says this is FMOD version 1.09.04 from 10/04/17 build 86084. The system’s getVersion() also agrees.

I can’t read disassembly, so I couldn’t say anything useful about it.

But here’s an image that shows pretty much everything:

The output in the box is also useless as I said I don’t get any when it crashes. That output that’s there is from when the sound is opened. It doesn’t matter matter if I use createSound or createStream, same result. You can see my diagnostic session is at 48 seconds as I described.

I can try out the playstream example I suppose, but I don’t expect any difference.

I tried the play stream example and I got the crash at the same exact time. Though I noticed something odd. In the console it showed an absurdly long time that doesn’t make any sense as you can see here:

So it simply cannot be my code. This has to be some bug with FMOD or there’s an external source I am unaware of.

the length is normal, it is a length of 0xffffffff because without FMOD_ACCURATETIME the length is considered ‘infinite’ … 2^32ms is just how the time converts to hours /minutes/seconds

Thanks i’ve managed to reproduce it, problem was before, I was using 1.08. It looks like a refactor has caused this issue to sneak into 1.09, so my recommendation would be to use 1.08 for now. 1.09 is nearing release though, in about a week there will be an update and i’ve included a patch to fix the issue for .s3m files.

just confirming, exporting to mod/xm/it has the same problem, so for all mod formats.

Thank you very much! I was just about to comment about doing the same thing using FMOD under MinGW with CodeLite with C API. I got the same exact result. Glad to know that it will be fixed. Looking forward to it!

Also using MinGW with the C API gave me a legible stack trace probably due to the lib being built with symbols. Not sure if that’s intended, but it might help somebody else out.