openplanet-nl / issues

Issue tracker for Openplanet.
10 stars 0 forks source link

crash on assert: tempVariables.GetLength == 0 #442

Closed XertroV closed 5 months ago

XertroV commented 5 months ago

image

Happened on reloading E++.

Clicked ignore a bunch. There was a different message after some repeats of that assertion, but I clicked ignore too quickly to see it. Then the game crashed.

XertroV commented 5 months ago

okay on restarting the game I got the original assertion error then a few more.

image image image

        // this causes assertion errors
        // protected ObjInMap@[]@[] _Macroblocks;
        // const ObjInMap@[]@[]@ get_Macroblocks() { return _Macroblocks; }
        // this does not
        protected ObjInMap@[][] _Macroblocks;
        const ObjInMap@[][]@ get_Macroblocks() { return _Macroblocks; }

        protected void AddToMacroblock(ObjInMap@ b) {
            if (b.mbInstId < 0) return;
            while (b.mbInstId >= _Macroblocks.Length) {
                _Macroblocks.InsertLast({});
                dev_trace("_Macroblocks length: " + _Macroblocks.Length + " for mbInstId: " + b.mbInstId);
            }
            _Macroblocks[b.mbInstId].InsertLast(b);
        }
codecat commented 5 months ago

So this is related to an array of arrays as handles? Can we find a minimal reproduction case w/o the use of Openplanet-specific API's to report on the Angelscript forum?

XertroV commented 5 months ago

Reported here: https://www.gamedev.net/forums/topic/715669-4-assertion-errors-with-nested-lists-of-handles/

Repro:

class Cache {
    Cache() {

    }

    protected Obj@[]@[] _Blah;
    const Obj@[]@[] get_Blah() {
        return _Blah;
    }

    protected void AddObj(Obj@ o) {
        while (o.pos.x >= _Blah.Length) {
            _Blah.InsertLast({});
            break;
        }
        _Blah[o.pos.x].InsertLast(o);
    }
}

class Obj {
    nat3 pos;
    Obj(nat3 pos) {
        this.pos = pos;
    }
}