Skip Menu |
 

To: krb5-bugs@mit.edu
From: Ken Raeburn <raeburn@mit.edu>
Date: Thu, 13 Jan 2005 20:36:04 -0500
Subject: data race conditions in krb5 libs
valgrind (with --tool=helgrind) is reporting a bunch of data races in
our code. Some of them are sloppy initialization or cleanup, some
regular run-time races. Clean 'em up.
From: raeburn@mit.edu
Subject: CVS Commit
* error_message.c (com_err_terminate): Lock the list mutex before walking
through it; unlock and destroy it afterwards.


To generate a diff of this commit:



cvs diff -r5.150 -r5.151 krb5/src/util/et/ChangeLog
cvs diff -r5.46 -r5.47 krb5/src/util/et/error_message.c
From: raeburn@mit.edu
Subject: CVS Commit
More paranoid checking...
* k5-thread.h (k5_os_mutex) [pthread case]: Add new field "owner" if
DEBUG_THREADS.
(k5_pthread_mutex_lock, k5_pthread_mutex_unlock, k5_pthread_assert_locked): New
macros/functions; if DEBUG_THREADS, set or check the owner field.
(K5_OS_MUTEX_PARTIAL_INITIALIZER) [pthread case && DEBUG_THREADS]: Set the
owner field. If PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP is defined, use it.
(k5_os_mutex_lock, k5_os_mutex_unlock, k5_os_mutex_assert_locked) [pthread
case]: Use k5_pthread_ versions.
(k5_mutex_destroy): Update the location data with the mutex locked, before
destroying it.
(k5_mutex_unlock): Update the location data while the mutex is still locked,
and check the assertion that the mutex really is locked. Convert inline
function to macro.

* k5-thread.h (krb5int_mutex_lock_update_stats,
krb5int_mutex_unlock_update_stats, krb5int_mutex_report_stats)
[!DEBUG_THREADS_STATS]: Declare KRB5_CALLCONV.


To generate a diff of this commit:



cvs diff -r1.486 -r1.487 krb5/src/include/ChangeLog
cvs diff -r1.24 -r1.25 krb5/src/include/k5-thread.h
From: raeburn@mit.edu
Subject: CVS Commit
* yarrow.c (yarrow_reseed_locked): Renamed from krb5int_yarrow_reseed and made
static.
(Yarrow_detect_fork, yarrow_input_maybe_locking, krb5int_yarrow_output_Block):
Call it.
(krb5int_yarrow_reseed): New function, grabs lock and calls the old version.
(krb5int_yarrow_final): Hold the lock until after clearing the Yarrow context
data.


To generate a diff of this commit:



cvs diff -r1.22 -r1.23 krb5/src/lib/crypto/yarrow/ChangeLog
cvs diff -r1.14 -r1.15 krb5/src/lib/crypto/yarrow/yarrow.c
From: raeburn@mit.edu
Subject: CVS Commit
* prng.c (krb5int_prng_init): Incorporate do_yarrow_init body. Don't check
inited variable.
(inited): Variable deleted.
(krb5_c_random_make_octets, krb5int_prng_cleanup): Don't check it.
(do_yarrow_init): Deleted.


To generate a diff of this commit:



cvs diff -r5.172 -r5.173 krb5/src/lib/crypto/ChangeLog
cvs diff -r5.23 -r5.24 krb5/src/lib/crypto/prng.c
From: raeburn@mit.edu
Subject: CVS Commit
* prof_file.c (profile_open_file): If mutex creation fails, free storage
directly instead of calling profile_close_file.


To generate a diff of this commit:



cvs diff -r1.173 -r1.174 krb5/src/util/profile/ChangeLog
cvs diff -r1.49 -r1.50 krb5/src/util/profile/prof_file.c
From: raeburn@mit.edu
Subject: CVS Commit
* k5-thread.h (k5_pthread_assert_locked): Only call pthread_equal if
thread support is loaded.
(k5_pthread_mutex_unlock): Use k5_pthread_assert_locked instead of
duplicating it.


To generate a diff of this commit:



cvs diff -r1.487 -r1.488 krb5/src/include/ChangeLog
cvs diff -r1.25 -r1.26 krb5/src/include/k5-thread.h
From: raeburn@mit.edu
Subject: CVS Commit
* k5-thread.h [HAVE_PTHREAD && HAVE_PRAGMA_WEAK_REF]: Mark pthread_self and
pthread_equal as weak references.


To generate a diff of this commit:



cvs diff -r1.488 -r1.489 krb5/src/include/ChangeLog
cvs diff -r1.26 -r1.27 krb5/src/include/k5-thread.h
From: tlyu@mit.edu
Subject: CVS Commit
pullup from trunk


To generate a diff of this commit:



cvs diff -r1.471.2.5 -r1.471.2.6 krb5/src/include/ChangeLog
cvs diff -r1.22 -r1.22.2.1 krb5/src/include/k5-thread.h
cvs diff -r5.168.4.3 -r5.168.4.4 krb5/src/lib/crypto/ChangeLog
cvs diff -r5.20.4.2 -r5.20.4.3 krb5/src/lib/crypto/prng.c
cvs diff -r1.17.4.2 -r1.17.4.3 krb5/src/lib/crypto/yarrow/ChangeLog
cvs diff -r1.11.4.1 -r1.11.4.2 krb5/src/lib/crypto/yarrow/yarrow.c
cvs diff -r5.149.4.1 -r5.149.4.2 krb5/src/util/et/ChangeLog
cvs diff -r5.46 -r5.46.4.1 krb5/src/util/et/error_message.c
cvs diff -r1.168.2.4 -r1.168.2.5 krb5/src/util/profile/ChangeLog
cvs diff -r1.47.2.1 -r1.47.2.2 krb5/src/util/profile/prof_file.c