37.0 crash when using a getter function to reference object during a SET call

Summary

When using a function to return an object reference inline during a SET call the compiler (as of v37.0) appears to reference the object incorrectly and causes a hard crash.

The crash presents itself as a network timeout. No logs appear in editor unless a sleep is used to allow it to flush to editor prior to crash.

Please select what you are reporting on:

Verse

What Type of Bug are you experiencing?

Verse

Steps to Reproduce

After v37.0 this example setup/code now crashes:

  1. Compile the verse code below.
  2. Put ā€œmain_deviceā€ and ā€œsome_deviceā€ in world.
  3. Set main_device’s ā€œSomeDeviceā€ to the instance of ā€œsome_deviceā€ in world.
  4. Run session, then ā€œStart Gameā€.
  5. Experience crash.
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }

some_device<public> := class(creative_device):        
	var FooInt:int = 0

getter_class<public> := class:
	Device<public> : ?some_device = false
    Get<public>() : some_device =
        if (ValidDevice := Device?) :
            return ValidDevice
        Err("No valid device")

main_device<public> := class(creative_device) :
    @editable SomeDevice : ?some_device = false
    var Getter : getter_class = getter_class {}

    OnBegin<override>()<suspends>:void =
        set Getter = getter_class{Device:=SomeDevice}

        WorksFine()     
        Crash()

    WorksFine()<suspends>:void = 
        LocalVar := Getter.Get() # using a local var works around the issue
        set LocalVar.FooInt = 123
        Print("I WORK! :D")

    Crash()<suspends>:void = 
        Print("About to crash...")    
        Sleep(2.0) # needed to flush above log...
        set Getter.Get().FooInt = 123 # -- CRASH -- #
        
        # - Verse unrecoverable error: 
        # ErrRuntime_Internal: An internal runtime error occurred. There is no other information available. 
        # (Internal error encountered: Attempted to reference 'self' as an addressable property..)

        # -- Network timeout here --
        Print("I'm never reached!")

Expected Result

  • Act the same as it did prior to v37.0. (i.e. do not crash)

Observed Result

Not only does it crash, but it’s nasty. The user recieves a network timeout error, logs are not flushed to editor, and users recieve no information about what happened or why.

Platform(s)

windows

Island Code

9287-5846-6590

Video

  • Video shows running a 37.0 session with above code/setup.
  • Player freezes in-place and game crashes.

Hey, I went to edit the post to fix the code block being formatted wrong and reword my description, but read that editing posts at the moment can stop mods from escalating issues? If a mod wouldn’t mind fixing the < code> tags in the post so it’s formatted correctly I’d be grateful :slight_smile:

1 Like

We have a repro here and the team will be checking into it. We’ll let you know if we need anything else.

1 Like

FORT-952023 has been added to our ā€˜To Do’ list. Someone’s been assigned this task.