RFR [10] 8189800: Add support for AddressSanitizer
Artem Smotrakov
artem.smotrakov at oracle.com
Tue Oct 31 10:58:07 UTC 2017
Hi David,
That's a good question, I thought about it. According to [1]:
- recommended versions of gcc is 4.9.2
- the minimum accepted version of gcc is 4.7 (Older versions will
generate a warning by `configure` and are unlikely to work.)
- the minimum accepted version of clang is 3.2 (Older versions will not
be accepted by `configure`)
It looks like that clang has to be at least 3.2 which should contain
AddressSanitizer. Only for gcc, there may be a chance that someone wants
to use 4.7. So, we might want to check version to see if it's 4.7,
although I am not sure how many people would like to use gcc 4.7. As a
result, this case didn't look very common to me, so I preferred to
simplify the patch, and didn't add such a check.
Without version check, compilation is going to fail if gcc 4.7 is used,
and -fsanitize=address enabled.
[1]
http://hg.openjdk.java.net/jdk10/master/file/438e0c9f2f17/doc/building.md
Artem
On 10/31/2017 01:37 PM, David Holmes wrote:
> Hi Artem,
>
> On 28/10/2017 6:02 AM, Artem Smotrakov wrote:
>> Hello,
>>
>> Please review the following patch which adds support for
>> AddressSanitizer.
>>
>> AddressSanitizer is a runtime memory error detector which looks for
>> various memory corruption issues and leaks.
>>
>> Please refer to [1] for details. AddressSanitizer is available in gcc
>> 4.8+ and clang 3.1+
>
> Should we be checking the version before adding the flags?
>
> Thanks,
> David
>
>> The patch below introduces --enable-asan parameter for the configure
>> script which enables AddressSanitizer.
>>
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8189800
>> Webrev: http://cr.openjdk.java.net/~asmotrak/8189800/webrev.00/
>>
>> [1] https://github.com/google/sanitizers/wiki/AddressSanitizer
>>
>> Artem
More information about the build-dev
mailing list