Unhandled exception in FMOD with FS + HTH2 + autoload

Bugs that have been resolved.

Moderator: Graf Zahl

Locked
User avatar
Gez
Developer
Developer
Posts: 1399
Joined: Mon Oct 22, 2007 16:47

Unhandled exception in FMOD with FS + HTH2 + autoload

Post by Gez »

I'm not sure where to report this. On the one hand, the problem happens in GZDoom when trying to play a mod that's not compatible with ZDoom (High-Tech Hell 2). On the other, the crash is in the sound system, which would make it a ZDoom problem as well. All GZDoom tests made with official build 1.4.1.

Anyway, steps to reproduce: start hth2.zip in GZDoom, go directly to MAP02, activate the switch to open the cargo bay door, and you get a crash. At least, I do.

The MSVC debugger tells me it happens here:

Code: Select all

unsigned int FMODSoundRenderer::GetSampleLength(SoundHandle sfx)
{
	if (sfx.data != NULL)
	{
		unsigned int length;

-->		if (((FMOD::Sound *)sfx.data)->getLength(&length, FMOD_TIMEUNIT_PCM) == FMOD_OK)
		{
			return length;
		}
	}
	return 0;	// Don't know.
}
In game, this happens during the FS script:

Code: Select all

script 90
// entry doors -90
{
if (x90 == 1)
	{
	x90 = 2;
wait(20);
setcamera(283, 12, 142, 0);
timedtip(200, "radio: sorry,\n  the gargo doors are not at use.");
wait(85);
setcamera(152, 175, 140, 0);
wait(50);
//startsectorsound(42, "amb50");
startsectorsound(49, "amb50");

	linetrigger(26731, 42);		// Floor SR HnF Norm Txtr Num Up No
	tagwait(42);
	lightlevel(151, 232);

silentteleport(329, 42);
wait(100);
timedtip(350, "use this teleporting\n  device to enter the complex");
wait(100);
clearcamera();
	x91 = 2;
wait(250);
timedtip(5, " ");
	}
}
The first message (about the "gargo doors" [sic]) is displayed, then it crashes, and the message about the teleporter never happens. So it seems obvious that the problem comes when running the startsectorsound(49, "amb50") instruction. Commenting it out allows to continue... But not for long since the same crash happens again, caused by something else, once you step on the teleporter.

So at this point I thought that maybe there was something wrong with the sounds from that wad. I copy the sound lump in a test wad, identified as "problemsound" in SNDINFO, and I use this custom actor to test in a ZDoom-compatible way:

Code: Select all

Actor ProblemCauser : SwitchableDecoration 1337
{
	Activation THINGSPEC_Switch
	Radius 16
	Height 32
	+SOLID
	+USESPECIAL
	States
	{
	Spawn:
	Inactive:
		BAR1 AB 6
		Loop
	Active:
		FCAN A 0 A_PlaySound("problemsound")
		FCAN ABC 4 BRIGHT
		Goto "Active"+1
	}
}
When activating the object, no bug in ZDoom. No bug in GZDoom as well. It's not the sound file.

Then I did a test of HTH in GZDoom, but by cleaning my autoload to keep only lights.pk3 and brightmaps.pk3. A half-victory: I could play past the switch, and even past the teleporter, but it crashed with that same error when picking up one of the SSGs. Encouraged by this result, I tried with nothing in the autoload at all: no crash.

And there I just don't understand what's the actual culprit.

Attached is a crash report obtained by autoloading just brightmaps.pk3. But I also get a crash at the same place (just after the teleport) with just lights.pk3.
Attachments
HTH2CrashReport.zip
(19.2 KiB) Downloaded 51 times
milasudril
Posts: 64
Joined: Fri May 15, 2009 17:21

Re: Unhandled exception in FMOD with FS + HTH2 + autoload

Post by milasudril »

It seems like there are more problems with hth2. It crashes in the intro. Probably when next level should start.

ZDoom version 1.4.1 (r712) / ZDoom2.4.0 (r2099) (Jan 5 2010)

Command line: "C:\Program\GZDoom13\gzdoom.exe" -iwad "C:\Documents and Settings\Sten\Mina dokument\Doom datafiler\doom2.wad" -file "C:\Documents and Settings\Sten\Mina dokument\Doom datafiler\hth2.wad"

Wad 0: gzdoom.pk3
Wad 1: doom2.wad
Wad 2: hth2.wad

Current map: MAP01

viewx = -115474432
viewy = -210239488
viewz = 2752512
viewangle = 26666666


When starting at map02, it crashes directly after using the teleporter

ZDoom version 1.4.1 (r712) / ZDoom2.4.0 (r2099) (Jan 5 2010)

Command line: "C:\Program\GZDoom13\gzdoom.exe" -iwad "C:\Documents and Settings\Sten\Mina dokument\Doom datafiler\doom2.wad" -file "C:\Documents and Settings\Sten\Mina dokument\Doom datafiler\hth2.wad"

Wad 0: gzdoom.pk3
Wad 1: doom2.wad
Wad 2: hth2.wad

Current map: MAP01

viewx = -115474432
viewy = -210239488
viewz = 2752512
viewangle = 26666666
jbailey8
Posts: 30
Joined: Sat Dec 26, 2009 3:29

Re: Unhandled exception in FMOD with FS + HTH2 + autoload

Post by jbailey8 »

I can confirm this also happens with my current version of gzdoom, svn version 713, jan 5.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Re: Unhandled exception in FMOD with FS + HTH2 + autoload

Post by Graf Zahl »

Damnit!

Randy coded the FModEx soundsystem so that the sounds array cannot be reallocated. This was not the case for the old FMod 3.75 implementation. What happens here is that a new sound needs to be added and the sound table does not contain any free entries...
Locked

Return to “Closed Bugs”