3469375e4f 
								
							 
						 
						
							
							
								
								[sanitizer] factor out ByteMap from SizeClassAllocator32 so that it can be later replaced with a more memory-efficient implementation on 64-bit.  
							
							... 
							
							
							
							llvm-svn: 182234 
							
						 
						
							2013-05-20 07:29:21 +00:00  
				
					
						
							
							
								 
						
							
								21cbaee6a9 
								
							 
						 
						
							
							
								
								[sanitizer] fix gcc build  
							
							... 
							
							
							
							llvm-svn: 182006 
							
						 
						
							2013-05-16 13:24:31 +00:00  
				
					
						
							
							
								 
						
							
								efb6172cb3 
								
							 
						 
						
							
							
								
								[sanitizer] Fix the region overflow condition in SanitizerAllocator64::PopulateFreeList().  
							
							... 
							
							
							
							llvm-svn: 182002 
							
						 
						
							2013-05-16 12:58:34 +00:00  
				
					
						
							
							
								 
						
							
								19eb46f4ca 
								
							 
						 
						
							
							
								
								[sanitizer] fix a gcc warning  
							
							... 
							
							
							
							llvm-svn: 181992 
							
						 
						
							2013-05-16 08:03:26 +00:00  
				
					
						
							
							
								 
						
							
								a551aaa944 
								
							 
						 
						
							
							
								
								[sanitizer] fix the GetBlockBegin overflow bug while preserving the performance optimization (use 32-bit division when possible). Improve the benchmarks that checks for performance of GetBlockBegin/GetMetaData  
							
							... 
							
							
							
							llvm-svn: 181989 
							
						 
						
							2013-05-16 07:11:16 +00:00  
				
					
						
							
							
								 
						
							
								e6459977b8 
								
							 
						 
						
							
							
								
								[sanitizer] Fix boundary condition in LargeMmapAllocator::GetBlockBegin. Patch by Sergey Matveev  
							
							... 
							
							
							
							llvm-svn: 179007 
							
						 
						
							2013-04-08 08:43:22 +00:00  
				
					
						
							
							
								 
						
							
								31056968fc 
								
							 
						 
						
							
							
								
								asan/tsan: reduce per-thread memory allocator caches  
							
							... 
							
							
							
							256 blocks (which is 512 in reallity) seems to be too big cache,
reducing the size reduces memory consumption but does not degrade performance.
llvm-svn: 177502 
							
						 
						
							2013-03-20 09:26:46 +00:00  
				
					
						
							
							
								 
						
							
								b941a2fca4 
								
							 
						 
						
							
							
								
								[asan] Add ForEachChunk() to sanitizer allocators. Patch by Sergey Matveev  
							
							... 
							
							
							
							llvm-svn: 177147 
							
						 
						
							2013-03-15 11:39:41 +00:00  
				
					
						
							
							
								 
						
							
								d332d42372 
								
							 
						 
						
							
							
								
								[asan] remove one redundant malloc stress test, unify the usage of ASAN_LOW_MEMORY macro in tests, slightly reduce test memory usage (all to make 32-bit runs consume less RAM)  
							
							... 
							
							
							
							llvm-svn: 177069 
							
						 
						
							2013-03-14 13:16:09 +00:00  
				
					
						
							
							
								 
						
							
								138b155042 
								
							 
						 
						
							
							
								
								[sanitizer] use fewer size classes in the allocator to reduce the memory footprint. There is no all-size-fits-all constant here, but this change is positive or neutral on several large apps I've tested  
							
							... 
							
							
							
							llvm-svn: 176855 
							
						 
						
							2013-03-12 08:44:40 +00:00  
				
					
						
							
							
								 
						
							
								ba56c8d4f9 
								
							 
						 
						
							
							
								
								[sanitizer] simplify the allocator's SizeClassMap: do not require an extra template parameter, instead compute it in flight. No functionality change  
							
							... 
							
							
							
							llvm-svn: 176853 
							
						 
						
							2013-03-12 07:01:27 +00:00  
				
					
						
							
							
								 
						
							
								0f5c20b417 
								
							 
						 
						
							
							
								
								[sanitizer] make SizeClassAllocator64::GetBlockBegin more bullet proof (by Sergey Matveev)  
							
							... 
							
							
							
							llvm-svn: 176799 
							
						 
						
							2013-03-11 09:43:12 +00:00  
				
					
						
							
							
								 
						
							
								66c26e5e96 
								
							 
						 
						
							
							
								
								[sanitizers] Fix check failure on dealloc from new thread  
							
							... 
							
							
							
							Summary:
Adds a test for this case, which was reduced from a chromium build of
WebKit's DumpRenderTree.
Reviewers: eugenis
CC: glider
Differential Revision: http://llvm-reviews.chandlerc.com/D495 
llvm-svn: 176552 
							
						 
						
							2013-03-06 14:54:08 +00:00  
				
					
						
							
							
								 
						
							
								323771b3f1 
								
							 
						 
						
							
							
								
								[sanitizer] Fix check failure in SizeClassMap::Print.  
							
							... 
							
							
							
							llvm-svn: 176338 
							
						 
						
							2013-03-01 08:49:14 +00:00  
				
					
						
							
							
								 
						
							
								459df6f167 
								
							 
						 
						
							
							
								
								[asan] a bit stricter lint for CHECK vs CHECK_XX (these CHECK_XX really help debugging!)  
							
							... 
							
							
							
							llvm-svn: 176085 
							
						 
						
							2013-02-26 12:59:06 +00:00  
				
					
						
							
							
								 
						
							
								167f9e4395 
								
							 
						 
						
							
							
								
								[ASan] Switch Windows to allocator v2, also fixing some build errors  
							
							... 
							
							
							
							llvm-svn: 174707 
							
						 
						
							2013-02-08 12:02:00 +00:00  
				
					
						
							
							
								 
						
							
								39675fe9c8 
								
							 
						 
						
							
							
								
								[sanitizer] always allocate 16-byte aligned chunks of memory  
							
							... 
							
							
							
							llvm-svn: 174617 
							
						 
						
							2013-02-07 15:04:06 +00:00  
				
					
						
							
							
								 
						
							
								109aa04ea9 
								
							 
						 
						
							
							
								
								[sanitizer_common] Fix lint warnings.  
							
							... 
							
							
							
							llvm-svn: 174616 
							
						 
						
							2013-02-07 14:58:04 +00:00  
				
					
						
							
							
								 
						
							
								07c740e213 
								
							 
						 
						
							
							
								
								[ASan] Fix a compilation warning.  
							
							... 
							
							
							
							llvm-svn: 174604 
							
						 
						
							2013-02-07 12:00:40 +00:00  
				
					
						
							
							
								 
						
							
								f444a49310 
								
							 
						 
						
							
							
								
								[ASan] Implement asan_mz_size(), asan_mz_force_lock() and asan_mz_force_unlock() for allocator2.  
							
							... 
							
							
							
							Switch to allocator2 on Darwin.
