Opened 8 years ago

Closed 8 years ago

#1880 closed defect (fixed)

limit core dumps in unittests

Reported by: jreed Owned by: muks
Priority: medium Milestone: Sprint-20120515
Component: Unclassified Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: Core Feature Depending on Ticket:
Estimated Difficulty: 4 Add Hours to Ticket: 0
Total Hours: 0.83 Internal?: no

Description

The following is the last five core dump backtraces from src/lib/log/tests/.libs/initializer_unittests_2, src/lib/log/tests/.libs/run_unittests, src/lib/server_common/tests/.libs/run_unittests, and src/lib/util/tests/.libs/run_unittests on the macmini system:

GNU gdb 6.3.50-20050815 (Apple version gdb-1461.2) (Fri Mar  5 04:43:10 UTC 2010)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".
Core was generated by `/b/work/BIND10-systest/20120404235126-MacOS/build/src/lib/util/tests/.libs/run_unittests'.
Reading symbols for shared libraries . done
Reading symbols for shared libraries ........ done
#0  0x930a3176 in __kill ()
(gdb) #0  0x930a3176 in __kill ()
#1  0x930a3168 in kill$UNIX2003 ()
#2  0x9313589d in raise ()
#3  0x9314b9bc in abort ()
#4  0x931384fc in __assert_rtn ()
#5  0x000243b4 in isc::util::OutputBuffer::operator[] ()
#6  0x0001af41 in (anonymous namespace)::BufferTest_outputBufferReadat_Test::TestBody ()
#7  0x0016b998 in testing::Test::Run ()
#8  0x0016baa8 in testing::internal::TestInfoImpl::Run ()
#9  0x0016bb46 in testing::TestCase::Run ()
#10 0x0016e0d5 in testing::internal::UnitTestImpl::RunAllTests ()
#11 0x0009c2f5 in isc::util::unittests::run_all ()
#12 0x0000863a in main ()
(gdb) 
GNU gdb 6.3.50-20050815 (Apple version gdb-1461.2) (Fri Mar  5 04:43:10 UTC 2010)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".
Core was generated by `/b/work/BIND10-systest/20120404235126-MacOS/build/src/lib/log/tests/.libs/run_unittests'.
Reading symbols for shared libraries . done
Reading symbols for shared libraries .......... done
#0  0x930a3176 in __kill ()
(gdb) #0  0x930a3176 in __kill ()
#1  0x930a3168 in kill$UNIX2003 ()
#2  0x9313589d in raise ()
#3  0x9314b9bc in abort ()
#4  0x931384fc in __assert_rtn ()
#5  0x00026073 in isc::log::Logger::Logger ()
#6  0x0001f4cd in isc::log::Logger::Logger ()
#7  0x0003b14b in LoggerTest_LoggerNameLength_Test::TestBody ()
#8  0x000f2998 in testing::Test::Run ()
#9  0x000f2aa8 in testing::internal::TestInfoImpl::Run ()
#10 0x000f2b46 in testing::TestCase::Run ()
#11 0x000f50d5 in testing::internal::UnitTestImpl::RunAllTests ()
#12 0x0005e385 in isc::util::unittests::run_all ()
#13 0x000073a0 in main ()
(gdb) 
GNU gdb 6.3.50-20050815 (Apple version gdb-1461.2) (Fri Mar  5 04:43:10 UTC 2010)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".
Core was generated by `/b/work/BIND10-systest/20120404235126-MacOS/build/src/lib/log/tests/.libs/initializer_unittests_2'.
Reading symbols for shared libraries . done
Reading symbols for shared libraries .......... done
#0  0x930a3176 in __kill ()
(gdb) #0  0x930a3176 in __kill ()
#1  0x930a3168 in kill$UNIX2003 ()
#2  0x9313589d in raise ()
#3  0x9314b9bc in abort ()
#4  0x931384fc in __assert_rtn ()
#5  0x00050b42 in isc::log::MessageInitializer::MessageInitializer ()
#6  0x00050abd in isc::log::MessageInitializer::MessageInitializer ()
#7  0x000021fd in MessageInitializerTest2_MessageLoadTest_Test::TestBody ()
#8  0x00021998 in testing::Test::Run ()
#9  0x00021aa8 in testing::internal::TestInfoImpl::Run ()
#10 0x00021b46 in testing::TestCase::Run ()
#11 0x000240d5 in testing::internal::UnitTestImpl::RunAllTests ()
#12 0x00002d75 in isc::util::unittests::run_all ()
#13 0x00001fba in main ()
(gdb) 
GNU gdb 6.3.50-20050815 (Apple version gdb-1461.2) (Fri Mar  5 04:43:10 UTC 2010)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".
Core was generated by `/b/work/BIND10-systest/20120405002424-MacOS/build/src/lib/server_common/tests/.libs/run_unittests'.
Reading symbols for shared libraries . done
Reading symbols for shared libraries ................... done
#0  0x930a3176 in __kill ()
(gdb) #0  0x930a3176 in __kill ()
#1  0x930a3168 in kill$UNIX2003 ()
#2  0x9313589d in raise ()
#3  0x9314b9bc in abort ()
#4  0x000eae2e in isc::server_common::portconfig::installListenAddresses ()
#5  0x0000cb03 in (anonymous namespace)::InstallListenAddressesDeathTest_inconsistent_Test::TestBody ()
#6  0x000b8998 in testing::Test::Run ()
#7  0x000b8aa8 in testing::internal::TestInfoImpl::Run ()
#8  0x000b8b46 in testing::TestCase::Run ()
#9  0x000bb0d5 in testing::internal::UnitTestImpl::RunAllTests ()
#10 0x0003cf45 in isc::util::unittests::run_all ()
#11 0x000047b0 in main ()
(gdb) 
GNU gdb 6.3.50-20050815 (Apple version gdb-1461.2) (Fri Mar  5 04:43:10 UTC 2010)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".
Core was generated by `/b/work/BIND10-systest/20120405002424-MacOS/build/src/lib/server_common/tests/.libs/run_unittests'.
Reading symbols for shared libraries . done
Reading symbols for shared libraries ................... done
#0  0x930a3176 in __kill ()
(gdb) #0  0x930a3176 in __kill ()
#1  0x930a3168 in kill$UNIX2003 ()
#2  0x9313589d in raise ()
#3  0x9314b9bc in abort ()
#4  0x000eae2e in isc::server_common::portconfig::installListenAddresses ()
#5  0x0000c068 in (anonymous namespace)::InstallListenAddressesDeathTest_cantClose_Test::TestBody ()
#6  0x000b8998 in testing::Test::Run ()
#7  0x000b8aa8 in testing::internal::TestInfoImpl::Run ()
#8  0x000b8b46 in testing::TestCase::Run ()
#9  0x000bb0d5 in testing::internal::UnitTestImpl::RunAllTests ()
#10 0x0003cf45 in isc::util::unittests::run_all ()
#11 0x000047b0 in main ()
(gdb) 

In jabber, muks suggested: in the abort tests we could stop generation of cores (inside the testcase).

(I had 407GB of core dumps.)

Subtickets

Change History (14)

comment:2 Changed 8 years ago by jelte

  • Milestone changed from New Tasks to Sprint-20120515

comment:3 Changed 8 years ago by muks

  • Owner set to muks
  • Status changed from new to assigned

Picking bug

comment:4 Changed 8 years ago by muks

  • Owner changed from muks to UnAssigned
  • Status changed from assigned to reviewing

Up for review.

comment:5 Changed 8 years ago by vorner

  • Owner changed from UnAssigned to vorner

comment:6 follow-up: Changed 8 years ago by vorner

  • Owner changed from vorner to muks

Hello

While I agree this should help, it looks like a repeated code. Would it be possible to put into some helper function (probably in src/lib/testutils) and use in the death tests?

Thank you

comment:7 in reply to: ↑ 6 Changed 8 years ago by muks

  • Owner changed from muks to vorner

Hi vorner

Replying to vorner:

Hello

While I agree this should help, it looks like a repeated code. Would it be possible to put into some helper function (probably in src/lib/testutils) and use in the death tests?

Good idea. Done. :)

comment:8 follow-up: Changed 8 years ago by vorner

  • Owner changed from vorner to muks

Hello

There's an indentation problem (tabs used) in the cantClose test in src/lib/server_common/tests/portconfig_unittest.cc.

Also, there's another problem. The testutils library is now compiled after some of the libraries that use it. I wasn't able to reorder the libraries in a way it would work, there seems to be a circular dependency (well, not really, the testutils is needed by tests/ subdirectories, not the real libraries, but automake doesn't track inter-module dependencies :-(). Maybe, would it be possible to make the no-core function a header-only one?

Thank you

comment:9 in reply to: ↑ 8 Changed 8 years ago by muks

Hi vorner

Replying to vorner:

There's an indentation problem (tabs used) in the cantClose test in src/lib/server_common/tests/portconfig_unittest.cc.

Fixed. :)

Also, there's another problem. The testutils library is now compiled after some of the libraries that use it. I wasn't able to reorder the libraries in a way it would work, there seems to be a circular dependency (well, not really, the testutils is needed by tests/ subdirectories, not the real libraries, but automake doesn't track inter-module dependencies :-(). Maybe, would it be possible to make the no-core function a header-only one?

Oh yes. Nice catch.. testutils->asiolink->log->testutils. This worked for me as the deps were already built and I didn't try a clean make. I guess the header-only function is what we should do.. the other option is to have a libtestutils2 which won't look so good. :)

I've updated the code to go into the header.

comment:10 Changed 8 years ago by muks

  • Owner changed from muks to vorner

comment:11 follow-up: Changed 8 years ago by muks

Check if #1892 is merged before this one, as that contains abort tests.

comment:12 in reply to: ↑ 11 Changed 8 years ago by muks

Replying to muks:

Check if #1892 is merged before this one, as that contains abort tests.

I'll do this before merging into master as I'll have to rebase that branch. It involves adding just a couple of isc::testutils::dontCreateCoreDumps(); calls to the new EXPECT_ABORT tests.

comment:13 Changed 8 years ago by vorner

  • Owner changed from vorner to muks
  • Total Hours changed from 0 to 0.83

I fixed a small style issue (we don't use static for functions, but anonymous namespace, which should have the same effect), please pull.

Otherwise, it looks OK to merge.

comment:14 Changed 8 years ago by muks

  • Resolution set to fixed
  • Status changed from reviewing to closed

Pushed to master:

* 2554565 [1880] Style fix
* 4918967 [1880] Move dontCreateCoreDumps() definition to the header due to dependency issues
* 8b0e391 [1880] Untabify file
* 408043d [1880] Use a helper function instead of repeating code
* d7191f1 [1880] Don't create core files when EXPECT_DEATH is used

Resolving as fixed. Thank you for the review vorner.

Note: See TracTickets for help on using tickets.