[cfe-dev] How to debug a clang compiled executable.
wendling at apple.com
Wed Jul 28 17:04:47 PDT 2010
On Jul 28, 2010, at 1:29 PM, Sean McBride wrote:
> On Wed, 28 Jul 2010 15:58:17 -0400, Michael Jackson said:
>> Program received signal SIGABRT, Aborted.
>> 0x92993e42 in __kill ()
>> (gdb) bt
>> #0 0x92993e42 in __kill ()
>> #1 0x92993e34 in kill$UNIX2003 ()
>> #2 0x92a0623a in raise ()
>> #3 0x92a12622 in __abort ()
>> #4 0x929de43e in __chk_fail ()
>> #5 0x929c1ca9 in __strncat_chk ()
>> Die: DW_TAG_restrict_type (abbrev = 33, offset = 7574)
>> has children: FALSE
>> DW_AT_type (DW_FORM_ref4) constant ref: 3194 (adjusted)
>> DW_AT_decl_file (DW_FORM_data1) constant: 2
>> DW_AT_decl_line (DW_FORM_data1) constant: 0
>> Dwarf Error: Cannot find type of die [in module /Users/Shared/Kitware-
>> The program was compiled with the following:
>> /Users/Shared/Toolkits/llvm/bin/clang -DVTK_IN_VTK -Wall -Wextra -
>> Wformat=2 -Wno-format-nonliteral -Wunused -Wpointer-arith -Winvalid-
>> pch -Wcast-align -Wdisabled-optimization -Wnewline-eof -fdiagnostics-
>> show-option -Wno-deprecated-declarations -Wno-uninitialized -g -fstack-
>> protector-all -D_FORTIFY_SOURCE=2 -g -arch i386 ....
> strncat_chk is used because you defined _FORTIFY_SOURCE. IIRC, it helps
> check for overruns using C string functions. I believe in 10.5 the
> _FORTIFY_SOURCE version of strncat was screwy, ah, here you go:
> I think it's fixed on 10.6.
> Try again without -D_FORTIFY_SOURCE=2, and maybe remove -fstack-
> protector-all too.
Ewww...don't remove the "-fstack-protector-all". It's your friend. :) If it's aborting because of the stack protector, then you have a definite buffer overrun.
More information about the cfe-dev