llvm-svn: 174603 
							
						 
						
							2013-02-07 11:40:03 +00:00  
				
					
						
							
							
								 
						
							
								7981ea8baa 
								
							 
						 
						
							
							
								
								asan/tsan: fix compilation errors/bugs on Windows where long is 32-bit even in 64-bit mode  
							
							... 
							
							
							
							llvm-svn: 174312 
							
						 
						
							2013-02-04 08:07:45 +00:00  
				
					
						
							
							
								 
						
							
								6cff9deb16 
								
							 
						 
						
							
							
								
								Use the correct order of NOINLINE vs ret type to fix Windows build  
							
							... 
							
							
							
							llvm-svn: 173694 
							
						 
						
							2013-01-28 17:29:50 +00:00  
				
					
						
							
							
								 
						
							
								fa79cd65e2 
								
							 
						 
						
							
							
								
								[sanitizer] fix calloc overflow in asan/tsan/msan  
							
							... 
							
							
							
							llvm-svn: 173441 
							
						 
						
							2013-01-25 11:46:22 +00:00  
				
					
						
							
							
								 
						
							
								6e406cda4b 
								
							 
						 
						
							
							
								
								tsan: implement malloc stats querying  
							
							... 
							
							
							
							llvm-svn: 173332 
							
						 
						
							2013-01-24 09:08:03 +00:00  
				
					
						
							
							
								 
						
							
								7206a145dd 
								
							 
						 
						
							
							
								
								[sanitizer] increase the minimal mmap size in allocator to 2^16; fix the asan Mac build  
							
							... 
							
							
							
							llvm-svn: 173261 
							
						 
						
							2013-01-23 14:07:17 +00:00  
				
					
						
							
							
								 
						
							
								45a698eb58 
								
							 
						 
						
							
							
								
								asan: faster thead-local cache for memory allocator  
							
							... 
							
							
							
							llvm-svn: 172521 
							
						 
						
							2013-01-15 09:02:20 +00:00  
				
					
						
							
							
								 
						
							
								4ebb4e5565 
								
							 
						 
						
							
							
								
								asan/tsan: mmap shadow memory before allocating memory (otherwise other threads can access non yet allocated shadow)  
							
							... 
							
							
							
							llvm-svn: 172395 
							
						 
						
							2013-01-14 10:49:11 +00:00  
				
					
						
							
							
								 
						
							
								38092f628b 
								
							 
						 
						
							
							
								
								asan/tsan: fix memory allocator statistics  
							
							... 
							
							
							
							llvm-svn: 172390 
							
						 
						
							2013-01-14 08:51:08 +00:00  
				
					
						
							
							
								 
						
							
								795eb90db5 
								
							 
						 
						
							
							
								
								asan/tsan: faster memory allocator  
							
							... 
							
							
							
							1. Increase size classes from 32k to 128k
2. Use lock-free stack in central cache
3. Use blocking mutex when allocate new memory with mmap
llvm-svn: 172388 
							
						 
						
							2013-01-14 08:23:34 +00:00  
				
					
						
							
							
								 
						
							
								f22982bf0a 
								
							 
						 
						
							
							
								
								asan/tsan: move blocking mutex from asan to sanitizer_common  
							
							... 
							
							
							
							llvm-svn: 172380 
							
						 
						
							2013-01-14 07:51:39 +00:00  
				
					
						
							
							
								 
						
							
								ecd73d36d4 
								
							 
						 
						
							
							
								
								asan/tsan: faster memory allocator  
							
							... 
							
							
							
							replace lists with arrays
