[cfe-dev] How to debug a clang compiled executable.

Chris Lattner clattner at apple.com
Thu Jul 29 09:20:40 PDT 2010


On Jul 29, 2010, at 7:12 AM, Sean McBride wrote:

> On Wed, 28 Jul 2010 17:04:47 -0700, Bill Wendling said:
> 
>>> 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:
>>> 
>>> <http://lists.apple.com/archives/xcode-users/2008/Jul/msg00848.html>
>>> 
>>> 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 is one's friend, in general.
> 
>> it's aborting because of the stack protector, then you have a definite
>> buffer overrun.
> 
> That's fallacious.  It could be aborting because of a bug with -fstack-
> protector-all, which is exactly what I'm saying.  See <rdar://6105964>
> if you have access.
> 

FWIW That bug got fixed in 2008 and the fix shipped with SnowLeopard.

-Chris



More information about the cfe-dev mailing list