GZDoom 3.4.1/3.5.0 crashes randomly when loading a mod

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
User avatar
krokots
Posts: 266
Joined: Tue Jan 19, 2010 5:07 pm

GZDoom 3.4.1/3.5.0 crashes randomly when loading a mod

Post by krokots »

About one in 8 times i run a mod it just crashes when loading actors. I don't know what is the cause, there is no info.



Report 1
Report 2

I tried with 3.5.0, it crashes too


After some crude debugging i found what was causing those crashes. It is something with dynamic arrays.
removing this

Code: Select all

Array<WeaponTrait> possibleTraits;
(...)

WeaponTraitList list = new ('WeaponTraitList');
list.List = possibleTraits;
where weapon trait list is just a class with array

Code: Select all

Class WeaponTraitList
{
	Array<WeaponTrait> List;
}
fixed this. The classes with arrays are fine, I have couple of them in the mod. I think it's the line

Code: Select all

list.List = possibleTraits;
that's causing the problems

Edit2

I fixed it completely by changing the bad line to

Code: Select all

list.List.Copy(possibleTraits);
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: GZDoom 3.4.1/3.5.0 crashes randomly when loading a mod

Post by _mental_ »

Could you please post a runnable sample that crashes GZDoom? This can be a bug in the engine and we would like to check this.
User avatar
krokots
Posts: 266
Joined: Tue Jan 19, 2010 5:07 pm

Re: GZDoom 3.4.1/3.5.0 crashes randomly when loading a mod

Post by krokots »

I think I posted while being logged out...I did not even think it's possible.

Here is a short code that produces the same bug as in the video - it crashes every couple of times I run it.
http://www.mediafire.com/file/7ctpdi5nu ... t.zip/file
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: GZDoom 3.4.1/3.5.0 crashes randomly when loading a mod

Post by _mental_ »

Here is the simplified example

Code: Select all

class Test
{
	void Func()
	{
		array<Object> a1;
		array<Object> a2;
		a1 = a2;
	}
}
The code causes a failure of this assertion because result.RegType is REGT_NIL. Should such assignment compile at all?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: GZDoom 3.4.1/3.5.0 crashes randomly when loading a mod

Post by Graf Zahl »

No, that should error out. Arrays need to be copied with the Copy function.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: GZDoom 3.4.1/3.5.0 crashes randomly when loading a mod

Post by _mental_ »

Assignment of dynamic arrays was explicitly prohibited in 31bd7cf.
Post Reply

Return to “Closed Bugs [GZDoom]”