llvm-svn: 172217 
							
						 
						
							2013-01-11 16:41:19 +00:00  
				
					
						
							
							
								 
						
							
								008dba6aa0 
								
							 
						 
						
							
							
								
								asan: always pass allocator cache to Allocate()  
							
							... 
							
							
							
							llvm-svn: 172193 
							
						 
						
							2013-01-11 11:15:48 +00:00  
				
					
						
							
							
								 
						
							
								fdcfbda750 
								
							 
						 
						
							
							
								
								[sanitizer] better statistics for the large allocator  
							
							... 
							
							
							
							llvm-svn: 172069 
							
						 
						
							2013-01-10 13:38:38 +00:00  
				
					
						
							
							
								 
						
							
								22c53df947 
								
							 
						 
						
							
							
								
								asan/tsan: fix comment  
							
							... 
							
							
							
							llvm-svn: 172064 
							
						 
						
							2013-01-10 13:06:35 +00:00  
				
					
						
							
							
								 
						
							
								4a42cf69a6 
								
							 
						 
						
							
							
								
								[sanitizer] add statistics to the allocator; fix lint  
							
							... 
							
							
							
							llvm-svn: 171161 
							
						 
						
							2012-12-27 14:09:19 +00:00  
				
					
						
							
							
								 
						
							
								27ad15e165 
								
							 
						 
						
							
							
								
								[asan] asan_allocator2: store the user requested size in just 32 bits (larger sizes use metadata). This allows to put one more 32-bit field into the chunk header  
							
							... 
							
							
							
							llvm-svn: 171089 
							
						 
						
							2012-12-26 04:52:07 +00:00  
				
					
						
							
							
								 
						
							
								eff9b4b9b1 
								
							 
						 
						
							
							
								
								[asan] add a test for right OOB with special large sizes. Fix this test in asan_allocator2. More test tweaking for allocator2  
							
							... 
							
							
							
							llvm-svn: 171058 
							
						 
						
							2012-12-25 09:40:20 +00:00  
				
					
						
							
							
								 
						
							
								ad24c58e16 
								
							 
						 
						
							
							
								
								[sanitizer] increase the maximum size class of the fast allocator. This should save quite a bit of memory in tsan/msan (and later in asan). This also puts more stress on the large allocator. Add a couple of checks  
							
							... 
							
							
							
							llvm-svn: 171055 
							
						 
						
							2012-12-25 07:50:35 +00:00  
				
					
						
							
							
								 
						
							
								fc7de2910c 
								
							 
						 
						
							
							
								
								[sanitizer] make LargeMmapAllocator::GetBlockBegin faster by not using a linked list  
							
							... 
							
							
							
							llvm-svn: 171035 
							
						 
						
							2012-12-24 14:35:14 +00:00  
				
					
						
							
							
								 
						
							
								ebb23c8cfa 
								
							 
						 
						
							
							
								
								[sanitizer] rework the size class map in the sanitizer allocator: make the differences between size classes more uniform.  
							
							... 
							
							
							
							llvm-svn: 171031 
							
						 
						
							2012-12-24 13:41:07 +00:00  
				
					
						
							
							
								 
						
							
								fe80f080ee 
								
							 
						 
						
							
							
								
								[asan] asan_allocator2 fix two asserts that happen on full chrome: a) memalign called with 0 size and large alignment and b) malloc called after TSD has been destructed  
							
							... 
							
							
							
							llvm-svn: 170900 
							
						 
						
							2012-12-21 14:54:46 +00:00  
				
					
						
							
							
								 
						
							
								a1e29adab5 
								
							 
						 
						
							
							
								
								[sanitizer] mmap less on every size class to make the allocator more friendly to small programs  
							
							... 
							
							
							
							llvm-svn: 170895 
							
						 
						
							2012-12-21 13:38:05 +00:00  
				
					
						
							
							
								 
						
							
								479f05b276 
								
							 
						 
						
							
							
								
								[asan] asan_allocator2: improve FindHeapChunkByAddress to find memory chunks to the left of a given address. Almost all tests pass with the new allocator now, only 6 are left to fix.  
							
							... 
							
							
							
							llvm-svn: 170511 
							
						 
						
							2012-12-19 08:32:50 +00:00  
				
					
						
							
							
								 
						
							
								2abbce6701 
								
							 
						 
						
							
							
								
								[sanitizer] one more stability fix in 64-bit allocator  
							
							... 
							
							
							
							llvm-svn: 170498 
							
						 
						
							2012-12-19 06:51:45 +00:00  
				
					
						
							
							
								 
						
							
								12676268fa 
								
							 
						 
						
							
							
								
								[sanitizer] fix LargeMmapAllocator::GetBlockBegin  
							
							... 
							
							
							
							llvm-svn: 170434 
							
						 
						
							2012-12-18 14:56:38 +00:00  
				
					
						
							
							
								 
						
							
								c8208c5258 
								
							 
						 
						
							
							
								
								[sanitizer] fix a bug that has crept into the sanitizer allocator and caused SEGV on allocations between 1Mb and 2Mb, improve the test  
							
							... 
							
							
							
							llvm-svn: 170274 
							
						 
						
							2012-12-15 18:36:23 +00:00  
				
					
						
							
							
								 
						
							
								9806628792 
								
							 
						 
						
							
							
								
								[sanitizer] introduce MmapFixedOrDie and use it in SizeClassAllocator64  
							
							... 
							
							
							
							llvm-svn: 170099 
							
						 
						
							2012-12-13 05:36:00 +00:00  
				
					
						
							
							
								 
						
							
								2ce42e0aef 
								
							 
						 
						
							
							
								
								[sanitizer] change the way SizeClassAllocator64 allocated memory from the system: instead of one huge mmap(NORESERVE) it does one huge mprotect and then does small on-demand mmaps. This allows us to call OnMap callbacks which are required to poison newly allocated memory in asan  
							
							... 
							
							
							
							llvm-svn: 170097 
							
						 
						
							2012-12-13 05:05:11 +00:00  
				
					
						
							
							
								 
						
							
								e29883c10a 
								
							 
						 
						
							
							
								
								[sanitizer] add OnMap/OnUmap callbacks to the allocator interface  
							
							... 
							
							
							
							llvm-svn: 169985 
							
						 
						
							2012-12-12 14:32:18 +00:00  
				
					
						
							
							
								 
						
							
								378f93e804 
								
							 
						 
						
							
							
								
								[sanitizer] fix the build on ancient gcc which has stricter rules about what can be put on TLS. Long term, we absolutely must build the run-times with the fresh target clang  
							
							... 
							
							
							
							llvm-svn: 169593 
							
						 
						
							2012-12-07 09:40:17 +00:00  
				
					
						
							
							
								 
						
							
								6986550c7d 
								
							 
						 
						
							
							
								
								[sanitizer] POD-ify the allocator cache  
							
							... 
							
							
							
							llvm-svn: 169514 
							
						 
						
							2012-12-06 16:22:04 +00:00  
				
					
						
							
							
								 
						
							
								6d2d30f61d 
								
							 
						 
						
							
							
								
								[asan/msan] one more test for 32-bit allocator + minor code simplification  
							
							... 
							
							
							
							llvm-svn: 169507 
							
						 
						
							2012-12-06 14:39:41 +00:00  
				
					
						
							
							
								 
						
							
								c14ae88b08 
								
							 
						 
						
							
							
								
								[asan/msan] add BulkAllocate to the 32-bit allocator (and a test)  
							
							... 
							
							
							
							llvm-svn: 169506 
							
						 
						
							2012-12-06 14:27:32 +00:00  
				
					
						
							
							
								 
						
							
								0f67d01031 
								
							 
						 
						
							
							
								
								[asan/msan] refactor allocator's BulkAllocate (move to AllocatorFreeList)  
							
							... 
							
							
							
							llvm-svn: 169503 
							
						 
						
							2012-12-06 13:34:11 +00:00  
				
					
						
							
							
								 
						
							
								9f84eecc9e 
								
							 
						 
						
							
							
								
								[asan/msan] add GetBlockBegin to the 32-bit allocator (+test)  
							
							... 
							
							
							
							llvm-svn: 169499 
							
						 
						
							2012-12-06 13:13:58 +00:00  
				
					
						
							
							
								 
						
							
								2044135dca 
								
							 
						 
						
							
							
								
								[asan/msan] new 32-bit allocator, basic functionality so far  
							
							... 
							
							
							
							llvm-svn: 169496 
							
						 
						
							2012-12-06 12:49:28 +00:00  
				
					
						
							
							
								 
						
							
								571232b8cf 
								
							 
						 
						
							
							
								
								[tsan] get rid of *allocator64* files, moving everything to *allocator* files. This will help with the 32-bit allocator implementation and testing  
							
							... 
							
							
							
							llvm-svn: 169368 
							
						 
						
							2012-12-05 10:09:15 +00:00  
				
					
						
							
							
								 
						
							
								f299288f55 
								
							 
						 
						
							
							
								
								[tsan] minor interface refactoring  
							
							... 
							
							
							
							llvm-svn: 169267 
							
						 
						
							2012-12-04 14:15:17 +00:00  
				
					
						
							
							
								 
						
							
								5e6f833bdd 
								
							 
						 
						
							
							
								
								[tsan] refactor the allocator tests to allow testing other flavours of the allocator (add templates)  
							
							... 
							
							
							
							llvm-svn: 169264 
							
						 
						
							2012-12-04 13:59:22 +00:00  
				
					
						
							
							
								 
						
							
								077f88045e 
								
							 
						 
						
							
							
								
								[tsan] refactoring and comment changes in sanitizer_common/sanitizer_allocator{,64}.h. No functionality change  
							
							... 
							
							
							
							llvm-svn: 169234 
							
						 
						
							2012-12-04 07:54:41 +00:00