Re: RFR: JDK-8298908: Instrument Metaspace for ASan [v2]

2023-05-04 Thread Justin King
The macros defined in sanitizer/asan_interface.h and in our header are the same. For consistency I just re-defined them. When the header is available, since it looks like the macros have been there for a long time, we can just skip redefining it and use them directly. I'll add a comment. On Tue, J

Re: RFR: JDK-8298908: Instrument Metaspace for ASan [v2]

2023-01-10 Thread Justin King
On Tue, 10 Jan 2023 17:05:48 GMT, Ioi Lam wrote: >> I don't believe so, at least not based on current options. Other projects >> use similar tricks, like ABSL_DCHECK from Abseil which short circuits >> expressions when in non-debug builds causing the code to be unreachable and >> stripped. If

Re: RFR: JDK-8298908: Instrument Metaspace for ASan [v2]

2023-01-10 Thread Ioi Lam
On Mon, 9 Jan 2023 15:48:48 GMT, Justin King wrote: >> I like this, but would compilers not complain about unused statements? > > I don't believe so, at least not based on current options. Other projects use > similar tricks, like ABSL_DCHECK from Abseil which short circuits expressions > when

Re: RFR: JDK-8298908: Instrument Metaspace for ASan [v2]

2023-01-10 Thread Justin King
On Tue, 10 Jan 2023 06:57:01 GMT, David Holmes wrote: >> This doesn't look "too terrible", but I can't comment on the actual >> poisoning strategies. >> >> Cheers. > >> Forcing 2 reviewers to ensure @dholmes-ora can chime in before moving >> forward. > > Well I won't be able to Review as not

Re: RFR: JDK-8298908: Instrument Metaspace for ASan [v2]

2023-01-10 Thread Thomas Stuefe
On Tue, 10 Jan 2023 06:57:01 GMT, David Holmes wrote: > > Forcing 2 reviewers to ensure @dholmes-ora can chime in before moving > > forward. > > Well I won't be able to Review as not familiar enough with the code, so > you'll need a second reviewer anyway. I don't hate this to the point of >

Re: RFR: JDK-8298908: Instrument Metaspace for ASan [v2]

2023-01-09 Thread David Holmes
On Wed, 4 Jan 2023 06:22:11 GMT, David Holmes wrote: >> Justin King has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Exclude more zapping when ASan is in use >> >> Signed-off-by: Justin King > > This doesn't look "too terrible", but

Re: RFR: JDK-8298908: Instrument Metaspace for ASan [v2]

2023-01-09 Thread Justin King
On Wed, 4 Jan 2023 06:22:11 GMT, David Holmes wrote: >> Justin King has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Exclude more zapping when ASan is in use >> >> Signed-off-by: Justin King > > This doesn't look "too terrible", but

Re: RFR: JDK-8298908: Instrument Metaspace for ASan [v2]

2023-01-09 Thread Justin King
On Mon, 9 Jan 2023 08:05:47 GMT, Thomas Stuefe wrote: >> Ah I see. > > I like this, but would compilers not complain about unused statements? I don't believe so, at least not based on current options. Other projects use similar tricks, like ABSL_DCHECK from Abseil which short circuits expressio

Re: RFR: JDK-8298908: Instrument Metaspace for ASan [v2]

2023-01-09 Thread Thomas Stuefe
On Thu, 5 Jan 2023 02:53:54 GMT, David Holmes wrote: >> This helps with maintenance. All builds will still compile the `addr` and >> `size` statements, ensuring they are valid, but will strip them when ASan is >> not enabled. In the event that refactoring occurs and one of the statements >> be

Re: RFR: JDK-8298908: Instrument Metaspace for ASan [v2]

2023-01-04 Thread David Holmes
On Wed, 4 Jan 2023 13:55:33 GMT, Justin King wrote: >> src/hotspot/share/sanitizers/address.h line 56: >> >>> 54: #else >>> 55: // NOOP implementation which preserves the arguments, ensuring they >>> still compile, but ensures they >>> 56: // are stripped due to being unreachable. >> >> Why is

Re: RFR: JDK-8298908: Instrument Metaspace for ASan [v2]

2023-01-04 Thread Justin King
On Wed, 4 Jan 2023 06:21:26 GMT, David Holmes wrote: >> Justin King has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Exclude more zapping when ASan is in use >> >> Signed-off-by: Justin King > > src/hotspot/share/sanitizers/address.

Re: RFR: JDK-8298908: Instrument Metaspace for ASan [v2]

2023-01-04 Thread Justin King
On Wed, 4 Jan 2023 06:00:36 GMT, David Holmes wrote: >> Justin King has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Exclude more zapping when ASan is in use >> >> Signed-off-by: Justin King > > src/hotspot/share/runtime/os.cpp line

Re: RFR: JDK-8298908: Instrument Metaspace for ASan [v2]

2023-01-03 Thread David Holmes
On Sat, 17 Dec 2022 06:48:13 GMT, Justin King wrote: >> This change instruments Metaspace for ASan. Metaspace allocates memory using >> `mmap`/`munmap` which ASan is not aware of. Fortunately ASan supports >> applications [manually poisoning/unpoisoning >> memory](https://github.com/google/san