ID:2372083
 
Resolved
Including a mutable appearance in its own overlays/underlays caused a crash when trying to resolve it into an immutable appearance.
BYOND Version:512.1425
Operating System:Windows 10 Home
Web Browser:Chrome 66.0.3359.139
Applies to:Dream Daemon
Status: Resolved (512.1426)

This issue has been resolved.
Descriptive Problem Summary:
The code snippet below will explain it far better than words could. Spawning the given object will instantly crash Dream Daemon.

Numbered Steps to Reproduce Problem:
1. Code a self-referential mutable_appearance
2. Spawn it

Code Snippet (if applicable) to Reproduce Problem:
/obj/recursive/New()
..()
var/mutable_appearance/app = new(src)
app.pixel_x = 32
app.overlays += app
appearance = app


Expected Results:
Either for the object's sprite to repeat to the right infinitely, or for the object's sprite to repeat to the right once. (I was hoping for the former, but honestly expected the latter.)

Actual Results:
Server crashed.

The rest of the template isn't really important here.
The coolest solution would be to make overlays contain a pointer to the appearance rather than a copy of it, and thus allow repeating sprites like this, but I'd understand if you just disallowed this.
You definitely won't get infinite recursion. What should happen here is that although it's self-referential in the overlays list, it should be "finalized" to an ID first. It's possible something is happening out of sequence that causes the crash.
Lummox JR resolved issue with message:
Including a mutable appearance in its own overlays/underlays caused a crash when trying to resolve it into an immutable appearance.