* Sylvestre Ledru <[email protected]>, 2018-09-06, 10:38:
on my system (amd64)
$ ./hello
Hello world!
Right, I can't reproduce the bug on amd64 either.
What happens with
----
#include <stdlib.h>
int main() {
char *x = (char*)malloc(10 * sizeof(char*));
free(x);
return x[5];
}
---
$ clang-6.0 -o foo -fsanitize=address -O1 -g foo.c
$ ./foo
I works as expected on amd64; but on i386 I get this again:
$ ./foo
AddressSanitizer:DEADLYSIGNAL
=================================================================
==2507==ERROR: AddressSanitizer: SEGV on unknown address 0xf7fae430 (pc
0xf7fae444 bp 0xff92753c sp 0xff9274fc T16777215)
==2507==The signal is caused by a WRITE memory access.
#0 0xf7fae443 (/lib/ld-linux.so.2+0x12443)
#1 0x8159e89 (/home/jwilk/foo+0x8159e89)
#2 0x813ed32 (/home/jwilk/foo+0x813ed32)
#3 0xf7fabeda (/lib/ld-linux.so.2+0xfeda)
#4 0xf7f9d299 (/lib/ld-linux.so.2+0x1299)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/lib/ld-linux.so.2+0x12443)
==2507==ABORTING
--
Jakub Wilk