outsider input (but, by coincidence, deeply imbedded with tracebacks for the last two weeks): its a mistake to have any traceback function call malloc(), since plugging memory leaks must be near the top of traceback requirements list
backtrace() puts the info in a user buf,siz an appropriately renamed backtrace_symbols() should to the same with feedback when the buffer size is insufficient -- Glenn Fowler -- AT&T Research, Florham Park NJ -- On Tue, 20 Mar 2007 15:57:32 -0700 (PDT) Don Cragun wrote: > > int backtrace(void **buffer, int size); > > char **backtrace_symbols(void *const *buffer, int size); > > void backtrace_symbols_fd(void *const *buffer, int size, int fd); > > int addrtosymstr(uintptr_t addr, char *buffer, int len); > Shouldn't the "int"s here that refer to buffer sizes be "size_t"s or > "ssize_t"s instead? Or is there really an intent here to limit these > buffer sizes to 32 bits on 64-bit architectures? > Do any of these functions ever fail? I see no mention of error returns > nor of errno settings. If would seem like attempts to backtrace > through a corrupted stack could lead to failures. > Cheers, > Don > _______________________________________________ > opensolaris-arc mailing list > opensolaris-arc at opensolaris.org
