Subject: CVS commit: src/lib/libpthread_dbg
To: None <source-changes@netbsd.org>
From: Nathan J Williams <nathanw@netbsd.org>
List: source-changes
Date: 04/05/2003 04:39:15
Module Name: src
Committed By: nathanw
Date: Sat Apr 5 01:39:14 UTC 2003
Modified Files:
src/lib/libpthread_dbg: pthread_dbg.c
Log Message:
A couple of READ calls in td_sync_info() were reading into a
pthread_spin_t variable (4 bytes) but telling read that they were
reading sizeof(struct pthread_spinlock_st) (12 bytes). This led to
overwriting other things on the stack, like the return address. Oops.
Fix by changing READ call here (and elsewhere, for future safety) to:
READ(,, &variable, sizeof(variable))
instead of
READ(,, &variable, sizeof(type)).
Fixes a crash in gdb when running "thread examine all" reported by
Bill Studenmund.
To generate a diff of this commit:
cvs rdiff -r1.5 -r1.6 src/lib/libpthread_dbg/pthread_dbg.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.