[Openvpn-devel] travis: use clang's -fsanitize=address to catch more bugs

Message ID 1514540857-19290-1-git-send-email-steffan.karger@fox-it.com
State Accepted
Headers show
Series [Openvpn-devel] travis: use clang's -fsanitize=address to catch more bugs | expand

Commit Message

Steffan Karger Dec. 28, 2017, 10:47 p.m. UTC
The clang address sanitizer is able to catch quite a number of
memory-related bugs, such add memory leaks and buffer under/overruns.
So, enable the address sanitizer for one openssl and one mbedtls build.

This would have caught the buffer list unittest memory leak that
<1512724338-22197-1-git-send-email-steffan@karger.me> wants to fix.

Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
---
 .travis.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Gert Doering Jan. 9, 2018, 3:31 a.m. UTC | #1
ACK, makes sense.

Your patch has been applied to the master branch.

commit 7b11915ddfe97d8c28f998db54c40384a4eafb93
Author: Steffan Karger
Date:   Fri Dec 29 10:47:37 2017 +0100

     travis: use clang's -fsanitize=address to catch more bugs

     Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
     Acked-by: Gert Doering <gert@greenie.muc.de>
     Message-Id: <1514540857-19290-1-git-send-email-steffan.karger@fox-it.com>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg16102.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Steffan Karger Jan. 11, 2018, 2:55 a.m. UTC | #2
Hi,

On 09-01-18 15:31, Gert Doering wrote:
> ACK, makes sense.
> 
> Your patch has been applied to the master branch.

Thanks.  Can you also cherry-pick this one to release/2.4?  Because
there the clang builds are now screaming bloody murder (and sometimes
failing) because of ccache too.

-Steffan

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Gert Doering Jan. 11, 2018, 3:01 a.m. UTC | #3
Hi,

On Thu, Jan 11, 2018 at 02:55:37PM +0100, Steffan Karger wrote:
> On 09-01-18 15:31, Gert Doering wrote:
> > ACK, makes sense.
> > 
> > Your patch has been applied to the master branch.
> 
> Thanks.  Can you also cherry-pick this one to release/2.4?  Because
> there the clang builds are now screaming bloody murder (and sometimes
> failing) because of ccache too.

Uh.  Which one?  *this* one is about -fsanitize-address...?

I assume you want this one:

commit 0c1b9864184e609b68c2bb317ee57317ae12a026
Author: Ilya Shipitsin <chipitsine@gmail.com>
Date:   Fri Jan 5 00:37:10 2018 +0500

    travis-ci: add brew cache, remove ccache
    


right?

gert
Steffan Karger Jan. 11, 2018, 3:42 a.m. UTC | #4
On 11-01-18 15:01, Gert Doering wrote:
> On Thu, Jan 11, 2018 at 02:55:37PM +0100, Steffan Karger wrote:
>> On 09-01-18 15:31, Gert Doering wrote:
>>> ACK, makes sense.
>>>
>>> Your patch has been applied to the master branch.
>>
>> Thanks.  Can you also cherry-pick this one to release/2.4?  Because
>> there the clang builds are now screaming bloody murder (and sometimes
>> failing) because of ccache too.
> 
> Uh.  Which one?  *this* one is about -fsanitize-address...?
> 
> I assume you want this one:
> 
> commit 0c1b9864184e609b68c2bb317ee57317ae12a026
> Author: Ilya Shipitsin <chipitsine@gmail.com>
> Date:   Fri Jan 5 00:37:10 2018 +0500
> 
>     travis-ci: add brew cache, remove ccache
>     
> 
> 
> right?

Uh, right.  Though this one is useful too ;-)

-Steffan


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Gert Doering Jan. 11, 2018, 5:13 a.m. UTC | #5
Hi,

On Thu, Jan 11, 2018 at 03:42:44PM +0100, Steffan Karger wrote:
> Uh, right.  Though this one is useful too ;-)

ok, so here's 2.4 updates...

commit b968f43f9142f832483ae91c8b4e44a5c9efed57 (HEAD -> release/2.4)
Author: Ilya Shipitsin <chipitsine@gmail.com>
Date:   Fri Jan 5 00:37:10 2018 +0500

    travis-ci: add brew cache, remove ccache
    (cherry picked from commit 0c1b9864184e609b68c2bb317ee57317ae12a026)


commit a5dc64653e261a233cc9df0b5adc46767b544645 (HEAD -> release/2.4)
Author: Steffan Karger <steffan.karger@fox-it.com>
Date:   Fri Dec 29 10:47:37 2017 +0100

    travis: use clang's -fsanitize=address to catch more bugs
    (cherry picked from commit 7b11915ddfe97d8c28f998db54c40384a4eafb93)


(cherry-picked from master, no code changes)

gert

Patch

diff --git a/.travis.yml b/.travis.yml
index 1f669b3..99cd5e2 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -33,7 +33,7 @@  matrix:
     - env: SSLLIB="openssl" OPENSSL_VERSION="1.1.0f"
       os: linux
       compiler: gcc
-    - env: SSLLIB="openssl"
+    - env: SSLLIB="openssl" CFLAGS="-fsanitize=address"
       os: linux
       compiler: clang
     - env: SSLLIB="openssl" OPENSSL_VERSION="1.1.0f"
@@ -42,7 +42,7 @@  matrix:
     - env: SSLLIB="mbedtls"
       os: linux
       compiler: gcc
-    - env: SSLLIB="mbedtls"
+    - env: SSLLIB="mbedtls" CFLAGS="-fsanitize=address"
       os: linux
       compiler: clang
     - env: SSLLIB="openssl"