krb5 commit: Do not emit debug printfs under NODEBUG

Benjamin Kaduk kaduk at MIT.EDU
Wed Aug 29 16:35:05 EDT 2012


https://github.com/krb5/krb5/commit/932866ad41edf830123bdfef927f1314f3100be9
commit 932866ad41edf830123bdfef927f1314f3100be9
Author: Ben Kaduk <kaduk at mit.edu>
Date:   Thu Aug 23 12:38:57 2012 -0400

    Do not emit debug printfs under NODEBUG
    
    These printfs spew to the console when command-line utilities
    such as 'klist' and 'aklog' are run, reducing usability.
    
    These printfs can also cause application hangs.
    On a multiprocessor machine, when PuTTY and the ccapiserver are
    running on different CPUs, PuTTY appears to deadlock with three
    concurrent threads inside cci_debug_printf().
    
    ticket: 7342 (new)
    target_version: 1.10.4
    tags: pullup

 src/ccapi/common/win/cci_os_debugging.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/ccapi/common/win/cci_os_debugging.c b/src/ccapi/common/win/cci_os_debugging.c
index de31c7c..597ac85 100644
--- a/src/ccapi/common/win/cci_os_debugging.c
+++ b/src/ccapi/common/win/cci_os_debugging.c
@@ -32,7 +32,9 @@
 /* ------------------------------------------------------------------------ */
 
 void cci_os_debug_vprintf (const char *in_format, va_list in_args) {
+#ifdef DEBUG
     printf  ( "%s %ld ", timestamp(), GetCurrentThreadId() );
     vprintf ( in_format, in_args );
     printf  ( "\n" );
+#endif
     }


More information about the cvs-krb5 mailing list