Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libpthread_dbg Fix basic_proc_read in pthread_dbg ...



details:   https://anonhg.NetBSD.org/src/rev/e779173229c5
branches:  trunk
changeset: 348984:e779173229c5
user:      kamil <kamil%NetBSD.org@localhost>
date:      Sat Nov 19 02:30:54 2016 +0000

description:
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>

diffstat:

 tests/lib/libpthread_dbg/h_common.h |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r 7d4607db931f -r e779173229c5 tests/lib/libpthread_dbg/h_common.h
--- a/tests/lib/libpthread_dbg/h_common.h       Sat Nov 19 01:14:58 2016 +0000
+++ b/tests/lib/libpthread_dbg/h_common.h       Sat Nov 19 02:30:54 2016 +0000
@@ -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 @@
 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;
 }



Home | Main Index | Thread Index | Old Index