[cfe-dev] stack overflow detection?

Kostya Serebryany kcc at google.com
Thu Oct 17 06:23:01 PDT 2013


On Fri, Oct 4, 2013 at 10:57 PM, Kostya Serebryany <kcc at google.com> wrote:

> Are you sure your test is correct?
> It looks too simplistic and the compiler may turn it into something else.
> On my x86 box:
>
> % clang z.c ; ./a.out
> Segmentation fault (core dumped)
> % clang z.c -O; ./a.out
> # <passed>
>
>
>
> On Fri, Oct 4, 2013 at 9:13 PM, Greg Fitzgerald <garious at gmail.com> wrote:
>
>> On Thu, Oct 3, 2013 at 9:58 PM, Kostya Serebryany <kcc at google.com> wrote:
>> > Meanwhile, could you try to reverse the order of these two call in
>> > asan/asan_rtl.cc and see if it helps?
>> >   InstallSignalHandlers();
>> >   AsanTSDInit(AsanThread::TSDDtor);
>>
>> That change fixes the assertion problem, but the stack overflow is
>>
>
> Good. I'll submit the change late next week.
>

Sorry for delay, committed as r192892.
The failure only affected the combination
of ASAN_OPTIONS=verbosity=1:use_sigaltstack=1 and so we didn't see it.

--kcc


>
> --kcc
>
>
>> still not detected.  Here's the code:
>>
>> static void loop() {
>>   loop();  // BOOM
>> }
>>
>> int main() {
>>   loop();
>>   return 0;
>> }
>>
>>
>> And here's how I execute it:
>>
>> $ adb  shell
>> # cd /data/data
>> # ASAN_OPTIONS=use_sigaltstack=1
>> LD_PRELOAD=/data/data/libclang_rt.asan-arm-android.so
>> ./example_StackExhaustion
>>
>>
>> -Greg
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131017/410845fc/attachment.html>


More information about the cfe-dev mailing list