Artifact 0831051fa39abd8a103ff1ec9d4904e6703000fe9a24f8bd3ac3e5723e76ccbd:

Ticket change [0831051f] - New ticket [e59985df] type_name:job allocates on the stack. by luismachuca 2019-02-26 13:42:25.
D 2019-02-26T13:42:25.597
J foundin <91
J icomment <tt>library/type_name.hpp</tt>\sline\s30:\sthe\sheader\sprovides\stypeid\sdemangle,\showever\sfor\scompilers\susing\s<tt>cxxabi</tt>\s(eg.:\sGCC),\sit\scalls\s<tt>abi::__cxa_demangle</tt>\swith\sa\sbuffer\sallocated\son\sthe\sstack.\r\n\r\n<verbatim>\r\n\s\s\s\schar\sbuf[1024];\s//\s<--\serror\sis\sthis\r\n\s\s\s\ssize_t\ssize=sizeof(buf);\r\n\s\s\s\sint\sstatus;\r\n\s\s\s\schar*\sres\s=\sabi::__cxa_demangle\s(name,\sbuf,\s&size,\s&status);\r\n</verbatim>\r\n\r\nRelevant\squotes\sfrom\sthe\scxxabi\sdocumentation:\r\n\r\n<blockquote>output_buffer\r\n\s\s\s\sA\sregion\sof\smemory,\sallocated\swith\smalloc,\sof\s*length\sbytes,\sinto\swhich\sthe\sdemangled\sname\sis\sstored.\r\n</blockquote>\r\n\r\n<blockquote>\s\s\s\sThe\scaller\sis\sresponsible\sfor\sdeallocating\sthis\smemory\susing\sfree.\r\n</blockquote>\r\n\r\nSourced\sby\s[1]\sreferencing\s[2].\r\n\r\n\s\s*\s\s[1]\s[https://stackoverflow.com/questions/281818/unmangling-the-result-of-stdtype-infoname]\r\n\s\s*\s\s[2]\s[http://panthema.net/2008/0901-stacktrace-demangled/cxa_demangle.html]
J login luismachuca
J mimetype text/x-fossil-wiki
J severity Critical
J status Open
J title type_name:job\sallocates\son\sthe\sstack
J type Code_Defect
K e59985dfdfbecfb1238b91f1094fe31344e4fa8f
U luismachuca
Z 8b39e53c372c824c1d9f5f41f95d6934