Module Name: src
Committed By: kamil
Date: Sat Nov 19 02:30:54 UTC 2016
Modified Files:
src/tests/lib/libpthread_dbg: h_common.h
Log Message:
Fix basic_proc_read in pthread_dbg functions
Source and destination were swapped. The source of this confusion was that
running these tests under gdb(1) will generate false positives as it will
initialize pthread__dbg to PID of the debugger. This means that it is
currently not possible to debug pthread_dbg code under a full-stack
debugger using NetBSD debugging library for threads.
This should address:
PR lib/51633 tests/lib/libpthread_dbg/t_dummy unreliable
PR lib/51635: td_thr_iter in <pthread_dbg.h> seems broken
After applying the fix I'm able to run all pthread_dbg tests without
indeterminism. The indeterminism was caused by overwritting source of data
with trash.
Sponsored by <The NetBSD Foundation>
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libpthread_dbg/h_common.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/lib/libpthread_dbg/h_common.h
diff -u src/tests/lib/libpthread_dbg/h_common.h:1.1 src/tests/lib/libpthread_dbg/h_common.h:1.2
--- src/tests/lib/libpthread_dbg/h_common.h:1.1 Fri Nov 18 22:50:19 2016
+++ src/tests/lib/libpthread_dbg/h_common.h Sat Nov 19 02:30:54 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: h_common.h,v 1.1 2016/11/18 22:50:19 kamil Exp $ */
+/* $NetBSD: h_common.h,v 1.2 2016/11/19 02:30:54 kamil Exp $ */
/*-
* Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@ dummy_proc_setregs(void *arg, int regset
static int __used
basic_proc_read(void *arg, caddr_t addr, void *buf, size_t size)
{
- memcpy(addr, buf, size);
+ memcpy(buf, addr, size);
return TD_ERR_OK;
}