Copy function debug name onto stack for crash dumps#159
Conversation
dvander
left a comment
There was a problem hiding this comment.
I think a reasonable, statically-sized buffer is better. alloca() has Problems(TM).
Also avoid higher-level compiler optimisations removing the name
|
I've played with a few variations in https://godbolt.org/, I think |
|
http://man7.org/linux/man-pages/man3/alloca.3.html `There is no error indication if the stack frame cannot be extended. `This function is not in POSIX.1. I would avoid alloca at all costs. |
|
As would just calling the function if it was allocating a large enough local variable... that information isn't exactly useful or relevant. The DebugName of a function is fairly well constrained (and I believe should be well under the limit reasonable to stack alloc - which MS considers to be 1kB for an individual alloc), it just isn't ideal to allocate the full size required for the 90% of cases where it is much shorter. |
This is a useful hack I've had sitting in my queue for a while.
Copy the to-be-invoked function's debug name into the
ScriptedInvoker::Invokestack frame so it is always available in minidumps even without heap information.This will hopefully make it easier to track down reproduction steps for plugin-related crashes.