This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [asan] Patch - fix an ICE in asan.c
- From: Tobias Burnus <burnus at net-b dot de>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc patches <gcc-patches at gcc dot gnu dot org>, Wei Mi <wmi at google dot com>, Kostya Serebryany <kcc at google dot com>, Xinliang David Li <davidxl at google dot com>, Dodji Seketeli <dodji at redhat dot com>
- Date: Sat, 10 Nov 2012 16:18:41 +0100
- Subject: Re: [asan] Patch - fix an ICE in asan.c
- References: <509D6965.5040405@net-b.de> <20121110091658.GI1886@tucnak.redhat.com> <509E53E2.5080908@net-b.de>
Tobias Burnus wrote:
So untested:
Thanks for the patch! It fixed the problem half way: It fixes the
second issue I had (fail10.ii,
http://gcc.gnu.org/ml/gcc-patches/2012-11/msg00791.html ).
However, it didn't fix the original problem: As the call for strlen
directly returns, it never reaches your patch. Hence, it doesn't fix
fail31.ii of http://gcc.gnu.org/ml/gcc-patches/2012-11/msg00786.html
If one uses the same line for strlen, it works.
I spoke too early. With the updated patch, there is no ICE, but one
crashes for the following valid program with:
==27313== ERROR: AddressSanitizer crashed on unknown address
0x13fffe8fc737 (pc 0x0000004008e3 sp 0x7fffa3f1c6d0 bp 0x7fffa3f1c700 T0)
AddressSanitizer can not provide additional info.
The crucial part is the "strlen" call.
#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[])
{
int i;
for (i = 0; i < argc; i++)
{
printf("%d: '%s':%zd\n", i, argv[i], strlen(argv[i]));
}
return 0;
}
Tobias