ramosian-glider / sanitizer-issues

test
0 stars 0 forks source link

AddressSanitizerInterface.GetOwnershipStressTest affects the run-time of other tests #77

Closed ramosian-glider closed 9 years ago

ramosian-glider commented 9 years ago

Originally reported on Google Code with ID 77

Reproduce (x86_64 linux): 

% ./bin_linux/asan_test64 --gtest_filter=AddressSanitizerInterface.GetOwnershipStressTest:AddressSanitizer.OOB_*
2>&1 | grep OK
[       OK ] AddressSanitizerInterface.GetOwnershipStressTest (3854 ms)
[       OK ] AddressSanitizer.OOB_char (5224 ms)
[       OK ] AddressSanitizer.OOB_int (5208 ms)

./bin_linux/asan_test64 --gtest_filter=AddressSanitizer.OOB_* 2>&1 | grep OK
[       OK ] AddressSanitizer.OOB_char (760 ms)
[       OK ] AddressSanitizer.OOB_int (794 ms)

I suspect that multiple mallocs in AddressSanitizerInterface.GetOwnershipStressTest
interfere with the death tests in AddressSanitizer.OOB_char somehow. 

Reported by konstantin.s.serebryany on 2012-06-05 13:23:41

ramosian-glider commented 9 years ago
Simple experiment: 

TEST(AddressSanitizer, MultipleDeathTest) {                                       

  for (int i = 0; i < 100; i++) {                                                 

    EXPECT_DEATH(exit(1), "");                                                    

  }                                                                               

}                                                                                 

TEST(AddressSanitizer, MultipleDeathAndMallocTest) {                              

  free_aaa(malloc_aaa(1 << 29));                                                  

  for (int i = 0; i < 100; i++) {                                                 

    EXPECT_DEATH(exit(1), "");                                                    

  }                                                                               

}                

The first test runs < 2 seconds, the second test runs 10 seconds.
Looks like the cost of the death test depends on the amount of reserved memory. 
Oh my...  

Reported by konstantin.s.serebryany on 2012-06-05 13:36:27

ramosian-glider commented 9 years ago
Fixed by reordering tests (r157997.)

Reported by konstantin.s.serebryany on 2012-06-05 13:49:57

ramosian-glider commented 9 years ago
Adding Project:AddressSanitizer as part of GitHub migration.

Reported by ramosian.glider on 2015-07-30 09:12:59