Page 1 of 1

[r3105] Sin City instant crash

Posted: Sun Jan 16, 2011 4:10 pm
by Jimmy
ZDoom now instantly bombs out when loading up MAP01 of Sin City by Ed Cripps. I get no crash log, just a "ZDoom has stopped working" Windows error.

I've noticed that Ed mentions something about a skybox crash on the WAD's /idgames page, which may have recently become more prominent. Setting r_skyboxes to FALSE doesn't fix this, however.

EDIT: Oh bugger - just realized that this crash in fact only happens when running the WAD with Omega. :oops:

Re: [r3105] Sin City instant crash

Posted: Sun Jan 16, 2011 4:15 pm
by Gez
Works with r3089. Works for me with GZDoom r1175 (based on r3105).

Compiling ZDoom r3105 to see if I get the crash.


Compiled, works for me.

Re: [r3105] Sin City instant crash

Posted: Sun Jan 16, 2011 4:33 pm
by Jimmy
With Omega as well? :shock:

Re: [r3105] Sin City instant crash

Posted: Sun Jan 16, 2011 4:36 pm
by Gez
I didn't see your edit, so no, I haven't tested with Omega. I don't think I have it handy, either.

Re: [r3105] Sin City instant crash

Posted: Sun Jan 16, 2011 4:55 pm
by Jimmy
I've made a couple small changes since the last official release, so here it is:
j-omega.wad
(245.06 KiB) Downloaded 31 times

Re: [r3105] Sin City instant crash

Posted: Sun Jan 16, 2011 5:08 pm
by Gez
Interesting, the crash happens here:

Code: Select all

        case PCD_CHECKWEAPON:
            if (activator == NULL || activator->player == NULL || // Non-players do not have weapons
                activator->player->ReadyWeapon == NULL)
            {
                STACK(1) = 0;
            }
            else
            {
                STACK(1) = 0 == stricmp (FBehavior::StaticLookupString (STACK(1)),
->                    activator->player->ReadyWeapon->GetClass()->TypeName.GetChars());
            }
            break;

Re: [r3105] Sin City instant crash

Posted: Sun Jan 16, 2011 5:26 pm
by Jimmy
So... it's something to do with starting weapons? I'm sorry, I'm not familiar with the source code at all. :?

Possibly unrelated, but in this build, the NoWeapon1-4 weapons that the player starts out with in Omega have their class name printed to the screen rather than their Tag, which is empty (""). Probably a deliberate change - but one that can still be easily addressed on my end.

Re: [r3105] Sin City instant crash

Posted: Sun Jan 16, 2011 5:32 pm
by Gez
It's something to do with ACS.

Tags default to the class name when empty, so it's normal.

By the way, did you see those warnings in the log before the crash?

Code: Select all

ACS: I don't know what \cCUnder the waterfall... is.
ACS: I don't know what \cCUnder the waterfall... is.
ACS: I don't know what \cCUnder the waterfall... is.
ACS: I don't know what \cCUnder the waterfall... is.
ACS: I don't know what \cCUnder the waterfall... is.
ACS: I don't know what \cCUnder the waterfall... is.
Edit: I fixed the problem by adding a check for NULLness:

Code: Select all

        case PCD_CHECKWEAPON:
            if (activator == NULL || activator->player == NULL || // Non-players do not have weapons
                activator->player->ReadyWeapon == NULL || FBehavior::StaticLookupString (STACK(1)) == NULL)
            {
                STACK(1) = 0;
            }
            else
            {
                STACK(1) = 0 == stricmp (FBehavior::StaticLookupString (STACK(1)),
                    activator->player->ReadyWeapon->GetClass()->TypeName.GetChars());
            }
            break;

I think what happens here is a script conflict between OMG_ACS and the level script. I notice you haven't made it a library...

Edit: Using the awesome power of the almighty SLADE3, I added this line in the OMG_ACS text lump:

Code: Select all

// Omega ACS file, written by James "Jimmy" Paddock.
//==================================================

#library "omega"
#include "zcommon.acs"
Then right-click on the lump, Scripts->Compile ACS. Automagically, it updated the OMG_ACS script lump between the A_ markers. (I didn't even know it was that smart, it's the first time I use this on a script lump that doesn't belong to a map.)

Save, load in (unaltered) ZDoom -- no crash.


So, basically, this is [User error] though the engine could use an additional NULL check just for stability concerns.

Re: [r3105] Sin City instant crash

Posted: Sun Jan 16, 2011 6:10 pm
by Jimmy
Right. Cheers for the clarity. :D

Re: [r3105] Sin City instant crash

Posted: Sun Jan 16, 2011 6:33 pm
by Graf Zahl
I addressed this a bit differently.