ID:2869052
 
Resolved
Changing the count for particles with gradients could cause a client crash.
BYOND Version:514
Operating System:Windows 10 Pro 64-bit
Web Browser:Chrome 113.0.0.0
Applies to:Dream Seeker
Status: Resolved (515.1607)

This issue has been resolved.
Descriptive Problem Summary:
Modifying the count var of a particle that has a color gradient applied to it will on occasion cause a client crash.

The crash won't hit every client at the same time, nor will the modification of the count var always result in the crash. That said in a test case like the one provided you can easily cause it to happen in only a few seconds by spam modifying the var.

Numbered Steps to Reproduce Problem:
1. Create a particle
2. Set the particle's gradient var
3. Set the particle's color_change var - if not set crash will not occur
5. Alter the particle's count var
5. There is a chance you will crash when the var is changed

Code Snippet (if applicable) to Reproduce Problem:
world
// Set the world's name. This will appear in the title bar.
name = "Particle Crash Demo"

// Configure the default mob object players will log in as.
mob = /mob/demo

mob/demo
icon = 'icons/player.dmi'
particles = new/particles/demo_particle

verb/randomize_count()
for (var/i in 1 to 10000)
// randomly changes the count over and over again, should crash pretty quickly.
var/new_count = rand(1,500)
world.log << "New particle count: [new_count]"
particles.count = new_count
sleep(1)

particles/demo_particle
gradient = list(0, "#f00", 1, "#ff0", 2, "#0f0", 3, "#0ff", 4, "#00f", 5, "#f0f", 6, "#f00", "loop")
color_change = 0.1
turf
floor
icon = 'icons/floor.dmi'
area
outside


Expected Results:
no crash
Actual Results:
crash log example 1:
Faulting application name: dreamseeker.exe, version: 5.0.514.1589, time stamp: 0x633f86ad
Faulting module name: byondcore.dll, version: 5.0.514.1589, time stamp: 0x633f8670
Exception code: 0xc0000005
Fault offset: 0x0004a075
Faulting process id: 0x4910
Faulting application start time: 0x01d981ed3e8cfdba
Faulting application path: C:\Program Files (x86)\BYOND\bin\dreamseeker.exe
Faulting module path: C:\Program Files (x86)\BYOND\bin\byondcore.dll
Report Id: c5725d2c-4f73-4c0a-b16c-3d85a8c067d2
Faulting package full name:
Faulting package-relative application ID:

---
crash log example 2:
Faulting application name: dreamseeker.exe, version: 5.0.514.1589, time stamp: 0x633f86ad
Faulting module name: byondcore.dll, version: 5.0.514.1589, time stamp: 0x633f8670
Exception code: 0xc0000005
Fault offset: 0x0004a075
Faulting process id: 0xa080
Faulting application start time: 0x01d981eb66ba4c57
Faulting application path: C:\Program Files (x86)\BYOND\bin\dreamseeker.exe
Faulting module path: C:\Program Files (x86)\BYOND\bin\byondcore.dll
Report Id: cffd17c8-1741-46e8-a30d-583f465f65aa
Faulting package full name:
Faulting package-relative application ID:

Does the problem occur:
Every time? Or how often? Intermittent, easily reproducible
In other games? Yes
In other user accounts? Yes
On other computers? Yes

When does the problem NOT occur?
Intermittent, more often than not the issue does not occur when the count var is modified.

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.)
To my knowledge this has been an issue in every version of 514 so far, I've only recently opted to hunt it down

Workarounds:
None known at this time
Crashing bug confirmed to also be present in latest beta release, 515.1606
Lummox JR resolved issue with message:
Changing the count for particles with gradients could cause a client crash.