View Issue Details

IDProjectCategoryView StatusLast Update
0000132Gameplay + OpenGL[All Projects] Bugpublic2017-01-29 11:29
ReporterZZYZX 
Assigned ToGraf Zahl 
PrioritylowSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
Summary0000132: ZScript VM doesn't seem to initialize scripted fields in subclasses properly
DescriptionBasically, I have a native class defined in these files

https://github.com/jewalky/gzdoom/blob/thereisnospoon/src/events.h
https://github.com/jewalky/gzdoom/blob/thereisnospoon/src/events.cpp
https://github.com/jewalky/gzdoom/blob/thereisnospoon/wadsrc/static/zscript/events.txt

Then I create a subclass, for example like this: http://pastebin.com/6XpEE33W
The field "myS" is never initialized to a proper string: when trying to access it, then in debug mode, it's 00000000 (assertion failed: Chars != null), and in release mode it just crashes to desktop.

Is this a problem with my code or with GZDoom?

Note: providing a struct there, e.g. like this http://pastebin.com/WNWMZyLT, does not crash.
Also, if I do this in Actor, it seems to work alright (i.e. inheriting actor and putting a string field in it works).

Made a bug because otherwise Graf keeps forgetting.
TagsNo tags attached.

Relationships

Activities

ZZYZX

ZZYZX

2017-01-27 23:56

reporter   ~0000263

Struct link: http://pastebin.com/WNWMZyLT
Broke in the bug.
Graf Zahl

Graf Zahl

2017-01-29 05:34

administrator   ~0000273

Do you have a complete, ready to test, example for this? I am still trying to wrap my head around these fragments.
ZZYZX

ZZYZX

2017-01-29 06:49

reporter   ~0000277

Make a build of https://github.com/jewalky/gzdoom/tree/thereisnospoon
Then take this pk3 and run it, it will crash upon entering the map.

crash.pk3 (669 bytes)

Issue History

Date Modified Username Field Change
2017-01-27 23:54 ZZYZX New Issue
2017-01-27 23:56 ZZYZX Note Added: 0000263
2017-01-29 05:34 Graf Zahl Note Added: 0000273
2017-01-29 05:50 Graf Zahl Assigned To => Graf Zahl
2017-01-29 05:50 Graf Zahl Status new => feedback
2017-01-29 06:49 ZZYZX File Added: crash.pk3
2017-01-29 06:49 ZZYZX Note Added: 0000277
2017-01-29 06:49 ZZYZX Status feedback => assigned
2017-01-29 11:29 Graf Zahl Status assigned => resolved
2017-01-29 11:29 Graf Zahl Resolution open => fixed