[Duplicate] Parsing (?) crash with simulated array array

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Parsing (?) crash with simulated array array

Postby stan423321 » Mon Sep 18, 2017 11:58 am

Tested on 3.2-pre557 on Windows 10 Home 1703 15063.608, 64-bit and 32-bit. The "bad" version crashes before menu with report request. A very similar "good" version doesn't. A crash report is generated (attached is 64-bit version).

"Good" code:
Code: Select allExpand view
version "2.5"

class Foo : Object {
   Array<int> fu;
}

class Bar : ZombieMan replaces ZombieMan {
   Array<Foo> bru;
   States {
      Spawn:
         TNT1 A 0 NoDelay {
            bru.push(new('Foo'));
            let hq = bru[0];
            hq.fu.push(4);
            hq.fu[0] = hq.fu.size();
         }
         goto Super::Spawn;
   }
}


"Bad" code:
Code: Select allExpand view
version "2.5"

class Foo : Object {
   Array<int> fu;
}

class Bar : ZombieMan replaces ZombieMan {
   Array<Foo> bru;
   States {
      Spawn:
         TNT1 A 0 NoDelay {
            bru.push(new('Foo'));
            bru[0].fu.push(4);
            bru[0].fu[0] = bru[0].fu.size();
         }
         goto Super::Spawn;
   }
}
Attachments
CrashReport.zip
(18.85 KiB) Downloaded 42 times
bad.pk3
(349 Bytes) Downloaded 45 times
good.pk3
(359 Bytes) Downloaded 44 times
stan423321
 
Joined: 25 Mar 2014

Re: Parsing (?) crash with simulated array array

Postby Major Cooke » Mon Apr 02, 2018 7:19 pm

Does this issue still persist?
User avatar
Major Cooke
Do unto others as you would have unto you. Judge yourself first.
 
Joined: 28 Jan 2007

Re: Parsing (?) crash with simulated array array

Postby stan423321 » Tue Apr 10, 2018 1:54 pm

Retested on the same computer, Windows 10 Home updated to 1709 16299.334, 32-bit to GZDoom 3.4pre-50-g3dd7f17de, 64-bit to GZDoom 3.4pre-55-g80f57dfaf (latest on DRD Team at time of testing).

I don't know ZScript specs by heart, so I don't know if this is a bug being completely fixed, it is however a definite improvement. Both "bad" versions error out with "Script error, "bad.pk3:zscript.txt" line 14:", "Internal error when generating code for array access". Please state whether this is an example of expected behavior (what I would expect first would be mostly identical behavior to the "good" file, but, again, this is no crash at least). The testing file was not changed.
stan423321
 
Joined: 25 Mar 2014

Re: Parsing (?) crash with simulated array array

Postby _mental_ » Tue Apr 10, 2018 2:17 pm

No, it was not fixed because ideally both file should do the same.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: Parsing (?) crash with simulated array array

Postby phantombeta » Wed Mar 13, 2019 2:56 am

This is marked as a duplicate, but I can't find the original report, so I'll use this one instead.
I made a pull request to fix this bug.
User avatar
phantombeta
In the meadow of sinful thoughts, every flower's a perfect one
 
Joined: 02 May 2013
Location: The United Soviet Socialist Dictatorship of Hueland
Discord: phantombeta#2461
Twitch ID: phantombeta_
Github ID: Doom2fan
Operating System: Windows 10/8.1/8 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Parsing (?) crash with simulated array array

Postby Graf Zahl » Wed Mar 13, 2019 4:24 am

Thanks
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 5 guests