Change in openvpn[master]: Fix compilation with --with-mem-check=dmalloc
A message that is not in the archive (sent off-list or not yet received): gerrit.1773842036000.I4920318ac537064508eee3ca449d48de76c2ea5d@gerrit.openvpn.net
Attention is currently required from: flichtenheld.
plaisthos has posted comments on this change by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1582?usp=email )
Change subject: Fix compilation with --with-mem-check=dmalloc
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
I wonder if we should just remove dmalloc support. I don't think anyone has use this in a long time and nowadays I think ASAN does 90% what dmalloc does anyway.
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1582?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I4920318ac537064508eee3ca449d48de76c2ea5d
Gerrit-Change-Number: 1582
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]>
Gerrit-Reviewer: plaisthos <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]>
Gerrit-Comment-Date: Fri, 24 Jul 2026 17:51:32 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
[Openvpn-devel] [M] Change in openvpn[master]: Remove --with-mem-check=dmalloc
In reply to a message not in the archiveAttention is currently required from: flichtenheld.
Hello plaisthos,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/1582?usp=email
to look at the new patch set (#2).
Change subject: Remove --with-mem-check=dmalloc
......................................................................
Remove --with-mem-check=dmalloc
This code hasn't compiled for years and noone complained. We generally use ASAN instead.
So remove the dead code.
v2: The first version of this change tried to fix the
code. v2 instead removes it.
---
M CMakeLists.txt
M config.h.cmake.in
M configure.ac
M src/openvpn/buffer.c
M src/openvpn/buffer.h
M src/openvpn/crypto_backend.h
M src/openvpn/crypto_mbedtls_legacy.c
M src/openvpn/crypto_openssl.c
M src/openvpn/init.c
M src/openvpn/memdbg.h
10 files changed, 5 insertions(+), 225 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/82/1582/2
CMakeLists.txt +0 -1
@@ -260,7 +260,6 @@ check_include_files(arpa/inet.h HAVE_ARPA_INET_H) check_include_files(dlfcn.h HAVE_DLFCN_H) -check_include_files(dmalloc.h HAVE_DMALLOC_H) check_include_files(fcntl.h HAVE_FCNTL_H) check_include_files(err.h HAVE_ERR_H) check_include_files(netdb.h HAVE_NETDB_H)
config.h.cmake.in +0 -3
@@ -96,9 +96,6 @@ /* Define to 1 if you have the <dlfcn.h> header file. */ #cmakedefine HAVE_DLFCN_H -/* Define to 1 if you have the <dmalloc.h> header file. */ -#cmakedefine HAVE_DMALLOC_H - /* Define to 1 if you have the `dup' function. */ #cmakedefine HAVE_DUP
configure.ac +2 -21
@@ -245,10 +245,10 @@ AC_ARG_WITH( [mem-check], - [AS_HELP_STRING([--with-mem-check=TYPE], [build with debug memory checking, TYPE=no|dmalloc|valgrind|ssl @<:@default=no@:>@])], + [AS_HELP_STRING([--with-mem-check=TYPE], [build with debug memory checking, TYPE=no|valgrind|ssl @<:@default=no@:>@])], [ case "${withval}" in - dmalloc|valgrind|ssl|no) ;; + valgrind|ssl|no) ;; *) AC_MSG_ERROR([bad value ${withval} for --mem-check]) ;; esac ],
@@ -652,25 +652,6 @@ [AC_MSG_ERROR([valgrind headers not found.])] ) ;; - dmalloc) - AC_CHECK_HEADERS( - [dmalloc.h], - [AC_CHECK_LIB( - [dmalloc], - [malloc], - [ - LIBS="${LIBS} -ldmalloc" - AC_DEFINE( - [DMALLOC], - [1], - [Use dmalloc memory debugging library] - ) - ], - [AC_MSG_ERROR([dmalloc library not found.])] - )], - [AC_MSG_ERROR([dmalloc headers not found.])] - ) - ;; ssl) AC_CHECK_LIB( [ssl],
src/openvpn/buffer.c +1 -57
160 lines not on this page · raw message
src/openvpn/buffer.h +0 -28
@@ -147,32 +147,6 @@void buf_size_error (const size_t size); -/* for dmalloc debugging */ - -#ifdef DMALLOC - -#define alloc_buf (size) alloc_buf_debug(size, __FILE__, __LINE__) -#define alloc_buf_gc (size, gc) alloc_buf_gc_debug(size, gc, __FILE__, __LINE__); -#define clone_buf (buf) clone_buf_debug(buf, __FILE__, __LINE__); -#define gc_malloc (size, clear, arena) gc_malloc_debug(size, clear, arena, __FILE__, __LINE__) -#define string_alloc (str, gc) string_alloc_debug(str, gc, __FILE__, __LINE__) -#define string_alloc_buf (str, gc) string_alloc_buf_debug(str, gc, __FILE__, __LINE__) - -struct buffer alloc_buf_debug (size_t size,const char *file,int line); - -struct buffer alloc_buf_gc_debug (size_t size,struct gc_arena *gc,const char *file,int line); - -struct buffer clone_buf_debug (const struct buffer *buf,const char *file,int line); - -void *gc_malloc_debug (size_t size,bool clear,struct gc_arena *a,const char *file,int line); - -char *string_alloc_debug (const char *str,struct gc_arena *gc,const char *file,int line); - -struct buffer string_alloc_buf_debug (const char *str,struct gc_arena *gc,const char *file, -int line); - -#else /* ifdef DMALLOC */ -struct buffer alloc_buf (size_t size); struct buffer alloc_buf_gc(size_t size,
@@ -186,8 +160,6 @@struct buffer string_alloc_buf (const char *str,struct gc_arena *gc); -#endif /* ifdef DMALLOC */ -void gc_addspecial (void *addr,void (*free_function)(void *),struct gc_arena *a);/**
src/openvpn/crypto_backend.h +0 -10
@@ -102,16 +102,6 @@*/ void crypto_unload_provider (const char *provname,provider_t *provider); -#ifdef DMALLOC -/* -* OpenSSL memory debugging. If dmalloc debugging is enabled, tell -* OpenSSL to use our private malloc/realloc/free functions so that -* we can dispatch them to dmalloc. -*/ -void crypto_init_dmalloc (void ); - -#endif /* DMALLOC */ -void show_available_ciphers (void );void show_available_digests (void );
src/openvpn/crypto_mbedtls_legacy.c +0 -8
@@ -139,14 +139,6 @@ } -#ifdef DMALLOC -void -crypto_init_dmalloc (void ) -{ -msg (M_ERR ,"Error: dmalloc support is not available for mbed TLS." ); -} -#endif /* DMALLOC */ -const cipher_name_pair cipher_name_translation_table[] = { {"BF-CBC" ,"BLOWFISH-CBC" }, {"BF-CFB" ,"BLOWFISH-CFB64" },
src/openvpn/crypto_openssl.c +1 -34
@@ -39,6 +39,7 @@#include "integer.h" #include "crypto.h" #include "crypto_backend.h" +#include "memdbg.h" #include "openssl_compat.h" #include <openssl/conf.h>
@@ -273,40 +274,6 @@ } -/* -* -* OpenSSL memory debugging. If dmalloc debugging is enabled, tell -* OpenSSL to use our private malloc/realloc/free functions so that -* we can dispatch them to dmalloc. -* -*/ - -#ifdef DMALLOC -static void * -crypto_malloc (size_t size,const char *file,int line) -{ -return dmalloc_malloc (file, line, size,DMALLOC_FUNC_MALLOC ,0 ,0 ); -} - -static void * -crypto_realloc (void *ptr,size_t size,const char *file,int line) -{ -return dmalloc_realloc (file, line, ptr, size,DMALLOC_FUNC_REALLOC ,0 ); -} - -static void -crypto_free (void *ptr) -{ -dmalloc_free (__FILE__, __LINE__, ptr,DMALLOC_FUNC_FREE ); -} - -void -crypto_init_dmalloc (void ) -{ -CRYPTO_set_mem_ex_functions (crypto_malloc, crypto_realloc, crypto_free); -} -#endif /* DMALLOC */ -const cipher_name_pair cipher_name_translation_table[] = { {"AES-128-GCM" ,"id-aes128-GCM" }, {"AES-192-GCM" ,"id-aes192-GCM" },
src/openvpn/init.c +0 -5
@@ -838,11 +838,6 @@bool init_static (void ) { -#if defined(DMALLOC ) -crypto_init_dmalloc (); -#endif - -/* * Initialize random number seed. random() is only used * when "weak" random numbers are acceptable.
src/openvpn/memdbg.h +1 -58
68 lines not on this page · raw message
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1582?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I4920318ac537064508eee3ca449d48de76c2ea5d
Gerrit-Change-Number: 1582
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]>
Gerrit-Reviewer: plaisthos <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
PATCH v2 1/1 Remove --with-mem-check=dmalloc
In reply to a message not in the archiveThis code hasn't compiled for years and noone complained. We generally use ASAN instead.
So remove the dead code.
v2: The first version of this change tried to fix the
code. v2 instead removes it.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1582
---
This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1582
This mail reflects revision 2 of this Change.
Acked-by according to Gerrit (reflected above):
Arne Schwabe <[email protected]>
CMakeLists.txt +0 -1
@@ -260,7 +260,6 @@ check_include_files(arpa/inet.h HAVE_ARPA_INET_H) check_include_files(dlfcn.h HAVE_DLFCN_H) -check_include_files(dmalloc.h HAVE_DMALLOC_H) check_include_files(fcntl.h HAVE_FCNTL_H) check_include_files(err.h HAVE_ERR_H) check_include_files(netdb.h HAVE_NETDB_H)
config.h.cmake.in +0 -3
@@ -96,9 +96,6 @@ /* Define to 1 if you have the <dlfcn.h> header file. */ #cmakedefine HAVE_DLFCN_H -/* Define to 1 if you have the <dmalloc.h> header file. */ -#cmakedefine HAVE_DMALLOC_H - /* Define to 1 if you have the `dup' function. */ #cmakedefine HAVE_DUP
configure.ac +2 -21
@@ -245,10 +245,10 @@ AC_ARG_WITH( [mem-check], - [AS_HELP_STRING([--with-mem-check=TYPE], [build with debug memory checking, TYPE=no|dmalloc|valgrind|ssl @<:@default=no@:>@])], + [AS_HELP_STRING([--with-mem-check=TYPE], [build with debug memory checking, TYPE=no|valgrind|ssl @<:@default=no@:>@])], [ case "${withval}" in - dmalloc|valgrind|ssl|no) ;; + valgrind|ssl|no) ;; *) AC_MSG_ERROR([bad value ${withval} for --mem-check]) ;; esac ],
@@ -652,25 +652,6 @@ [AC_MSG_ERROR([valgrind headers not found.])] ) ;; - dmalloc) - AC_CHECK_HEADERS( - [dmalloc.h], - [AC_CHECK_LIB( - [dmalloc], - [malloc], - [ - LIBS="${LIBS} -ldmalloc" - AC_DEFINE( - [DMALLOC], - [1], - [Use dmalloc memory debugging library] - ) - ], - [AC_MSG_ERROR([dmalloc library not found.])] - )], - [AC_MSG_ERROR([dmalloc headers not found.])] - ) - ;; ssl) AC_CHECK_LIB( [ssl],
src/openvpn/buffer.c +1 -57
160 lines not on this page · raw message
src/openvpn/buffer.h +0 -28
@@ -147,32 +147,6 @@void buf_size_error (const size_t size); -/* for dmalloc debugging */ - -#ifdef DMALLOC - -#define alloc_buf (size) alloc_buf_debug(size, __FILE__, __LINE__) -#define alloc_buf_gc (size, gc) alloc_buf_gc_debug(size, gc, __FILE__, __LINE__); -#define clone_buf (buf) clone_buf_debug(buf, __FILE__, __LINE__); -#define gc_malloc (size, clear, arena) gc_malloc_debug(size, clear, arena, __FILE__, __LINE__) -#define string_alloc (str, gc) string_alloc_debug(str, gc, __FILE__, __LINE__) -#define string_alloc_buf (str, gc) string_alloc_buf_debug(str, gc, __FILE__, __LINE__) - -struct buffer alloc_buf_debug (size_t size,const char *file,int line); - -struct buffer alloc_buf_gc_debug (size_t size,struct gc_arena *gc,const char *file,int line); - -struct buffer clone_buf_debug (const struct buffer *buf,const char *file,int line); - -void *gc_malloc_debug (size_t size,bool clear,struct gc_arena *a,const char *file,int line); - -char *string_alloc_debug (const char *str,struct gc_arena *gc,const char *file,int line); - -struct buffer string_alloc_buf_debug (const char *str,struct gc_arena *gc,const char *file, -int line); - -#else /* ifdef DMALLOC */ -struct buffer alloc_buf (size_t size); struct buffer alloc_buf_gc(size_t size,
@@ -186,8 +160,6 @@struct buffer string_alloc_buf (const char *str,struct gc_arena *gc); -#endif /* ifdef DMALLOC */ -void gc_addspecial (void *addr,void (*free_function)(void *),struct gc_arena *a);/**
src/openvpn/crypto_backend.h +0 -10
@@ -102,16 +102,6 @@*/ void crypto_unload_provider (const char *provname,provider_t *provider); -#ifdef DMALLOC -/* -* OpenSSL memory debugging. If dmalloc debugging is enabled, tell -* OpenSSL to use our private malloc/realloc/free functions so that -* we can dispatch them to dmalloc. -*/ -void crypto_init_dmalloc (void ); - -#endif /* DMALLOC */ -void show_available_ciphers (void );void show_available_digests (void );
src/openvpn/crypto_mbedtls_legacy.c +0 -8
@@ -139,14 +139,6 @@ } -#ifdef DMALLOC -void -crypto_init_dmalloc (void ) -{ -msg (M_ERR ,"Error: dmalloc support is not available for mbed TLS." ); -} -#endif /* DMALLOC */ -const cipher_name_pair cipher_name_translation_table[] = { {"BF-CBC" ,"BLOWFISH-CBC" }, {"BF-CFB" ,"BLOWFISH-CFB64" },
src/openvpn/crypto_openssl.c +1 -34
@@ -39,6 +39,7 @@#include "integer.h" #include "crypto.h" #include "crypto_backend.h" +#include "memdbg.h" #include "openssl_compat.h" #include <openssl/conf.h>
@@ -273,40 +274,6 @@ } -/* -* -* OpenSSL memory debugging. If dmalloc debugging is enabled, tell -* OpenSSL to use our private malloc/realloc/free functions so that -* we can dispatch them to dmalloc. -* -*/ - -#ifdef DMALLOC -static void * -crypto_malloc (size_t size,const char *file,int line) -{ -return dmalloc_malloc (file, line, size,DMALLOC_FUNC_MALLOC ,0 ,0 ); -} - -static void * -crypto_realloc (void *ptr,size_t size,const char *file,int line) -{ -return dmalloc_realloc (file, line, ptr, size,DMALLOC_FUNC_REALLOC ,0 ); -} - -static void -crypto_free (void *ptr) -{ -dmalloc_free (__FILE__, __LINE__, ptr,DMALLOC_FUNC_FREE ); -} - -void -crypto_init_dmalloc (void ) -{ -CRYPTO_set_mem_ex_functions (crypto_malloc, crypto_realloc, crypto_free); -} -#endif /* DMALLOC */ -const cipher_name_pair cipher_name_translation_table[] = { {"AES-128-GCM" ,"id-aes128-GCM" }, {"AES-192-GCM" ,"id-aes192-GCM" },
src/openvpn/init.c +0 -5
@@ -838,11 +838,6 @@bool init_static (void ) { -#if defined(DMALLOC ) -crypto_init_dmalloc (); -#endif - -/* * Initialize random number seed. random() is only used * when "weak" random numbers are acceptable.
src/openvpn/memdbg.h +1 -58
68 lines not on this page · raw message
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
[Openvpn-devel] [PATCH applied] Re: Remove --with-mem-check=dmalloc
Removing test code that is no longer used (and does no longer compile at all) sounds like a good plan to keep the rest easier to read...
Test compiled on FreeBSD plus a bit stare-at-code.
Your patch has been applied to the master branch.
commit 1219685ad8eda403d1b9afcf630f3c8b09f2c347
Author: Frank Lichtenheld Date: Fri Aug 7 15:15:39 2026 +0200
Remove --with-mem-check=dmalloc
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1582
Message-Id: <[email protected]>
URL: https://www.mail-archive.com/[email protected]/msg38208.html
--
kind regards,
Gert Doering
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
[Openvpn-devel] [M] Change in openvpn[master]: Remove --with-mem-check=dmalloc
In reply to a message not in the archiveAttention is currently required from: flichtenheld.
plaisthos has posted comments on this change by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1582?usp=email )
Change subject: Remove --with-mem-check=dmalloc
......................................................................
Patch Set 2: Code-Review+2
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1582?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I4920318ac537064508eee3ca449d48de76c2ea5d
Gerrit-Change-Number: 1582
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]>
Gerrit-Reviewer: plaisthos <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]>
Gerrit-Comment-Date: Fri, 07 Aug 2026 12:52:00 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
PATCH v2 1/1 Remove --with-mem-check=dmalloc
In reply to a message not in the archiveFrom: Frank Lichtenheld <[email protected]>
This code hasn't compiled for years and noone complained. We generally use ASAN instead.
So remove the dead code.
v2: The first version of this change tried to fix the
code. v2 instead removes it.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1582
---
This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1582
This mail reflects revision 2 of this Change.
Acked-by according to Gerrit (reflected above):
Arne Schwabe <[email protected]>
CMakeLists.txt +0 -1
@@ -260,7 +260,6 @@ check_include_files(arpa/inet.h HAVE_ARPA_INET_H) check_include_files(dlfcn.h HAVE_DLFCN_H) -check_include_files(dmalloc.h HAVE_DMALLOC_H) check_include_files(fcntl.h HAVE_FCNTL_H) check_include_files(err.h HAVE_ERR_H) check_include_files(netdb.h HAVE_NETDB_H)
config.h.cmake.in +0 -3
@@ -96,9 +96,6 @@ /* Define to 1 if you have the <dlfcn.h> header file. */ #cmakedefine HAVE_DLFCN_H -/* Define to 1 if you have the <dmalloc.h> header file. */ -#cmakedefine HAVE_DMALLOC_H - /* Define to 1 if you have the `dup' function. */ #cmakedefine HAVE_DUP
configure.ac +2 -21
@@ -245,10 +245,10 @@ AC_ARG_WITH( [mem-check], - [AS_HELP_STRING([--with-mem-check=TYPE], [build with debug memory checking, TYPE=no|dmalloc|valgrind|ssl @<:@default=no@:>@])], + [AS_HELP_STRING([--with-mem-check=TYPE], [build with debug memory checking, TYPE=no|valgrind|ssl @<:@default=no@:>@])], [ case "${withval}" in - dmalloc|valgrind|ssl|no) ;; + valgrind|ssl|no) ;; *) AC_MSG_ERROR([bad value ${withval} for --mem-check]) ;; esac ],
@@ -652,25 +652,6 @@ [AC_MSG_ERROR([valgrind headers not found.])] ) ;; - dmalloc) - AC_CHECK_HEADERS( - [dmalloc.h], - [AC_CHECK_LIB( - [dmalloc], - [malloc], - [ - LIBS="${LIBS} -ldmalloc" - AC_DEFINE( - [DMALLOC], - [1], - [Use dmalloc memory debugging library] - ) - ], - [AC_MSG_ERROR([dmalloc library not found.])] - )], - [AC_MSG_ERROR([dmalloc headers not found.])] - ) - ;; ssl) AC_CHECK_LIB( [ssl],
src/openvpn/buffer.c +1 -57
160 lines not on this page · raw message
src/openvpn/buffer.h +0 -28
@@ -147,32 +147,6 @@void buf_size_error (const size_t size); -/* for dmalloc debugging */ - -#ifdef DMALLOC - -#define alloc_buf (size) alloc_buf_debug(size, __FILE__, __LINE__) -#define alloc_buf_gc (size, gc) alloc_buf_gc_debug(size, gc, __FILE__, __LINE__); -#define clone_buf (buf) clone_buf_debug(buf, __FILE__, __LINE__); -#define gc_malloc (size, clear, arena) gc_malloc_debug(size, clear, arena, __FILE__, __LINE__) -#define string_alloc (str, gc) string_alloc_debug(str, gc, __FILE__, __LINE__) -#define string_alloc_buf (str, gc) string_alloc_buf_debug(str, gc, __FILE__, __LINE__) - -struct buffer alloc_buf_debug (size_t size,const char *file,int line); - -struct buffer alloc_buf_gc_debug (size_t size,struct gc_arena *gc,const char *file,int line); - -struct buffer clone_buf_debug (const struct buffer *buf,const char *file,int line); - -void *gc_malloc_debug (size_t size,bool clear,struct gc_arena *a,const char *file,int line); - -char *string_alloc_debug (const char *str,struct gc_arena *gc,const char *file,int line); - -struct buffer string_alloc_buf_debug (const char *str,struct gc_arena *gc,const char *file, -int line); - -#else /* ifdef DMALLOC */ -struct buffer alloc_buf (size_t size); struct buffer alloc_buf_gc(size_t size,
@@ -186,8 +160,6 @@struct buffer string_alloc_buf (const char *str,struct gc_arena *gc); -#endif /* ifdef DMALLOC */ -void gc_addspecial (void *addr,void (*free_function)(void *),struct gc_arena *a);/**
src/openvpn/crypto_backend.h +0 -10
@@ -102,16 +102,6 @@*/ void crypto_unload_provider (const char *provname,provider_t *provider); -#ifdef DMALLOC -/* -* OpenSSL memory debugging. If dmalloc debugging is enabled, tell -* OpenSSL to use our private malloc/realloc/free functions so that -* we can dispatch them to dmalloc. -*/ -void crypto_init_dmalloc (void ); - -#endif /* DMALLOC */ -void show_available_ciphers (void );void show_available_digests (void );
src/openvpn/crypto_mbedtls_legacy.c +0 -8
@@ -139,14 +139,6 @@ } -#ifdef DMALLOC -void -crypto_init_dmalloc (void ) -{ -msg (M_ERR ,"Error: dmalloc support is not available for mbed TLS." ); -} -#endif /* DMALLOC */ -const cipher_name_pair cipher_name_translation_table[] = { {"BF-CBC" ,"BLOWFISH-CBC" }, {"BF-CFB" ,"BLOWFISH-CFB64" },
src/openvpn/crypto_openssl.c +1 -34
@@ -39,6 +39,7 @@#include "integer.h" #include "crypto.h" #include "crypto_backend.h" +#include "memdbg.h" #include "openssl_compat.h" #include <openssl/conf.h>
@@ -273,40 +274,6 @@ } -/* -* -* OpenSSL memory debugging. If dmalloc debugging is enabled, tell -* OpenSSL to use our private malloc/realloc/free functions so that -* we can dispatch them to dmalloc. -* -*/ - -#ifdef DMALLOC -static void * -crypto_malloc (size_t size,const char *file,int line) -{ -return dmalloc_malloc (file, line, size,DMALLOC_FUNC_MALLOC ,0 ,0 ); -} - -static void * -crypto_realloc (void *ptr,size_t size,const char *file,int line) -{ -return dmalloc_realloc (file, line, ptr, size,DMALLOC_FUNC_REALLOC ,0 ); -} - -static void -crypto_free (void *ptr) -{ -dmalloc_free (__FILE__, __LINE__, ptr,DMALLOC_FUNC_FREE ); -} - -void -crypto_init_dmalloc (void ) -{ -CRYPTO_set_mem_ex_functions (crypto_malloc, crypto_realloc, crypto_free); -} -#endif /* DMALLOC */ -const cipher_name_pair cipher_name_translation_table[] = { {"AES-128-GCM" ,"id-aes128-GCM" }, {"AES-192-GCM" ,"id-aes192-GCM" },
src/openvpn/init.c +0 -5
@@ -838,11 +838,6 @@bool init_static (void ) { -#if defined(DMALLOC ) -crypto_init_dmalloc (); -#endif - -/* * Initialize random number seed. random() is only used * when "weak" random numbers are acceptable.
src/openvpn/memdbg.h +1 -58
68 lines not on this page · raw message
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
[Openvpn-devel] [M] Change in openvpn[master]: Remove --with-mem-check=dmalloc
In reply to a message not in the archivecron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1582?usp=email )
Change subject: Remove --with-mem-check=dmalloc
......................................................................
Remove --with-mem-check=dmalloc
This code hasn't compiled for years and noone complained. We generally use ASAN instead.
So remove the dead code.
v2: The first version of this change tried to fix the
code. v2 instead removes it.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1582
Message-Id: <[email protected]>
URL: https://www.mail-archive.com/[email protected]/msg38208.html
---
M CMakeLists.txt
M config.h.cmake.in
M configure.ac
M src/openvpn/buffer.c
M src/openvpn/buffer.h
M src/openvpn/crypto_backend.h
M src/openvpn/crypto_mbedtls_legacy.c
M src/openvpn/crypto_openssl.c
M src/openvpn/init.c
M src/openvpn/memdbg.h
10 files changed, 5 insertions(+), 225 deletions(-)
CMakeLists.txt +0 -1
@@ -260,7 +260,6 @@ check_include_files(arpa/inet.h HAVE_ARPA_INET_H) check_include_files(dlfcn.h HAVE_DLFCN_H) -check_include_files(dmalloc.h HAVE_DMALLOC_H) check_include_files(fcntl.h HAVE_FCNTL_H) check_include_files(err.h HAVE_ERR_H) check_include_files(netdb.h HAVE_NETDB_H)
config.h.cmake.in +0 -3
@@ -96,9 +96,6 @@ /* Define to 1 if you have the <dlfcn.h> header file. */ #cmakedefine HAVE_DLFCN_H -/* Define to 1 if you have the <dmalloc.h> header file. */ -#cmakedefine HAVE_DMALLOC_H - /* Define to 1 if you have the `dup' function. */ #cmakedefine HAVE_DUP
configure.ac +2 -21
@@ -245,10 +245,10 @@ AC_ARG_WITH( [mem-check], - [AS_HELP_STRING([--with-mem-check=TYPE], [build with debug memory checking, TYPE=no|dmalloc|valgrind|ssl @<:@default=no@:>@])], + [AS_HELP_STRING([--with-mem-check=TYPE], [build with debug memory checking, TYPE=no|valgrind|ssl @<:@default=no@:>@])], [ case "${withval}" in - dmalloc|valgrind|ssl|no) ;; + valgrind|ssl|no) ;; *) AC_MSG_ERROR([bad value ${withval} for --mem-check]) ;; esac ],
@@ -652,25 +652,6 @@ [AC_MSG_ERROR([valgrind headers not found.])] ) ;; - dmalloc) - AC_CHECK_HEADERS( - [dmalloc.h], - [AC_CHECK_LIB( - [dmalloc], - [malloc], - [ - LIBS="${LIBS} -ldmalloc" - AC_DEFINE( - [DMALLOC], - [1], - [Use dmalloc memory debugging library] - ) - ], - [AC_MSG_ERROR([dmalloc library not found.])] - )], - [AC_MSG_ERROR([dmalloc headers not found.])] - ) - ;; ssl) AC_CHECK_LIB( [ssl],
src/openvpn/buffer.c +1 -57
160 lines not on this page · raw message
src/openvpn/buffer.h +0 -28
@@ -147,32 +147,6 @@void buf_size_error (const size_t size); -/* for dmalloc debugging */ - -#ifdef DMALLOC - -#define alloc_buf (size) alloc_buf_debug(size, __FILE__, __LINE__) -#define alloc_buf_gc (size, gc) alloc_buf_gc_debug(size, gc, __FILE__, __LINE__); -#define clone_buf (buf) clone_buf_debug(buf, __FILE__, __LINE__); -#define gc_malloc (size, clear, arena) gc_malloc_debug(size, clear, arena, __FILE__, __LINE__) -#define string_alloc (str, gc) string_alloc_debug(str, gc, __FILE__, __LINE__) -#define string_alloc_buf (str, gc) string_alloc_buf_debug(str, gc, __FILE__, __LINE__) - -struct buffer alloc_buf_debug (size_t size,const char *file,int line); - -struct buffer alloc_buf_gc_debug (size_t size,struct gc_arena *gc,const char *file,int line); - -struct buffer clone_buf_debug (const struct buffer *buf,const char *file,int line); - -void *gc_malloc_debug (size_t size,bool clear,struct gc_arena *a,const char *file,int line); - -char *string_alloc_debug (const char *str,struct gc_arena *gc,const char *file,int line); - -struct buffer string_alloc_buf_debug (const char *str,struct gc_arena *gc,const char *file, -int line); - -#else /* ifdef DMALLOC */ -struct buffer alloc_buf (size_t size); struct buffer alloc_buf_gc(size_t size,
@@ -186,8 +160,6 @@struct buffer string_alloc_buf (const char *str,struct gc_arena *gc); -#endif /* ifdef DMALLOC */ -void gc_addspecial (void *addr,void (*free_function)(void *),struct gc_arena *a);/**
src/openvpn/crypto_backend.h +0 -10
@@ -102,16 +102,6 @@*/ void crypto_unload_provider (const char *provname,provider_t *provider); -#ifdef DMALLOC -/* -* OpenSSL memory debugging. If dmalloc debugging is enabled, tell -* OpenSSL to use our private malloc/realloc/free functions so that -* we can dispatch them to dmalloc. -*/ -void crypto_init_dmalloc (void ); - -#endif /* DMALLOC */ -void show_available_ciphers (void );void show_available_digests (void );
src/openvpn/crypto_mbedtls_legacy.c +0 -8
@@ -139,14 +139,6 @@ } -#ifdef DMALLOC -void -crypto_init_dmalloc (void ) -{ -msg (M_ERR ,"Error: dmalloc support is not available for mbed TLS." ); -} -#endif /* DMALLOC */ -const cipher_name_pair cipher_name_translation_table[] = { {"BF-CBC" ,"BLOWFISH-CBC" }, {"BF-CFB" ,"BLOWFISH-CFB64" },
src/openvpn/crypto_openssl.c +1 -34
@@ -39,6 +39,7 @@#include "integer.h" #include "crypto.h" #include "crypto_backend.h" +#include "memdbg.h" #include "openssl_compat.h" #include <openssl/conf.h>
@@ -273,40 +274,6 @@ } -/* -* -* OpenSSL memory debugging. If dmalloc debugging is enabled, tell -* OpenSSL to use our private malloc/realloc/free functions so that -* we can dispatch them to dmalloc. -* -*/ - -#ifdef DMALLOC -static void * -crypto_malloc (size_t size,const char *file,int line) -{ -return dmalloc_malloc (file, line, size,DMALLOC_FUNC_MALLOC ,0 ,0 ); -} - -static void * -crypto_realloc (void *ptr,size_t size,const char *file,int line) -{ -return dmalloc_realloc (file, line, ptr, size,DMALLOC_FUNC_REALLOC ,0 ); -} - -static void -crypto_free (void *ptr) -{ -dmalloc_free (__FILE__, __LINE__, ptr,DMALLOC_FUNC_FREE ); -} - -void -crypto_init_dmalloc (void ) -{ -CRYPTO_set_mem_ex_functions (crypto_malloc, crypto_realloc, crypto_free); -} -#endif /* DMALLOC */ -const cipher_name_pair cipher_name_translation_table[] = { {"AES-128-GCM" ,"id-aes128-GCM" }, {"AES-192-GCM" ,"id-aes192-GCM" },
src/openvpn/init.c +0 -5
@@ -838,11 +838,6 @@bool init_static (void ) { -#if defined(DMALLOC ) -crypto_init_dmalloc (); -#endif - -/* * Initialize random number seed. random() is only used * when "weak" random numbers are acceptable.
src/openvpn/memdbg.h +1 -58
68 lines not on this page · raw message
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1582?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I4920318ac537064508eee3ca449d48de76c2ea5d
Gerrit-Change-Number: 1582
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <[email protected]>
Gerrit-Reviewer: plaisthos <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
[Openvpn-devel] [M] Change in openvpn[master]: Remove --with-mem-check=dmalloc
In reply to a message not in the archivecron2 has uploaded a new patch set (#3) to the change originally created by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1582?usp=email )
The following approvals got outdated and were removed:
Code-Review+2 by plaisthos
Change subject: Remove --with-mem-check=dmalloc
......................................................................
Remove --with-mem-check=dmalloc
This code hasn't compiled for years and noone complained. We generally use ASAN instead.
So remove the dead code.
v2: The first version of this change tried to fix the
code. v2 instead removes it.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1582
Message-Id: <[email protected]>
URL: https://www.mail-archive.com/[email protected]/msg38208.html
---
M CMakeLists.txt
M config.h.cmake.in
M configure.ac
M src/openvpn/buffer.c
M src/openvpn/buffer.h
M src/openvpn/crypto_backend.h
M src/openvpn/crypto_mbedtls_legacy.c
M src/openvpn/crypto_openssl.c
M src/openvpn/init.c
M src/openvpn/memdbg.h
10 files changed, 5 insertions(+), 225 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/82/1582/3
CMakeLists.txt +0 -1
@@ -260,7 +260,6 @@ check_include_files(arpa/inet.h HAVE_ARPA_INET_H) check_include_files(dlfcn.h HAVE_DLFCN_H) -check_include_files(dmalloc.h HAVE_DMALLOC_H) check_include_files(fcntl.h HAVE_FCNTL_H) check_include_files(err.h HAVE_ERR_H) check_include_files(netdb.h HAVE_NETDB_H)
config.h.cmake.in +0 -3
@@ -96,9 +96,6 @@ /* Define to 1 if you have the <dlfcn.h> header file. */ #cmakedefine HAVE_DLFCN_H -/* Define to 1 if you have the <dmalloc.h> header file. */ -#cmakedefine HAVE_DMALLOC_H - /* Define to 1 if you have the `dup' function. */ #cmakedefine HAVE_DUP
configure.ac +2 -21
@@ -245,10 +245,10 @@ AC_ARG_WITH( [mem-check], - [AS_HELP_STRING([--with-mem-check=TYPE], [build with debug memory checking, TYPE=no|dmalloc|valgrind|ssl @<:@default=no@:>@])], + [AS_HELP_STRING([--with-mem-check=TYPE], [build with debug memory checking, TYPE=no|valgrind|ssl @<:@default=no@:>@])], [ case "${withval}" in - dmalloc|valgrind|ssl|no) ;; + valgrind|ssl|no) ;; *) AC_MSG_ERROR([bad value ${withval} for --mem-check]) ;; esac ],
@@ -652,25 +652,6 @@ [AC_MSG_ERROR([valgrind headers not found.])] ) ;; - dmalloc) - AC_CHECK_HEADERS( - [dmalloc.h], - [AC_CHECK_LIB( - [dmalloc], - [malloc], - [ - LIBS="${LIBS} -ldmalloc" - AC_DEFINE( - [DMALLOC], - [1], - [Use dmalloc memory debugging library] - ) - ], - [AC_MSG_ERROR([dmalloc library not found.])] - )], - [AC_MSG_ERROR([dmalloc headers not found.])] - ) - ;; ssl) AC_CHECK_LIB( [ssl],
src/openvpn/buffer.c +1 -57
160 lines not on this page · raw message
src/openvpn/buffer.h +0 -28
@@ -147,32 +147,6 @@void buf_size_error (const size_t size); -/* for dmalloc debugging */ - -#ifdef DMALLOC - -#define alloc_buf (size) alloc_buf_debug(size, __FILE__, __LINE__) -#define alloc_buf_gc (size, gc) alloc_buf_gc_debug(size, gc, __FILE__, __LINE__); -#define clone_buf (buf) clone_buf_debug(buf, __FILE__, __LINE__); -#define gc_malloc (size, clear, arena) gc_malloc_debug(size, clear, arena, __FILE__, __LINE__) -#define string_alloc (str, gc) string_alloc_debug(str, gc, __FILE__, __LINE__) -#define string_alloc_buf (str, gc) string_alloc_buf_debug(str, gc, __FILE__, __LINE__) - -struct buffer alloc_buf_debug (size_t size,const char *file,int line); - -struct buffer alloc_buf_gc_debug (size_t size,struct gc_arena *gc,const char *file,int line); - -struct buffer clone_buf_debug (const struct buffer *buf,const char *file,int line); - -void *gc_malloc_debug (size_t size,bool clear,struct gc_arena *a,const char *file,int line); - -char *string_alloc_debug (const char *str,struct gc_arena *gc,const char *file,int line); - -struct buffer string_alloc_buf_debug (const char *str,struct gc_arena *gc,const char *file, -int line); - -#else /* ifdef DMALLOC */ -struct buffer alloc_buf (size_t size); struct buffer alloc_buf_gc(size_t size,
@@ -186,8 +160,6 @@struct buffer string_alloc_buf (const char *str,struct gc_arena *gc); -#endif /* ifdef DMALLOC */ -void gc_addspecial (void *addr,void (*free_function)(void *),struct gc_arena *a);/**
src/openvpn/crypto_backend.h +0 -10
@@ -102,16 +102,6 @@*/ void crypto_unload_provider (const char *provname,provider_t *provider); -#ifdef DMALLOC -/* -* OpenSSL memory debugging. If dmalloc debugging is enabled, tell -* OpenSSL to use our private malloc/realloc/free functions so that -* we can dispatch them to dmalloc. -*/ -void crypto_init_dmalloc (void ); - -#endif /* DMALLOC */ -void show_available_ciphers (void );void show_available_digests (void );
src/openvpn/crypto_mbedtls_legacy.c +0 -8
@@ -139,14 +139,6 @@ } -#ifdef DMALLOC -void -crypto_init_dmalloc (void ) -{ -msg (M_ERR ,"Error: dmalloc support is not available for mbed TLS." ); -} -#endif /* DMALLOC */ -const cipher_name_pair cipher_name_translation_table[] = { {"BF-CBC" ,"BLOWFISH-CBC" }, {"BF-CFB" ,"BLOWFISH-CFB64" },
src/openvpn/crypto_openssl.c +1 -34
@@ -39,6 +39,7 @@#include "integer.h" #include "crypto.h" #include "crypto_backend.h" +#include "memdbg.h" #include "openssl_compat.h" #include <openssl/conf.h>
@@ -273,40 +274,6 @@ } -/* -* -* OpenSSL memory debugging. If dmalloc debugging is enabled, tell -* OpenSSL to use our private malloc/realloc/free functions so that -* we can dispatch them to dmalloc. -* -*/ - -#ifdef DMALLOC -static void * -crypto_malloc (size_t size,const char *file,int line) -{ -return dmalloc_malloc (file, line, size,DMALLOC_FUNC_MALLOC ,0 ,0 ); -} - -static void * -crypto_realloc (void *ptr,size_t size,const char *file,int line) -{ -return dmalloc_realloc (file, line, ptr, size,DMALLOC_FUNC_REALLOC ,0 ); -} - -static void -crypto_free (void *ptr) -{ -dmalloc_free (__FILE__, __LINE__, ptr,DMALLOC_FUNC_FREE ); -} - -void -crypto_init_dmalloc (void ) -{ -CRYPTO_set_mem_ex_functions (crypto_malloc, crypto_realloc, crypto_free); -} -#endif /* DMALLOC */ -const cipher_name_pair cipher_name_translation_table[] = { {"AES-128-GCM" ,"id-aes128-GCM" }, {"AES-192-GCM" ,"id-aes192-GCM" },
src/openvpn/init.c +0 -5
@@ -838,11 +838,6 @@bool init_static (void ) { -#if defined(DMALLOC ) -crypto_init_dmalloc (); -#endif - -/* * Initialize random number seed. random() is only used * when "weak" random numbers are acceptable.
src/openvpn/memdbg.h +1 -58
68 lines not on this page · raw message
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1582?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I4920318ac537064508eee3ca449d48de76c2ea5d
Gerrit-Change-Number: 1582
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <[email protected]>
Gerrit-Reviewer: plaisthos <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel