ID:1915498
 
BYOND Version:508
Operating System:Windows 7 Ultimate 64-bit
Web Browser:Chrome 45.0.2454.26
Applies to:Dream Daemon
Status: Open

Issue hasn't been assigned a status value.
Descriptive Problem Summary:
Calling world.Reboot() from world/Del() leaves the world in a broken (but running) state where it can never be shutdown or Restarted without killing DD.

This is technically a major bug, but its low priority because at this point, the user already knows they are playing with black magic. (Or at least, I did)

I stumbled on it it when i was trying to find mitigation techniques to http://www.byond.com/forum/?post=1914830.

I figured if i could trigger a reboot, maybe it would mitigate the effects of the crashes.

Numbered Steps to Reproduce Problem:
Run code snippet
Click test stack overflow until you see "del called" in the chat window.
At this point, DD attempted (and failed) to shut the world down, and it will still be running.
Use the try shutdown or try restart verbs
You can verify the world never restarted by clicking the check stack overflow state verb.

Code Snippet (if applicable) to Reproduce Problem:
world {
tick_lag = 0.5;
icon_size = 32;
view = 6;
Del() {
if (allowshutdown)
return ..();
deleted = 1;
world << "del called";
world.log << "del called";
Reboot(); //FUN!
}
}
var/allowshutdown = 0;
var/stackoverflowcalls = 0;
var/deleted = 0;
proc/stackoverflow(n = 1) {
. = stackoverflow(n+1);
}
mob {
verb/testsof() {
set name="test stack overflow";
set category="test";
stackoverflowcalls++;
stackoverflow();
}
verb/checkstate() {
set name="check stack overflow state";
set category="test";
world << "stackoverflowcalls:[stackoverflowcalls]";
world << "deleted:[deleted]";
}
verb/tryrestart() {
set name="try restart";
set category="test";
allowshutdown = 1;
world << "restarting world";
world.Reboot();
}
verb/tryshutdown() {
set name="try shutdown";
set category="test";
allowshutdown = 1;
world << "shutting down world";
shutdown();
}
}


Expected Results:
Black magic daemons spawn and call you master, while a rip in the space time continuum opens up and takes you back to that one moment you did something really awkward in highschool that you keep randomly thinking back on, so you can not do it.