This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: backtrace when corrupt stack
On Feb 5, 2010, at 8:05 PM, Andreas Schwab wrote:
>> I would like to get the function name and the arguments from frame 5 (see output below) --- the one called from the function Log()). The backtrace suggests this is __stack_chk_fail () from libc but that is not correct.
>
> Why do you think so? That frame looks pretty reasonable.
>
> Andreas.
I am pretty sure that the function in frame #5 should be vsprintf() which is passed a buffer with insufficiently allocated space. But on the stack I see __stack_chk_fail () instead of vsprintf ().
My guess is that glibc detects a stack smashing and in the backtrace I see the abort handler instead of the call to vsprintf. Both vsprintf and Log have variable length arguments, but I am not sure that explains anything.
Thanks,
Cristi