[cfe-dev] stack overflow detection?

Greg Fitzgerald garious at gmail.com
Tue Sep 17 15:18:16 PDT 2013


Thanks for the quick replies!


> If you want dynamic detection, then Address Sanitizer (which is built into Clang) or SAFECode

Dynamic detection.  I tried with Address Sanitizer and no luck
out-of-the-box.  I think it can detect stack-buffer-overflow (aka
stack corruption), but not stack overflow.  I also tried running the
code with ASan inside a pthread with heap-allocated memory for its
stack, but since the pthread library itself is not instrumented, it
did not detect the heap-buffer-overflow when the thread's stack
overflows.


> or SAFECode

Can you point me to an example?


Eli Friedman wrote:
> No such support exists at the moment.

Is anyone aware of another C compiler that adds instrumentation for
stack overflow detection?

Thanks,
Greg

On Tue, Sep 17, 2013 at 3:03 PM, John Criswell <criswell at illinois.edu> wrote:
> On 9/17/13 4:57 PM, Greg Fitzgerald wrote:
>>
>> Does clang offer any tools for detecting when a program is about to
>> segfault due to stack overflow?
>
>
> If you want dynamic detection, then Address Sanitizer (which is built into
> Clang) or SAFECode (which has its own version of Clang into which it is
> integrated) will do the trick.
>
> If you're asking about the Clang static analyzer, then I do not know.
>
> -- John T.
>
>>
>> Thanks,
>> Greg
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>



More information about the cfe-dev mailing list