ID:2306577
 
BYOND Version:511
Operating System:Windows 7 Ultimate 64-bit
Web Browser:Chrome 62.0.3202.52
Applies to:Dream Daemon
Status: Open

Issue hasn't been assigned a status value.
Descriptive Problem Summary:
Calling proc from world/Error() Like, say, a time_stamp() proc causes the call to go thru, but control is never returned to world/Error().

Stack overflow runtimes happen at 200 proc calls iirc. stack overflow crashes happen around 500 proc calls, so 1 or 2 proc calls on top isn't going to harm anything, and world/Error() already gets bypassed if it runtimes. This behavior is unlikely to be intentional (especially since the proc call goes thru, it is only the returning of control back to world/Error() that fails.)

To deal with potential issues with stack overflows in world/Error() you could either give it a smaller leeway (even as low as 10 procs on top), or just say fuck it and declare that stack overflow crashes caused by world/Error() is an ID-TEN-T error and wash your hands of it and not add a limit.

but for the love of god, fix this bug!


Code Snippet (if applicable) to Reproduce Problem:
#ifdef DEBUG
/world/Error(exception/E, datum/e_src)
if(!istype(E)) //Something threw an unusual exception
log_world("Uncaught exception: [E]")
return ..()

log_world("[__LINE__]")
var/e_read = "[E]"
log_world("[__LINE__]")
var/e_name = "[E.name]"
log_world("[__LINE__]")
var/e_desc = "[E.desc]"
log_world("[__LINE__]")
var/e_file = "[E.file]"
log_world("[__LINE__]")
var/e_line = "[E.line]"
log_world("[__LINE__]")
log_world("/world/Error():[E] : [E.desc]|||[E.file]|||[E.line]")
log_world("[__LINE__]")

#endif

/proc/log_world(message)
world.log << message

/client/verb/stack_overflow()
.()


Expected Results:
7
9
11
13
15
...

Actual Results:
7


(log_world() is a proc because on /tg/ it also logs it to a file. most of our world/Error code is about skipping repeated runtimes, and redirecting the output to the log_world() proc so they log to both a file, as well as dd's output.)

Workaround:
https://github.com/tgstation/tgstation/pull/31900/files
so I can confirm world/Error() does return, its not just hung in the stack or anything. I created a list and saved it's \ref to a global var and was unable to locate() it meaning that the world/Error() proc returns and cleans up.
Thanks for the info. I'll take a look at this when I can.
Can you look into this?