ID:2913595
 
Resolved
Reusing mutable_appearance could sometimes result in certain appearances being deallocated early, leading to a crash.
BYOND Version:514
Operating System:Windows 10 Pro 64-bit
Web Browser:Firefox 122.0
Applies to:Dream Daemon
Status: Resolved (515.1631)

This issue has been resolved.
Descriptive Problem Summary:
When SS13 SSOverlays is modified to use mutable appearances to reduce appearance churn, Daemon crashes instead.

Numbered Steps to Reproduce Problem:
1. Take an SS13 codebase with SSoverlays.
2. Replace var/image in certain x2appearance procs with mutable appearances, as well as the one in the APPEARANCIFY macro.
3. Launch the server and watch it crash when SSoverlays fires.

Code Snippet (if applicable) to Reproduce Problem:
https://github.com/out-of-phaze/Nebula/archive/refs/heads/ tweak/crux-optimization.zip
The changes in this commit are included in that zip file: https://github.com/out-of-phaze/Nebula/commit/ 63e094f78951c2b11f39fd1098cf092b8f466d16

Expected Results:
Reduced appearance churn.

Actual Results:
Access violation exception.

Does the problem occur:
Every time? Or how often? Any time this specific code is modified.
In other games? Not that I've seen, but it happens across multiple separate SS13 codebases.
In other user accounts? Yes.
On other computers? Also yes!

When does the problem NOT occur?
When mutable appearances are used

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)

Workarounds:

Lummox JR resolved issue with message:
Reusing mutable_appearance could sometimes result in certain appearances being deallocated early, leading to a crash.