|
From: <sv...@va...> - 2009-05-05 07:13:03
|
Author: njn
Date: 2009-05-05 08:12:55 +0100 (Tue, 05 May 2009)
New Revision: 9777
Log:
Tweak stack trace getting on Darwin. 10 extra Helgrind tests now pass,
although tc22_exit_w_lock now crashes and hangs, so it's disabled.
Modified:
branches/DARWIN/coregrind/m_stacktrace.c
branches/DARWIN/helgrind/tests/Makefile.am
branches/DARWIN/helgrind/tests/filter_stderr
Modified: branches/DARWIN/coregrind/m_stacktrace.c
===================================================================
--- branches/DARWIN/coregrind/m_stacktrace.c 2009-05-05 06:38:33 UTC (rev 9776)
+++ branches/DARWIN/coregrind/m_stacktrace.c 2009-05-05 07:12:55 UTC (rev 9777)
@@ -101,6 +101,9 @@
/* Assertion broken before main() is reached in pthreaded programs; the
* offending stack traces only have one item. --njn, 2002-aug-16 */
/* vg_assert(fp_min <= fp_max);*/
+ // On Darwin, this kicks in for pthread-related stack traces, so they're
+ // only 1 entry long which is wrong.
+#if !defined(VGO_darwin)
if (fp_min + 512 >= fp_max) {
/* If the stack limits look bogus, don't poke around ... but
don't bomb out either. */
@@ -109,6 +112,7 @@
ips[0] = ip;
return 1;
}
+#endif
/* Otherwise unwind the stack in a platform-specific way. Trying
to merge the x86, amd64, ppc32 and ppc64 logic into a single
Modified: branches/DARWIN/helgrind/tests/Makefile.am
===================================================================
--- branches/DARWIN/helgrind/tests/Makefile.am 2009-05-05 06:38:33 UTC (rev 9776)
+++ branches/DARWIN/helgrind/tests/Makefile.am 2009-05-05 07:12:55 UTC (rev 9777)
@@ -92,10 +92,15 @@
tc18_semabuse \
tc19_shadowmem \
tc21_pthonce \
- tc22_exit_w_lock \
tc23_bogus_condwait \
tc24_nonzero_sem
+# DDD: it seg faults, and then the Valgrind exit path hangs
+if ! VGCONF_PLATFORMS_INCLUDE_X86_DARWIN
+ check_PROGRAMS += \
+ tc22_exit_w_lock
+endif
+
if HAVE_PTHREAD_BARRIER
check_PROGRAMS += bar_bad bar_trivial
endif
Modified: branches/DARWIN/helgrind/tests/filter_stderr
===================================================================
--- branches/DARWIN/helgrind/tests/filter_stderr 2009-05-05 06:38:33 UTC (rev 9776)
+++ branches/DARWIN/helgrind/tests/filter_stderr 2009-05-05 07:12:55 UTC (rev 9777)
@@ -45,8 +45,9 @@
# "Thread #x was created" stack traces are unreliable once you get above
# "pthread_create@* (hg_intercepts.c:...)" -- they can contan
# "pthread_create@GLIBC_", "do_clone", "clone", etc. So we cut all the
-# "at"/"by" lines above "pthread_create@*".
-perl -p -0 -e 's/(Thread #. was created\n)( (at|by)[^\n]*\n)*( by 0x........: pthread_create@\* \(hg_intercepts.c:...\)\n)/$1 ...\n$4/gs' |
+# "at"/"by" lines above "pthread_create@*". We also convert
+# "pthread_create" into "pthread_create@*".
+perl -p -0 -e 's/(Thread #. was created\n)( (at|by)[^\n]*\n)*( by 0x........: pthread_create)(@\*)?( \(hg_intercepts.c:...\)\n)/$1 ...\n$4$5@*$6/gs' |
# Anything below "mythread_wrapper" in stack traces is unreliable,
# containing libc and libpthread stuff like start_thread, clone, etc. So we
|