hg qrecord to the rescue
authorbenjamin@smedbergs.us
Wed, 13 Feb 2008 16:21:25 -0500
changeset 40 432248c58b48
parent 39 6932d8476f00
child 41 84ba4253dc28
push id1
push userbsmedberg@mozilla.com
push dateMon, 21 Apr 2008 01:54:18 +0000
hg qrecord to the rescue
double-mark-is-ok
series
stack-access2
valgrind-annotations
new file mode 100644
--- /dev/null
+++ b/double-mark-is-ok
@@ -0,0 +1,19 @@
+diff --git a/MMgc/GC.cpp b/MMgc/GC.cpp
+--- a/MMgc/GC.cpp
++++ b/MMgc/GC.cpp
+@@ -2486,6 +2486,7 @@
+ 		{
+ 			int b = SetMark(wi.ptr);
+ 			(void)b;
++#if 0
+ #ifdef _DEBUG
+ 			// def ref validation does a Trace which can 
+ 			// cause things on the work queue to be already marked
+@@ -2494,6 +2495,7 @@
+ 				GCAssert(!b);
+ 			}
+ #endif			
++#endif
+ 		}
+ 		else
+ 		{
--- a/series
+++ b/series
@@ -7,8 +7,10 @@ workitems-notgc-noassert
 gc-graph #+graphviz
 alloc-backtrace #+graphviz
 enable-traces
 debug-print-finalizers
 finalizable-merge-fixup
 remove-finalize-method
 export-gcthread
 valgrind-annotations
+stack-access2
+double-mark-is-ok
new file mode 100644
--- /dev/null
+++ b/stack-access2
@@ -0,0 +1,38 @@
+diff --git a/MMgc/GC.cpp b/MMgc/GC.cpp
+--- a/MMgc/GC.cpp
++++ b/MMgc/GC.cpp
+@@ -2340,12 +2340,16 @@
+ #ifdef GCHEAP_LOCK
+ 			GCAcquireSpinlock lock(m_rootListLock);
+ #endif
++			m_currentQueue = &m_incrementalWork;
++
+ 			GCRoot *r = m_roots;
+ 			while(r) {
+ 				GCWorkItem item = r->GetWorkItem();
+ 				MarkItem(item, m_incrementalWork);
+ 				r = r->next;
+ 			}
++
++			m_currentQueue = NULL;
+ 		}
+ 		markTicks += GetPerformanceCounter() - start;
+ 		IncrementalMark();
+@@ -2775,6 +2779,8 @@
+ 		// finished in Sweep
+ 		sweepStart = GetPerformanceCounter();
+ 		
++		m_currentQueue = &m_incrementalWork;
++
+ 		// mark roots again, could have changed (alternative is to put WB's on the roots
+ 		// which we may need to do if we find FinishIncrementalMark taking too long)
+ 		
+@@ -2801,6 +2807,8 @@
+ 		}
+ 
+ 		MarkQueueAndStack(m_incrementalWork);
++
++		m_currentQueue = NULL;
+ 
+ #ifdef _DEBUG
+ 		// need to traverse all marked objects and make sure they don't contain
--- a/valgrind-annotations
+++ b/valgrind-annotations
@@ -1,9 +1,10 @@
 Add valgrind annotations for MMgc allocations. Note that there are some extraneous changes to set the current work queue correctly... I need to split those hunks out :-(
+* * *
 
 diff --git a/MMgc/FixedMalloc.cpp b/MMgc/FixedMalloc.cpp
 --- a/MMgc/FixedMalloc.cpp
 +++ b/MMgc/FixedMalloc.cpp
 @@ -79,6 +79,8 @@ namespace MMgc
  
  	FixedMalloc::FixedMalloc(GCHeap* heap)
  	{
@@ -109,94 +110,43 @@ diff --git a/MMgc/GC.cpp b/MMgc/GC.cpp
  				RCObject *obj = (RCObject*)val;
  				obj->Pin();
  			}
 +
 +			VALGRIND_DISCARD(valhandle);
  		}
  	}
  			
-@@ -2340,12 +2356,16 @@ bail:
- #ifdef GCHEAP_LOCK
- 			GCAcquireSpinlock lock(m_rootListLock);
- #endif
-+			m_currentQueue = &m_incrementalWork;
-+
- 			GCRoot *r = m_roots;
- 			while(r) {
- 				GCWorkItem item = r->GetWorkItem();
- 				MarkItem(item, m_incrementalWork);
- 				r = r->next;
- 			}
-+
-+			m_currentQueue = NULL;
- 		}
- 		markTicks += GetPerformanceCounter() - start;
- 		IncrementalMark();
-@@ -2482,6 +2502,7 @@ bail:
- 		{
- 			int b = SetMark(wi.ptr);
- 			(void)b;
-+#if 0
- #ifdef _DEBUG
- 			// def ref validation does a Trace which can 
- 			// cause things on the work queue to be already marked
-@@ -2490,6 +2511,7 @@ bail:
- 				GCAssert(!b);
- 			}
- #endif			
-+#endif
- 		}
- 		else
- 		{
-@@ -2509,6 +2531,8 @@ bail:
+@@ -2509,6 +2525,8 @@ bail:
  		while(p < end) 
  		{
  			uintptr val = *p++;  
 +			
 +			int valhandle = VALGRIND_MAKE_MEM_DEFINED(&val, sizeof(val));
  
  			if(val < _memStart || val >= _memEnd)
  				continue;
-@@ -2520,6 +2544,8 @@ bail:
+@@ -2520,6 +2538,8 @@ bail:
  			{
  				const void *item;
  				GCAlloc::GCBlock *block = (GCAlloc::GCBlock*) (val & ~0xFFF);
 +
 +				VALGRIND_CHECK_MEM_IS_DEFINED(&block, sizeof(GCAlloc::GCBlock*));
  
  #ifdef MMGC_INTERIOR_PTRS
  				item = (void*) val;
-@@ -2660,6 +2686,8 @@ bail:
+@@ -2660,6 +2680,8 @@ bail:
  					#endif
  				}
  			}
 +
 +			VALGRIND_DISCARD(valhandle);
  		}
  	}
  
-@@ -2775,6 +2803,8 @@ bail:
- 		// finished in Sweep
- 		sweepStart = GetPerformanceCounter();
- 		
-+		m_currentQueue = &m_incrementalWork;
-+
- 		// mark roots again, could have changed (alternative is to put WB's on the roots
- 		// which we may need to do if we find FinishIncrementalMark taking too long)
- 		
-@@ -2801,6 +2831,8 @@ bail:
- 		}
- 
- 		MarkQueueAndStack(m_incrementalWork);
-+
-+		m_currentQueue = NULL;
- 
- #ifdef _DEBUG
- 		// need to traverse all marked objects and make sure they don't contain
 diff --git a/MMgc/GCAlloc.cpp b/MMgc/GCAlloc.cpp
 --- a/MMgc/GCAlloc.cpp
 +++ b/MMgc/GCAlloc.cpp
 @@ -711,5 +711,7 @@ start:
  #endif
  		// Add this item to the free list
  		*((void**)item) = oldFree;	
 +