Lower memory threshold for parse_tensor_op_fuzz
				
					
				
			This is needed because ASAN builds have additional checks with additional memory footprint so fuzzer that was at the borderline just below OOM threshold now OOMs. PiperOrigin-RevId: 343538697 Change-Id: I42672e103bdc95b65c5a8d37578fc4eb796050a0
This commit is contained in:
		
							parent
							
								
									2139560d99
								
							
						
					
					
						commit
						5abf12375e
					
				| @ -41,6 +41,8 @@ class FuzzParseTensor : public FuzzSession { | |||||||
|     // remainder of the fuzzer testing. Of course, this duplicates some work
 |     // remainder of the fuzzer testing. Of course, this duplicates some work
 | ||||||
|     // but it's better than repeating the investigation whenever Autofuzz
 |     // but it's better than repeating the investigation whenever Autofuzz
 | ||||||
|     // detects another similar OOM.
 |     // detects another similar OOM.
 | ||||||
|  |     // After adding `-fsanitize=null` to ASAN (cl/317376103), the memory
 | ||||||
|  |     // footprint increased, so we lower the maximum threshold to 2^18.
 | ||||||
|     string as_string = string(reinterpret_cast<const char*>(data), size); |     string as_string = string(reinterpret_cast<const char*>(data), size); | ||||||
|     TensorProto proto; |     TensorProto proto; | ||||||
|     if (!ParseProtoUnlimited(&proto, as_string)) { |     if (!ParseProtoUnlimited(&proto, as_string)) { | ||||||
| @ -53,7 +55,7 @@ class FuzzParseTensor : public FuzzSession { | |||||||
|     } |     } | ||||||
|     TensorShape shape(proto.tensor_shape()); |     TensorShape shape(proto.tensor_shape()); | ||||||
|     const int64 num_elements = shape.num_elements(); |     const int64 num_elements = shape.num_elements(); | ||||||
|     const int64 max_num_elements = 1 << 20; |     const int64 max_num_elements = 1 << 18; | ||||||
|     if (num_elements > max_num_elements) { |     if (num_elements > max_num_elements) { | ||||||
|       LOG(WARNING) << "Requiring a tensor with too many elements\n"; |       LOG(WARNING) << "Requiring a tensor with too many elements\n"; | ||||||
|       return; |       return; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user