GoogleTest cases always crashing

45 views
Skip to first unread message

Satya Prakash Prasad

unread,
Aug 14, 2017, 9:46:00 AM8/14/17
to Google C++ Testing Framework
We have a GMOCKed test cases and it always crashes after it has been rub - below is the GDB output for same - I am unsure why it is crashing -

PS C:\test> gdb .\ Unittest.exe                                                                                          GNU gdb (GDB) 7.9.1                                                                                                     Copyright (C) 2015 Free Software Foundation, Inc.                                                                       License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>                                           This is free software: you are free to change and redistribute it.                                                      There is NO WARRANTY, to the extent permitted by law.  Type "show copying"                                              and "show warranty" for details.                                                                                        This GDB was configured as "x86_64-w64-mingw32".                                                                        Type "show configuration" for configuration details.                                                                    For bug reporting instructions, please see:                                                                             <http://www.gnu.org/software/gdb/bugs/>.                                                                                Find the GDB manual and other documentation resources online at:                                                        <http://www.gnu.org/software/gdb/documentation/>.                                                                       For help, type "help".                                                                                                  Type "apropos word" to search for commands related to "word"...                                                         Reading symbols from .\ Unittest.exe...done.                    (gdb) break Test.cpp:54                                                                                   Breakpoint 1 at 0x401ebd: file C:/test/Test.cpp, line 54.                                                                                                            
(gdb) s
 1000                                                                                                            The program is not being run.                                                                                           (gdb) run                                                                                                               Starting program: C:\ Unittest.exe                                                                                  [New Thread 9692.0xafc]                                                                                                 Running main() from gmock_main.cc                                                                                       [==========] Running 1 test from 1 test case.                                                                           [----------] Global test environment set-up.                                                                            [----------] 1 test from EthPktLockFree                                                                                 [ RUN      ] TEST.RUNTEST                                                                                                                                                                                                   Breakpoint 1,C:/test/Test.cpp Test:RunTest(3545 ms)                                                                 [----------] 1 test from Test (3591 ms total)                                                                                                                                                                                         [----------] Global test environment tear-down                                                                          [==========] 1 test from 1 test case ran. (3684 ms total)                                                               [  PASSED  ] 1 test.                                                                                                    287       for (typename Container::const_iterator it = c.begin(); it != c.end(); ++it) {                               
(gdb) s
                                                                                                                 operator!=<testing::TestInfo* const*, std::vector<testing::TestInfo*> > (__rhs=..., __lhs=<synthetic pointer>)              at C:/tools/mingw64/x86_64-w64-mingw32/include/c++/bits/stl_iterator.h:832                                          832         { return __lhs.base() != __rhs.base(); }                                                                    
(gdb) s
                                                                                                                 CountIf<std::vector<testing::TestInfo*>, bool (*)(testing::TestInfo const*)> (                                              predicate=0x433dc0 <testing::TestCase::TestFailed(testing::TestInfo const*)>,                                           c=std::vector of length 1, capacity 1 = {...})                                                                          at C:/test/googletest/googletest/src/gtest-internal-inl.h:287                                   287       for (typename Container::const_iterator it = c.begin(); it != c.end(); ++it) {                               
(gdb) s
                                                                                                                 288         if (predicate(*it))                                                                                        
(gdb) s
                                                                                                                 testing::TestCase::TestFailed (test_info=0x3f5c00)                                                                          at C:/test/googletest/googletest/include/gtest/gtest.h:900                                      900         return test_info->should_run() && test_info->result()->Failed();                                           
(gdb) s
                                                                                                                 should_run (this=0x3f5c00) at C:/test/googletest/googletest/include/gtest/gtest.h:694               694       bool should_run() const { return should_run_; }                                                              
(gdb) s
                                                                                                                 testing::TestCase::TestFailed (test_info=0x3f5c00)                                                                          at C:/test/googletest/googletest/include/gtest/gtest.h:900                                      900         return test_info->should_run() && test_info->result()->Failed();                                           
(gdb) s
                                                                                                                 result (this=0x3f5c00) at C:/test/googletest/googletest/include/gtest/gtest.h:705                   705       const TestResult* result() const { return &result_; }                                                         
(gdb) s
                                                                                                                 testing::TestCase::TestFailed (test_info=0x3f5c00)                                                                          at C:/test/googletest/googletest/include/gtest/gtest.h:900                                      900         return test_info->should_run() && test_info->result()->Failed();                                           
(gdb) s
                                                                                                                 testing::TestResult::Failed (this=0x3f5c48) at C:/test/googletest/googletest/src/gtest.cc:2171      2171      for (int i = 0; i < total_part_count(); ++i) {                                                                
(gdb) s
                                                                                                                 testing::TestResult::total_part_count (this=this@entry=0x3f5c48)                                                            at C:/test/googletest/googletest/src/gtest.cc:2201                                              2201      return static_cast<int>(test_part_results_.size());                                                           
(gdb) s
 20                                                                                                              287       for (typename Container::const_iterator it = c.begin(); it != c.end(); ++it) {                               
(gdb) s
                                                                                                                 operator!=<testing::TestCase* const*, std::vector<testing::TestCase*> > (__rhs=..., __lhs=<synthetic pointer>)              at C:/tools/mingw64/x86_64-w64-mingw32/include/c++/bits/stl_iterator.h:832                                          832         { return __lhs.base() != __rhs.base(); }                                                                   
(gdb) s
                                                                                                                 CountIf<std::vector<testing::TestCase*>, bool (*)(testing::TestCase const*)> (                                              predicate=0x4026c5 <testing::internal::TestCaseFailed(testing::TestCase const*)>,                                       c=std::vector of length 1, capacity 1 = {...})                                                                          at C:/test/googletest/googletest/src/gtest-internal-inl.h:287                                   287       for (typename Container::const_iterator it = c.begin(); it != c.end(); ++it) {                               
(gdb) s
                                                                                                                 288         if (predicate(*it))                                                                                        
(gdb) s
                                                                                                                 testing::internal::TestCaseFailed (test_case=0x3f63d0)                                                                      at C:/test/googletest/googletest/src/gtest.cc:351                                               351       return test_case->should_run() && test_case->Failed();                                                       
(gdb) s
                                                                                                                 should_run (this=0x3f63d0) at C:/test/googletest/googletest/include/gtest/gtest.h:811               811       bool should_run() const { return should_run_; }                                                              
(gdb) s
                                                                                                                 testing::internal::TestCaseFailed (test_case=0x3f63d0)                                                                      at C:/test/googletest/googletest/src/gtest.cc:351                                               351       return test_case->should_run() && test_case->Failed();                                                       
(gdb) s
                                                                                                                 Failed (this=0x3f63d0) at C:/test/googletest/googletest/include/gtest/gtest.h:838                   838       bool Failed() const { return failed_test_count() > 0; }                                                      
(gdb) s
                                                                                                                 testing::TestCase::failed_test_count (this=0x3f63d0)                                                                        at C:/test/googletest/googletest/src/gtest.cc:2683                                              2683      return CountIf(test_info_list_, TestFailed);                                                                 
(gdb) s
                                                                                                                 CountIf<std::vector<testing::TestInfo*>, bool (*)(testing::TestInfo const*)> (                                              predicate=0x433dc0 <testing::TestCase::TestFailed(testing::TestInfo const*)>,                                           c=std::vector of length 1, capacity 1 = {...})                                                                          at C:/test/googletest/googletest/src/gtest-internal-inl.h:287                                   287       for (typename Container::const_iterator it = c.begin(); it != c.end(); ++it) {                               
(gdb) s
                                                                                                                 286       int count = 0;                                                                                                
(gdb) s
                                                                                                                 287       for (typename Container::const_iterator it = c.begin(); it != c.end(); ++it) {                               
(gdb) s
                                                                                                                 operator!=<testing::TestInfo* const*, std::vector<testing::TestInfo*> > (__rhs=..., __lhs=<synthetic pointer>)              at C:/tools/mingw64/x86_64-w64-mingw32/include/c++/bits/stl_iterator.h:832                                          832         { return __lhs.base() != __rhs.base(); }                                                                    
(gdb) s
                                                                                                                 CountIf<std::vector<testing::TestInfo*>, bool (*)(testing::TestInfo const*)> (                                              predicate=0x433dc0 <testing::TestCase::TestFailed(testing::TestInfo const*)>,                                           c=std::vector of length 1, capacity 1 = {...})                                                                          at C:/test/googletest/googletest/src/gtest-internal-inl.h:287                                   287       for (typename Container::const_iterator it = c.begin(); it != c.end(); ++it) {                               
(gdb) s
 10                                                                                                              2176    }                                                                                                              
(gdb) s
                                                                                                                 testing::TestCase::TestFailed (test_info=<optimized out>)                                                                   at C:/test/googletest/googletest/include/gtest/gtest.h:901                                      901       }                                                                                                            
(gdb) s
                                                                                                                 CountIf<std::vector<testing::TestInfo*>, bool (*)(testing::TestInfo const*)> (                                              predicate=0x433dc0 <testing::TestCase::TestFailed(testing::TestInfo const*)>,                                           c=std::vector of length 1, capacity 1 = {...})                                                                          at C:/test/googletest/googletest/src/gtest-internal-inl.h:287                                   287       for (typename Container::const_iterator it = c.begin(); it != c.end(); ++it) {                               
(gdb) s
                                                                                                                 operator++ (this=<synthetic pointer>) at C:/tools/mingw64/x86_64-w64-mingw32/include/c++/bits/stl_iterator.h:751        751             ++_M_current;                                                                                          
(gdb) s
                                                                                                                 CountIf<std::vector<testing::TestInfo*>, bool (*)(testing::TestInfo const*)> (                                              predicate=0x433dc0 <testing::TestCase::TestFailed(testing::TestInfo const*)>,                                           c=std::vector of length 1, capacity 1 = {...})                                                                          at C:/test/googletest/googletest/src/gtest-internal-inl.h:287                                   287       for (typename Container::const_iterator it = c.begin(); it != c.end(); ++it) {                               
(gdb) s
                                                                                                                 operator!=<testing::TestInfo* const*, std::vector<testing::TestInfo*> > (__rhs=..., __lhs=<synthetic pointer>)              at C:/tools/mingw64/x86_64-w64-mingw32/include/c++/bits/stl_iterator.h:832                                          832         { return __lhs.base() != __rhs.base(); }                                                                   
(gdb) s
                                                                                                                 CountIf<std::vector<testing::TestInfo*>, bool (*)(testing::TestInfo const*)> (                                              predicate=0x433dc0 <testing::TestCase::TestFailed(testing::TestInfo const*)>,                                           c=std::vector of length 1, capacity 1 = {...})                                                                          at C:/test/googletest/googletest/src/gtest-internal-inl.h:287                                   287       for (typename Container::const_iterator it = c.begin(); it != c.end(); ++it) {                                
(gdb) s
                                                                                                                 testing::TestCase::failed_test_count (this=0x3f63d0)                                                                        at C:/test/googletest/googletest/src/gtest.cc:2684                                              2684    }                                                                                                              
(gdb) s
                                                                                                                 testing::internal::TestCaseFailed (test_case=<optimized out>)                                                               at C:/test/googletest/googletest/src/gtest.cc:351                                               351       return test_case->should_run() && test_case->Failed();                                                       
(gdb) s
                                                                                                                 352     }                                                                                                              
(gdb) s
                                                                                                                 CountIf<std::vector<testing::TestCase*>, bool (*)(testing::TestCase const*)> (                                              predicate=0x4026c5 <testing::internal::TestCaseFailed(testing::TestCase const*)>,                                       c=std::vector of length 1, capacity 1 = {...})                                                                          at C:/test/googletest/googletest/src/gtest-internal-inl.h:287                                   287       for (typename Container::const_iterator it = c.begin(); it != c.end(); ++it) {                               
(gdb) s
                                                                                                                 operator++ (this=<synthetic pointer>) at C:/tools/mingw64/x86_64-w64-mingw32/include/c++/bits/stl_iterator.h:751        751             ++_M_current;                                                                                          
(gdb) s
                                                                                                                 CountIf<std::vector<testing::TestCase*>, bool (*)(testing::TestCase const*)> (                                              predicate=0x4026c5 <testing::internal::TestCaseFailed(testing::TestCase const*)>,                                       c=std::vector of length 1, capacity 1 = {...})                                                                          at C:/test/googletest/googletest/src/gtest-internal-inl.h:287                                   287       for (typename Container::const_iterator it = c.begin(); it != c.end(); ++it) {                               
(gdb) s
                                                                                                                 operator!=<testing::TestCase* const*, std::vector<testing::TestCase*> > (__rhs=..., __lhs=<synthetic pointer>)              at C:/tools/mingw64/x86_64-w64-mingw32/include/c++/bits/stl_iterator.h:832                                          832         { return __lhs.base() != __rhs.base(); }                                                                   
(gdb) s
                                                                                                                 CountIf<std::vector<testing::TestCase*>, bool (*)(testing::TestCase const*)> (                                              predicate=0x4026c5 <testing::internal::TestCaseFailed(testing::TestCase const*)>,                                       c=std::vector of length 1, capacity 1 = {...})                                                                          at C:/test/googletest/googletest/src/gtest-internal-inl.h:287                                   287       for (typename Container::const_iterator it = c.begin(); it != c.end(); ++it) {                                
(gdb) s
                                                                                                                 testing::internal::UnitTestImpl::failed_test_case_count (this=this@entry=0x3f6000)                                          at C:/test/googletest/googletest/src/gtest.cc:737                                               737     }                                                                                                              
(gdb) s
                                                                                                                 ad_hoc_test_result (this=0x3f6000) at C:/test/googletest/googletest/src/gtest-internal-inl.h:597    597       const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; }                                
(gdb) s
                                                                                                                 Failed (this=0x3f6000) at C:/test/googletest/googletest/src/gtest-internal-inl.h:572                572         return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed();                                     
(gdb) s
                                                                                                                 testing::TestResult::Failed (this=this@entry=0x3f60e0)                                                                      at C:/test/googletest/googletest/src/gtest.cc:2171                                              2171      for (int i = 0; i < total_part_count(); ++i) {                                                               
(gdb) s
                                                                                                                 testing::TestResult::total_part_count (this=this@entry=0x3f60e0)                                                            at C:/test/googletest/googletest/src/gtest.cc:2201                                              2201      return static_cast<int>(test_part_results_.size());                                                           
(gdb) s
                                                                                                                 size (this=0x3f60f8) at C:/tools/mingw64/x86_64-w64-mingw32/include/c++/bits/stl_vector.h:655                           655           { return size_type(this->_M_impl._M_finish - this->_M_impl._M_start); }                                  
(gdb) s
                                                                                                                 testing::TestResult::total_part_count (this=this@entry=0x3f60e0)                                                            at C:/test/googletest/googletest/src/gtest.cc:2202                                              2202    }                                                                                                               
(gdb) s
                                                                                                                 testing::TestResult::Failed (this=this@entry=0x3f60e0)                                                                      at C:/test/googletest/googletest/src/gtest.cc:2175                                              2175      return false;                                                                                                 
(gdb) s
                                                                                                                 2176    }                                                                                                               
(gdb) s
                                                                                                                 Passed (this=0x3f6000) at C:/test/googletest/googletest/src/gtest-internal-inl.h:567                567       bool Passed() const { return !Failed(); }                                                                    
(gdb) s
                                                                                                                 testing::UnitTest::Passed (this=this@entry=0x4b8160 <testing::UnitTest::GetInstance()::instance>)                           at C:/test/googletest/googletest/src/gtest.cc:4055                                              4055    bool UnitTest::Passed() const { return impl()->Passed(); }                                                      
(gdb) s
                                                                                                                 testing::internal::PrettyUnitTestResultPrinter::OnTestIterationEnd (this=<optimized out>, unit_test=...)                    at C:/test/googletest/googletest/src/gtest.cc:3217                                              3217      int num_disabled = unit_test.reportable_disabled_test_count();                                               
(gdb) s
                                                                                                                 testing::UnitTest::reportable_disabled_test_count (                                                                         this=this@entry=0x4b8160 <testing::UnitTest::GetInstance()::instance>)                                                  at C:/test/googletest/googletest/src/gtest.cc:4024                                              4024      return impl()->reportable_disabled_test_count();                                                              
(gdb) s
                                                                                                                 impl (this=0x4b8160 <testing::UnitTest::GetInstance()::instance>)                                                           at C:/test/googletest/googletest/include/gtest/gtest.h:1288                                     1288      const internal::UnitTestImpl* impl() const { return impl_; }                                                 
(gdb) s
                                                                                                                 testing::UnitTest::reportable_disabled_test_count (                                                                         this=this@entry=0x4b8160 <testing::UnitTest::GetInstance()::instance>)                                                  at C:/test/googletest/googletest/src/gtest.cc:4024                                              4024      return impl()->reportable_disabled_test_count();                                                             
(gdb) s
                                                                                                                 testing::internal::UnitTestImpl::reportable_disabled_test_count (this=0x3f6000)                                             at C:/test/googletest/googletest/src/gtest.cc:763                                               763                                  &TestCase::reportable_disabled_test_count);                                        
(gdb) s
                                                                                                                 testing::internal::SumOverTestCaseList (case_list=std::vector of length 1, capacity 1 = {...},                              method=(int (testing::TestCase::*)(const testing::TestCase * const)) 0x40299e <testing::TestCase::reportable_disabled_test_count() const>) at C:/test/googletest/googletest/src/gtest.cc:338                            338       for (size_t i = 0; i < case_list.size(); i++) {                                                              
(gdb) s
                                                                                                                 337       int sum = 0;                                                                                                  
(gdb) s
                                                                                                                 338       for (size_t i = 0; i < case_list.size(); i++) {                                                               
(gdb) s
                                                                                                                 size (this=0x3f6080) at C:/tools/mingw64/x86_64-w64-mingw32/include/c++/bits/stl_vector.h:655                           655           { return size_type(this->_M_impl._M_finish - this->_M_impl._M_start); }                                  
(gdb) s
                                                                                                                 testing::internal::SumOverTestCaseList (case_list=std::vector of length 1, capacity 1 = {...},                              method=(int (testing::TestCase::*)(const testing::TestCase * const)) 0x40299e <testing::TestCase::reportable_disabled_test_count() const>) at C:/test/googletest/googletest/src/gtest.cc:338                            338       for (size_t i = 0; i < case_list.size(); i++) {                                                              
(gdb) s
                                                                                                                 339         sum += (case_list[i]->*method)();                                                                          
(gdb) s
                                                                                                                 testing::TestCase::reportable_disabled_test_count (this=0x3f63d0)                                                           at C:/test/googletest/googletest/src/gtest.cc:2688                                              2688      return CountIf(test_info_list_, TestReportableDisabled);                                                     
(gdb) s
                                                                                                                 CountIf<std::vector<testing::TestInfo*>, bool (*)(testing::TestInfo const*)> (                                              predicate=0x433e70 <testing::TestCase::TestReportableDisabled(testing::TestInfo const*)>,                               c=std::vector of length 1, capacity 1 = {...})                                                                          at C:/test/googletest/googletest/src/gtest-internal-inl.h:287                                   287       for (typename Container::const_iterator it = c.begin(); it != c.end(); ++it) {                               
(gdb) s
                                                                                                                 286       int count = 0;                                                                                                
(gdb) s
                                                                                                                 287       for (typename Container::const_iterator it = c.begin(); it != c.end(); ++it) {                               
(gdb) s
                                                                                                                 operator!=<testing::TestInfo* const*, std::vector<testing::TestInfo*> > (__rhs=..., __lhs=<synthetic pointer>)              at C:/tools/mingw64/x86_64-w64-mingw32/include/c++/bits/stl_iterator.h:832                                          832         { return __lhs.base() != __rhs.base(); }                                                                    
(gdb) s
                                                                                                                 CountIf<std::vector<testing::TestInfo*>, bool (*)(testing::TestInfo const*)> (                                              predicate=0x433e70 <testing::TestCase::TestReportableDisabled(testing::TestInfo const*)>,                               c=std::vector of length 1, capacity 1 = {...})                                                                          at C:/test/googletest/googletest/src/gtest-internal-inl.h:287                                   287       for (typename Container::const_iterator it = c.begin(); it != c.end(); ++it) {                               
(gdb) s
                                                                                                                 288         if (predicate(*it))                                                                                        
(gdb) s
                                                                                                                 testing::TestCase::TestReportableDisabled (test_info=0x3f5c00)                                                              at C:/test/googletest/googletest/include/gtest/gtest.h:906                                      906         return test_info->is_reportable() && test_info->is_disabled_;                                              
(gdb) s
                                                                                                                 CountIf<std::vector<testing::TestInfo*>, bool (*)(testing::TestInfo const*)> (                                              predicate=0x433e70 <testing::TestCase::TestReportableDisabled(testing::TestInfo const*)>,                               c=std::vector of length 1, capacity 1 = {...})                                                                          at C:/test/googletest/googletest/src/gtest-internal-inl.h:287                                   287       for (typename Container::const_iterator it = c.begin(); it != c.end(); ++it) {                               
(gdb) s
                                                                                                                 operator++ (this=<synthetic pointer>) at C:/tools/mingw64/x86_64-w64-mingw32/include/c++/bits/stl_iterator.h:751        751             ++_M_current;                                                                                          
(gdb) s
                                                                                                                 CountIf<std::vector<testing::TestInfo*>, bool (*)(testing::TestInfo const*)> (                                              predicate=0x433e70 <testing::TestCase::TestReportableDisabled(testing::TestInfo const*)>,                               c=std::vector of length 1, capacity 1 = {...})                                                                          at C:/test/googletest/googletest/src/gtest-internal-inl.h:287                                   287       for (typename Container::const_iterator it = c.begin(); it != c.end(); ++it) {                               
(gdb) s
                                                                                                                 operator!=<testing::TestInfo* const*, std::vector<testing::TestInfo*> > (__rhs=..., __lhs=<synthetic pointer>)              at C:/tools/mingw64/x86_64-w64-mingw32/include/c++/bits/stl_iterator.h:832                                          832         { return __lhs.base() != __rhs.base(); }                                                                   
(gdb) s
                                                                                                                 CountIf<std::vector<testing::TestInfo*>, bool (*)(testing::TestInfo const*)> (                                              predicate=0x433e70 <testing::TestCase::TestReportableDisabled(testing::TestInfo const*)>,                               c=std::vector of length 1, capacity 1 = {...})                                                                          at C:/test/googletest/googletest/src/gtest-internal-inl.h:287                                   287       for (typename Container::const_iterator it = c.begin(); it != c.end(); ++it) {                                
(gdb) s
                                                                                                                 testing::TestCase::reportable_disabled_test_count (this=0x3f63d0)                                                           at C:/test/googletest/googletest/src/gtest.cc:2689                                              2689    }                                                                                                              
(gdb) s
                                                                                                                 testing::internal::SumOverTestCaseList (case_list=std::vector of length 1, capacity 1 = {...},                              method=(int (testing::TestCase::*)(const testing::TestCase * const)) 0x40299e <testing::TestCase::reportable_disabled_test_count() const>) at C:/test/googletest/googletest/src/gtest.cc:338                            338       for (size_t i = 0; i < case_list.size(); i++) {                                                               
(gdb) s
                                                                                                                 size (this=0x3f6080) at C:/tools/mingw64/x86_64-w64-mingw32/include/c++/bits/stl_vector.h:655                           655           { return size_type(this->_M_impl._M_finish - this->_M_impl._M_start); }                                  
(gdb) s
                                                                                                                 testing::internal::SumOverTestCaseList (case_list=std::vector of length 1, capacity 1 = {...},                              method=(int (testing::TestCase::*)(const testing::TestCase * const)) 0x40299e <testing::TestCase::reportable_disabled_test_count() const>) at C:/test/googletest/googletest/src/gtest.cc:338                            338       for (size_t i = 0; i < case_list.size(); i++) {                                                              
(gdb) s
                                                                                                                 342     }                                                                                                              
(gdb) s
                                                                                                                 testing::internal::UnitTestImpl::reportable_disabled_test_count (this=<optimized out>)                                      at C:/test/googletest/googletest/src/gtest.cc:764                                               764     }                                                                                                              
(gdb) s
                                                                                                                 testing::UnitTest::reportable_disabled_test_count (                                                                         this=this@entry=0x4b8160 <testing::UnitTest::GetInstance()::instance>)                                                  at C:/test/googletest/googletest/src/gtest.cc:4025                                              4025    }                                                                                                              
(gdb) s
                                                                                                                 testing::internal::PrettyUnitTestResultPrinter::OnTestIterationEnd (this=<optimized out>, unit_test=...)                    at C:/test/googletest/googletest/src/gtest.cc:3218                                              3218      if (num_disabled && !GTEST_FLAG(also_run_disabled_tests)) {                                                  
(gdb) s
                                                                                                                 3228      fflush(stdout);                                                                                              
(gdb) s
                                                                                                                 3229    }                                                                                                              
(gdb) s
                                                                                                                 testing::internal::TestEventRepeater::OnTestIterationEnd (this=0x3f6270, unit_test=..., iteration=0)                        at C:/test/googletest/googletest/src/gtest.cc:3340                                              3340        for (int i = static_cast<int>(listeners_.size()) - 1; i >= 0; i--) {                                       
(gdb) s
 50                                                                                                              4957        test_cases_[i]->UnshuffleTests();                                                                           
(gdb) s
                                                                                                                 testing::TestCase::UnshuffleTests (this=0x3f63d0)                                                                           at C:/test/googletest/googletest/src/gtest.cc:2799                                              2799      for (size_t i = 0; i < test_indices_.size(); i++) {                                                          
(gdb) s
                                                                                                                 size (this=0x3f6400) at C:/tools/mingw64/x86_64-w64-mingw32/include/c++/bits/stl_vector.h:655                           655           { return size_type(this->_M_impl._M_finish - this->_M_impl._M_start); }                                  
(gdb) s
                                                                                                                 testing::TestCase::UnshuffleTests (this=0x3f63d0)                                                                           at C:/test/googletest/googletest/src/gtest.cc:2799                                              2799      for (size_t i = 0; i < test_indices_.size(); i++) {                                                           
(gdb) s
                                                                                                                 2800        test_indices_[i] = static_cast<int>(i);                                                                     
(gdb) s
                                                                                                                 2799      for (size_t i = 0; i < test_indices_.size(); i++) {                                                           
(gdb) s
                                                                                                                 size (this=0x3f6400) at C:/tools/mingw64/x86_64-w64-mingw32/include/c++/bits/stl_vector.h:655                           655           { return size_type(this->_M_impl._M_finish - this->_M_impl._M_start); }                                  
(gdb) s
                                                                                                                 testing::TestCase::UnshuffleTests (this=0x3f63d0)                                                                           at C:/test/googletest/googletest/src/gtest.cc:2799                                              2799      for (size_t i = 0; i < test_indices_.size(); i++) {                                                          
(gdb) s
                                                                                                                 2802    }                                                                                                               
(gdb) s
                                                                                                                 testing::internal::UnitTestImpl::UnshuffleTests (this=this@entry=0x3f6000)                                                  at C:/test/googletest/googletest/src/gtest.cc:4959                                              4959        test_case_indices_[i] = static_cast<int>(i);                                                               
(gdb) s
                                                                                                                 operator[] (__n=0, this=0x3f6098) at C:/tools/mingw64/x86_64-w64-mingw32/include/c++/bits/stl_vector.h:780              780           { return *(this->_M_impl._M_start + __n); }                                                              
(gdb) s
                                                                                                                 testing::internal::UnitTestImpl::UnshuffleTests (this=this@entry=0x3f6000)                                                  at C:/test/googletest/googletest/src/gtest.cc:4959                                              4959        test_case_indices_[i] = static_cast<int>(i);                                                                
(gdb) s
                                                                                                                 4955      for (size_t i = 0; i < test_cases_.size(); i++) {                                                             
(gdb) s
                                                                                                                 size (this=0x3f6080) at C:/tools/mingw64/x86_64-w64-mingw32/include/c++/bits/stl_vector.h:655                           655           { return size_type(this->_M_impl._M_finish - this->_M_impl._M_start); }                                  
(gdb) s
                                                                                                                 testing::internal::UnitTestImpl::UnshuffleTests (this=this@entry=0x3f6000)                                                  at C:/test/googletest/googletest/src/gtest.cc:4955                                              4955      for (size_t i = 0; i < test_cases_.size(); i++) {                                                            
(gdb) s
                                                                                                                 4961    }                                                                                                               
(gdb) s
                                                                                                                 testing::internal::UnitTestImpl::RunAllTests (this=0x3f6000)                                                                at C:/test/googletest/googletest/src/gtest.cc:4678                                              4678        if (GTEST_FLAG(shuffle)) {                                                                                  
(gdb) s
                                                                                                                 4618      for (int i = 0; forever || i != repeat; i++) {                                                                
(gdb) s
                                                                                                                 4684      repeater->OnTestProgramEnd(*parent_);                                                                        
(gdb) s
                                                                                                                 testing::internal::TestEventRepeater::OnTestProgramEnd (this=0x3f6270, parameter=...)                                       at C:/test/googletest/googletest/src/gtest.cc:3323                                              3323    GTEST_REVERSE_REPEATER_METHOD_(OnTestProgramEnd, UnitTest)                                                     
(gdb) s
                                                                                                                 size (this=0x3f6280) at C:/tools/mingw64/x86_64-w64-mingw32/include/c++/bits/stl_vector.h:655                           655           { return size_type(this->_M_impl._M_finish - this->_M_impl._M_start); }                                  
(gdb) s
                                                                                                                 testing::internal::TestEventRepeater::OnTestProgramEnd (this=0x3f6270, parameter=...)                                       at C:/test/googletest/googletest/src/gtest.cc:3323                                              3323    GTEST_REVERSE_REPEATER_METHOD_(OnTestProgramEnd, UnitTest)                                                     
(gdb) s
                                                                                                                 operator[] (__n=0, this=0x3f6280) at C:/tools/mingw64/x86_64-w64-mingw32/include/c++/bits/stl_vector.h:780              780           { return *(this->_M_impl._M_start + __n); }                                                              
(gdb) s
                                                                                                                 testing::internal::TestEventRepeater::OnTestProgramEnd (this=0x3f6270, parameter=...)                                       at C:/test/googletest/googletest/src/gtest.cc:3323                                              3323    GTEST_REVERSE_REPEATER_METHOD_(OnTestProgramEnd, UnitTest)                                                      
(gdb) s
                                                                                                                 testing::internal::PrettyUnitTestResultPrinter::OnTestProgramEnd (this=0x3f6350)                                            at C:/test/googletest/googletest/src/gtest.cc:3049                                              3049      virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}                                              
(gdb) s
                                                                                                                 testing::internal::UnitTestImpl::RunAllTests (this=0x3f6000)                                                                at C:/test/googletest/googletest/src/gtest.cc:4686                                              4686      return !failed;                                                                                              
(gdb) s
                                                                                                                 4687    }                                                                                                              
(gdb) s
                                                                                                                 testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> (                          object=object@entry=0x3f6000, method=<optimized out>,                                                                   location=location@entry=0x4a7aa8 "auxiliary test code (environments or event listeners)")                               at C:/test/googletest/googletest/src/gtest.cc:2404                                              2404    }                                                                                                               
(gdb) s
                                                                                                                 testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> (object=0x3f6000,             method=(bool (testing::internal::UnitTestImpl::*)(testing::internal::UnitTestImpl * const)) 0x41ba20 <testing::internal::UnitTestImpl::RunAllTests()>,                                                                                          location=location@entry=0x4a7aa8 "auxiliary test code (environments or event listeners)")                               at C:/test/googletest/googletest/src/gtest.cc:2460                                              2460    }                                                                                                              
(gdb) s
                                                                                                                 ~ScopedPrematureExitFile (this=0x22fe00, __in_chrg=<optimized out>)                                                         at C:/test/googletest/googletest/src/gtest.cc:3875                                              3875        if (premature_exit_filepath_ != NULL && *premature_exit_filepath_ != '\0') {                               
(gdb) s
                                                                                                                 testing::UnitTest::Run (this=<optimized out>) at C:/test/googletest/googletest/src/gtest.cc:4261    4261    }                                                                                                              
(gdb) s
                                                                                                                 main (argc=1, argv=0x3f52e0) at C:/test/googletest/googlemock/src/gmock_main.cc:54                  54      }                                                                                                               
(gdb) s
                                                                                                                 0x00000000004013b5 in __tmainCRTStartup ()                                                                              (gdb) where                                                                                                             #0  0x00000000004013b5 in __tmainCRTStartup ()                                                                          #1  

Keith Ray

unread,
Aug 14, 2017, 11:38:59 AM8/14/17
to Satya Prakash Prasad, Google C++ Testing Framework
Can you show us your test code and code under test? Also the message you get when it crashes?

--
C. Keith Ray

--

---
You received this message because you are subscribed to the Google Groups "Google C++ Testing Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to googletestframe...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages