Open GoogleCodeExporter opened 9 years ago
I think ASan wiki are outdated - you can simply use official GCC 4.9.2+, it has
all the necessary patches.
@Dima: should we update the instructions on obtaining the toolchain on Kasan
wiki?
Original comment by tetra20...@gmail.com
on 12 Jan 2015 at 2:02
Thanks @tetra20, for quick reply, but it doesn't work :(
$ prasanna.k ~/Ksan/work/linux-kasan-git/kasan $ git pull
Already up-to-date
$ prasanna.k ~/Ksan/work/linux-kasan-git/kasan $ git branch
* asan
prasanna.k ~/gcc-git/gcc/install/bin $ ./gcc -v
Using built-in specs.
COLLECT_GCC=./gcc
COLLECT_LTO_WRAPPER=/home/prasanna.k/gcc-git/gcc/install/libexec/gcc/x86_64-unkn
own-linux-gnu/5.0.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --enable-languages=c,c++ --disable-bootstrap
--enable-checking=no --with-gnu-as --with-gnu-ld --with-ld=/usr/bin/ld.bfd
--prefix=/home/prasanna.k/gcc-git/gcc/install
Thread model: posix
gcc version 5.0.0 20150113 (experimental) (GCC)
$ prasanna.k ~/Ksan/work/linux-kasan-git/kasan $ make
CC=/home/prasanna.k/gcc-git/gcc/install/bin/gcc -j20
CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
CC scripts/mod/empty.o
CC scripts/mod/devicetable-offsets.s
cc1: error: invalid parameter ‘asan-fixed-shadow-offset’
cc1: error: invalid parameter ‘asan-fixed-shadow-offset’
make[2]: *** [scripts/mod/devicetable-offsets.s] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [scripts/mod/empty.o] Error 1
make[1]: *** [scripts/mod] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [scripts] Error 2
My Observation:
$ vi Makefile + 386
386 CFLAGS_KASAN = -fsanitize=address \
387 --param asan-use-after-return=0 \
388 --param asan-globals=0 \
389 --param asan-memintrin=0 \
390 --param asan-instrumentation-with-call-threshold=0 \
391 --param asan-fixed-shadow-offset=0 \
392 -DKASAN_HOOKS
all the --param options mentioned above in Makefile are added in GCC-5.0 except
`asan-fixed-shadow-offset`
Additional information:
$ gcc --param asan-use-after-return=0 global.c -o global
compilation successful
$ gcc --param asan-globals=0 global.c -o global
compilation successful
$ gcc --param asan-memintrin=0 global.c -o global
compilation successful
$ gcc --param asan-instrumentation-with-call-threshold=0 global.c -o global
compilation successful
$ gcc --param asan-fixed-shadow-offset=0 global.c -o global
cc1: error: invalid parameter ‘asan-fixed-shadow-offset’
Sources:
Kernel: https://github.com/google/kasan.git
GCC: https://github.com/gcc-mirror/gcc.git
I'm I missing something??
Any hint will be highly appreciated.
Thanks in advance.
Original comment by prasanna...@gmail.com
on 13 Jan 2015 at 6:16
'asan' branch is outdated and not supported anymore.
Use the 'kasan' branch. That branch has uptodate documentation which could be
usefull
https://github.com/google/kasan/blob/kasan/Documentation/kasan.txt
Original comment by Ryabinin...@gmail.com
on 13 Jan 2015 at 7:10
I haven't noticed this, please update it in wiki.
Many starting users like me are facing problems in setting-up KASAN environment.
Thank you @Ryabinin.. your valuable comment helped and reduced my pain in setup.
Finally the compilation is successful :).
Original comment by prasanna...@gmail.com
on 14 Jan 2015 at 6:02
> I haven't noticed this, please update it in wiki.
Absolutely, wiki has totally rotten.
Original comment by tetra20...@gmail.com
on 14 Jan 2015 at 8:08
I can update in the evening if noone outpaces me.
Original comment by tetra20...@gmail.com
on 14 Jan 2015 at 8:09
> I can update in the evening if noone outpaces me.
It took me 4 days to do this work with all yours help.
updating wiki will really helpful to many like me :)
Thank you @tetra20 please go ahead..
Original comment by prasanna...@gmail.com
on 14 Jan 2015 at 9:09
[deleted comment]
@tetra20 you have done a good job.
But please update everything...
1. write regarding changing the branch
$ git checkout kasan
2. It is written current KASN supports only SLAB, please change it to SLUB
the below line is outdated
>"You will also need to enable SLAB allocator (General setup > Choose SLAB
>allocator) and AddressSanitizer (Kernel hacking > Memory Debugging) during
>kernel configuration"
can be updated with:
You will also need to enable SLUB allocator (General setup > Choose SLAB
allocator (SLUB (Unqueued Allocator)) and AddressSanitizer (Kernel hacking >
Memory Debugging > AddressSanitizer: runtime memory debugger ) during kernel
configuration
please update the procedure
1. CONFIG_KASAN = y
2. choose b/w CONFIG_KASAN_OUTLINE or CONFIG_KASAN_INLINE
3. mention regarding advantages of enabling CONFIG_STACKTRACE and
4. finally testing 'lib/test_kasan.ko'
I think that way is very essential as mentioned in
https://github.com/google/kasan/blob/kasan/Documentation/kasan.txt
Looking forward for you help and support..
Best regards :)
Original comment by prasanna...@gmail.com
on 19 Jan 2015 at 7:24
Done! Does this look saner?
Original comment by tetra2...@gmail.com
on 21 Jan 2015 at 3:24
Hmmm,
this is much better @tetra20.. :)
Now any one can easily catch-up and use the KASAN.
thanks for your effort in updating this page.
Thanks & Best regards.
Original comment by prasanna...@gmail.com
on 21 Jan 2015 at 3:37
Adding Project:AddressSanitizer as part of GitHub migration.
Original comment by ramosian.glider@gmail.com
on 30 Jul 2015 at 9:06
Original issue reported on code.google.com by
prasanna...@gmail.com
on 12 Jan 2015 at 2:51