|
From: <sv...@va...> - 2009-02-24 02:34:14
|
Author: njn
Date: 2009-02-24 01:35:51 +0000 (Tue, 24 Feb 2009)
New Revision: 9247
Log:
Merged 9242..9246 (various minor changes) from the trunk.
Modified:
branches/DARWIN/coregrind/m_oset.c
branches/DARWIN/drd/drd_clientobj.c
branches/DARWIN/drd/tests/tc20_verifywrap.stderr.exp-glibc2.5-ppc
branches/DARWIN/drd/tests/tc20_verifywrap2.stderr.exp-glibc2.5-ppc
branches/DARWIN/exp-ptrcheck.supp
branches/DARWIN/exp-ptrcheck/h_main.c
branches/DARWIN/include/pub_tool_oset.h
Modified: branches/DARWIN/coregrind/m_oset.c
===================================================================
--- branches/DARWIN/coregrind/m_oset.c 2009-02-23 19:15:32 UTC (rev 9246)
+++ branches/DARWIN/coregrind/m_oset.c 2009-02-24 01:35:51 UTC (rev 9247)
@@ -174,7 +174,7 @@
}
// Compare the first word of each element. Inlining is *crucial*.
-static inline Word fast_cmp(void* k, AvlNode* n)
+static inline Word fast_cmp(const void* k, const AvlNode* n)
{
UWord w1 = *(UWord*)k;
UWord w2 = *(UWord*)elem_of_node(n);
@@ -785,7 +785,7 @@
// produced VG_(OSetGen_Next) is the smallest key in the map
// >= start_at. Naturally ">=" is defined by the comparison
// function supplied to VG_(OSetGen_Create).
-void VG_(OSetGen_ResetIterAt)(AvlTree* oset, void* k)
+void VG_(OSetGen_ResetIterAt)(AvlTree* oset, const void* k)
{
Int i;
AvlNode *n, *t;
Modified: branches/DARWIN/drd/drd_clientobj.c
===================================================================
--- branches/DARWIN/drd/drd_clientobj.c 2009-02-23 19:15:32 UTC (rev 9246)
+++ branches/DARWIN/drd/drd_clientobj.c 2009-02-24 01:35:51 UTC (rev 9247)
@@ -187,6 +187,13 @@
return True;
}
+/**
+ * Clean up all client objects p for which their start address p->any.a1 fits
+ * inside the address range [ a1, a2 [.
+ *
+ * @note The implementation of this function relies on the fact that the
+ * data in s_clientobj_set is sorted on the start address of client objects.
+ */
void DRD_(clientobj_stop_using_mem)(const Addr a1, const Addr a2)
{
Addr removed_at;
@@ -197,22 +204,17 @@
if (! DRD_(is_any_suppressed)(a1, a2))
return;
- VG_(OSetGen_ResetIter)(s_clientobj_set);
- p = VG_(OSetGen_Next)(s_clientobj_set);
- for ( ; p != 0; )
+ VG_(OSetGen_ResetIterAt)(s_clientobj_set, &a1);
+ for ( ; (p = VG_(OSetGen_Next)(s_clientobj_set)) != 0 && p->any.a1 < a2; )
{
- if (a1 <= p->any.a1 && p->any.a1 < a2)
- {
- removed_at = p->any.a1;
- clientobj_remove_obj(p);
- /* The above call removes an element from the oset and hence */
- /* invalidates the iterator. Set the iterator back. */
- VG_(OSetGen_ResetIterAt)(s_clientobj_set, &removed_at);
- }
- else
- {
- p = VG_(OSetGen_Next)(s_clientobj_set);
- }
+ tl_assert(a1 <= p->any.a1);
+ removed_at = p->any.a1;
+ clientobj_remove_obj(p);
+ /*
+ * The above call removes an element from the oset and hence
+ * invalidates the iterator. Restore the iterator.
+ */
+ VG_(OSetGen_ResetIterAt)(s_clientobj_set, &removed_at);
}
}
Modified: branches/DARWIN/drd/tests/tc20_verifywrap.stderr.exp-glibc2.5-ppc
===================================================================
--- branches/DARWIN/drd/tests/tc20_verifywrap.stderr.exp-glibc2.5-ppc 2009-02-23 19:15:32 UTC (rev 9246)
+++ branches/DARWIN/drd/tests/tc20_verifywrap.stderr.exp-glibc2.5-ppc 2009-02-24 01:35:51 UTC (rev 9247)
@@ -139,8 +139,14 @@
Destroying locked mutex: mutex 0x........, recursion count 1, owner 1.
at 0x........: main (tc20_verifywrap.c:262)
+mutex 0x........ was first observed at:
+ at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
+ by 0x........: main (tc20_verifywrap.c:145)
Destroying locked rwlock: rwlock 0x.........
at 0x........: main (tc20_verifywrap.c:262)
+rwlock 0x........ was first observed at:
+ at 0x........: pthread_rwlock_init* (drd_pthread_intercepts.c:?)
+ by 0x........: main (tc20_verifywrap.c:216)
ERROR SUMMARY: 16 errors from 16 contexts (suppressed: 0 from 0)
Modified: branches/DARWIN/drd/tests/tc20_verifywrap2.stderr.exp-glibc2.5-ppc
===================================================================
--- branches/DARWIN/drd/tests/tc20_verifywrap2.stderr.exp-glibc2.5-ppc 2009-02-23 19:15:32 UTC (rev 9246)
+++ branches/DARWIN/drd/tests/tc20_verifywrap2.stderr.exp-glibc2.5-ppc 2009-02-24 01:35:51 UTC (rev 9247)
@@ -170,9 +170,15 @@
Destroying locked mutex: mutex 0x........, recursion count 1, owner 1.
at 0x........: main (tc20_verifywrap.c:262)
+mutex 0x........ was first observed at:
+ at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?)
+ by 0x........: main (tc20_verifywrap.c:145)
Destroying locked rwlock: rwlock 0x.........
at 0x........: main (tc20_verifywrap.c:262)
+rwlock 0x........ was first observed at:
+ at 0x........: pthread_rwlock_init* (drd_pthread_intercepts.c:?)
+ by 0x........: main (tc20_verifywrap.c:216)
[1/1] mutex_trylock recursive mutex 0x........ rc 0 owner 0
[1/1] post_mutex_lock recursive mutex 0x........ rc 0 owner 0
[1/1] mutex_unlock recursive mutex 0x........ rc 1
Modified: branches/DARWIN/exp-ptrcheck/h_main.c
===================================================================
--- branches/DARWIN/exp-ptrcheck/h_main.c 2009-02-23 19:15:32 UTC (rev 9246)
+++ branches/DARWIN/exp-ptrcheck/h_main.c 2009-02-24 01:35:51 UTC (rev 9247)
@@ -2213,6 +2213,7 @@
ADD(0, __NR_exit); /* hmm, why are we still alive? */
ADD(0, __NR_exit_group);
ADD(0, __NR_fadvise64);
+ ADD(0, __NR_fallocate);
ADD(0, __NR_fchmod);
ADD(0, __NR_fchown);
# if defined(__NR_fchown32)
@@ -2258,6 +2259,9 @@
ADD(0, __NR_getppid);
ADD(0, __NR_getresgid);
ADD(0, __NR_getresuid);
+# if defined(__NR_getresuid32)
+ ADD(0, __NR_getresuid32);
+# endif
ADD(0, __NR_getrlimit);
ADD(0, __NR_getrusage);
# if defined(__NR_getsockname)
Modified: branches/DARWIN/exp-ptrcheck.supp
===================================================================
--- branches/DARWIN/exp-ptrcheck.supp 2009-02-23 19:15:32 UTC (rev 9246)
+++ branches/DARWIN/exp-ptrcheck.supp 2009-02-24 01:35:51 UTC (rev 9247)
@@ -17,7 +17,6 @@
exp-ptrcheck:Arith
obj:/*lib*/ld-2.*so*
obj:/*lib*/ld-2.*so*
- obj:/*lib*/ld-2.*so*
}
{
@@ -40,5 +39,4 @@
exp-ptrcheck:Heap
obj:/*lib*/ld-2.*so*
obj:/*lib*/ld-2.*so*
- obj:/*lib*/ld-2.*so*
}
Modified: branches/DARWIN/include/pub_tool_oset.h
===================================================================
--- branches/DARWIN/include/pub_tool_oset.h 2009-02-23 19:15:32 UTC (rev 9246)
+++ branches/DARWIN/include/pub_tool_oset.h 2009-02-24 01:35:51 UTC (rev 9247)
@@ -250,7 +250,7 @@
// produced VG_(OSetGen_Next) is the smallest key in the map
// >= start_at. Naturally ">=" is defined by the comparison
// function supplied to VG_(OSetGen_Create).
-extern void VG_(OSetGen_ResetIterAt) ( OSet* oset, void* key );
+extern void VG_(OSetGen_ResetIterAt) ( OSet* oset, const void* key );
#endif // __PUB_TOOL_OSET_H
|