Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TeuchosParameterList_ObjectBuilder_UnitTests segfaults with GCC 5.3.0 #831

Closed
bartlettroscoe opened this issue Nov 12, 2016 · 2 comments
Closed
Assignees
Labels
pkg: Teuchos Issues primarily dealing with the Teuchos Package type: bug The primary issue is a bug in Trilinos code or tests

Comments

@bartlettroscoe
Copy link
Member

CC: @trilinos/teuchos

Related to: #482, #449

Description:

The test TeuchosParameterList_ObjectBuilder_UnitTests segfaults with the SEMS-provided GCC 5.3.0 compiler. It produces output like:

***
*** Unit test suite ...
***


Sorting tests by group name then by the order they were added ... (time = 2.31e-05)

Running unit tests ...

0. Teuchos_ObjectBuilder_constructor_UnitTest ... [Passed] (0.000121 sec)
1. Teuchos_ObjectBuilder_setNames_UnitTest ... [Passed] (0.000287 sec)
2. Teuchos_ObjectBuilder_setObjectFactory_UnitTest ... [Passed] (0.000274 sec)
3. Teuchos_ObjectBuilder_setObjectFactory_bad_UnitTest ... [Passed] (0.000147 sec)
4. Teuchos_ObjectBuilder_getObjectName_UnitTest ... [Passed] (9.89e-05 sec)
5. Teuchos_ObjectBuilder_create_UnitTest ... [Passed] (0.000281 sec)
6. Teuchos_ObjectBuilder_setParameterList_UnitTest ... terminate called after throwing an instance of 'Teuchos::Exceptions::InvalidParameterName'
  what():  Error, the parameter {name="Hello",type="string",value="World"}
in the parameter (sub)list "ANONYMOUS"
was not found in the list of valid parameters!

The valid parameters and types are:
  {
    "Object Type" : string = Foo A
    "Foo A" : ParameterList = ...
  }


Throw number = 12


[crf450:21662] *** Process received signal ***
[crf450:21662] Signal: Aborted (6)
[crf450:21662] Signal code:  (-6)
[crf450:21662] [ 0] /lib64/libpthread.so.0() [0x3ef120f7e0]
[crf450:21662] [ 1] /lib64/libc.so.6(gsignal+0x35) [0x3ef0a325e5]
[crf450:21662] [ 2] /lib64/libc.so.6(abort+0x175) [0x3ef0a33dc5]
[crf450:21662] [ 3] /projects/sems/install/rhel6-x86_64/sems/compiler/gcc/5.3.0/base/lib64/libstdc++.so.6(_ZN9__gnu_cxx27__verbose_terminate_handlerEv+0x15d) [0x7f98d356623d]
[crf450:21662] [ 4] /projects/sems/install/rhel6-x86_64/sems/compiler/gcc/5.3.0/base/lib64/libstdc++.so.6(+0x8d106) [0x7f98d3564106]
[crf450:21662] [ 5] /projects/sems/install/rhel6-x86_64/sems/compiler/gcc/5.3.0/base/lib64/libstdc++.so.6(+0x8bd69) [0x7f98d3562d69]
[crf450:21662] [ 6] /projects/sems/install/rhel6-x86_64/sems/compiler/gcc/5.3.0/base/lib64/libstdc++.so.6(__gxx_personality_v0+0x35c) [0x7f98d35636fc]
[crf450:21662] [ 7] /projects/sems/install/rhel6-x86_64/sems/compiler/gcc/5.3.0/base/lib64/libgcc_s.so.1(+0x10140) [0x7f98d32d0140]
[crf450:21662] [ 8] /projects/sems/install/rhel6-x86_64/sems/compiler/gcc/5.3.0/base/lib64/libgcc_s.so.1(_Unwind_Resume+0x57) [0x7f98d32d07f7]
[crf450:21662] [ 9] /home/rabartl/Trilinos.base/BUILDS/CHECKIN/MPI_RELEASE_DEBUG_SHARED/packages/teuchos/parameterlist/src/libteuchosparameterlist.so.12(_ZNK7Teuchos13ParameterList18validateParametersERKS0_iNS_13EValidateUsedENS_17EValidateDefaultsE+0xd45) [0x7f98d4bea545]
[crf450:21662] [10] /home/rabartl/Trilinos.base/BUILDS/CHECKIN/MPI_RELEASE_DEBUG_SHARED/packages/teuchos/parameterlist/test/ObjectBuilder/TeuchosParameterList_ObjectBuilder_UnitTests.exe(_ZN7Teuchos13ObjectBuilderINS_3FooEED1Ev+0x5c) [0x44a93c]
[crf450:21662] [11] /home/rabartl/Trilinos.base/BUILDS/CHECKIN/MPI_RELEASE_DEBUG_SHARED/packages/teuchos/parameterlist/test/ObjectBuilder/TeuchosParameterList_ObjectBuilder_UnitTests.exe(_ZN7Teuchos11RCPNodeTmplINS_13ObjectBuilderINS_3FooEEENS_13DeallocDeleteIS3_EEE10delete_objEv+0x51) [0x44ab21]
[crf450:21662] [12] /home/rabartl/Trilinos.base/BUILDS/CHECKIN/MPI_RELEASE_DEBUG_SHARED/packages/teuchos/core/src/libteuchoscore.so.12(_ZN7Teuchos13RCPNodeHandle9unbindOneEv+0x50) [0x7f98d479ead0]
[crf450:21662] [13] /home/rabartl/Trilinos.base/BUILDS/CHECKIN/MPI_RELEASE_DEBUG_SHARED/packages/teuchos/parameterlist/test/ObjectBuilder/TeuchosParameterList_ObjectBuilder_UnitTests.exe(_ZNK7Teuchos47Teuchos_ObjectBuilder_setParameterList_UnitTest15runUnitTestImplERNS_18basic_FancyOStreamIcSt11char_traitsIcEEERb+0x446) [0x41a9c6]
[crf450:21662] [14] /home/rabartl/Trilinos.base/BUILDS/CHECKIN/MPI_RELEASE_DEBUG_SHARED/packages/teuchos/core/src/libteuchoscore.so.12(_ZNK7Teuchos12UnitTestBase11runUnitTestERNS_18basic_FancyOStreamIcSt11char_traitsIcEEE+0x24) [0x7f98d47df464]
[crf450:21662] [15] /home/rabartl/Trilinos.base/BUILDS/CHECKIN/MPI_RELEASE_DEBUG_SHARED/packages/teuchos/core/src/libteuchoscore.so.12(_ZN7Teuchos18UnitTestRepository15runUnitTestImplERKNS_12UnitTestBaseERNS_18basic_FancyOStreamIcSt11char_traitsIcEEE+0x1b) [0x7f98d47a258b]
[crf450:21662] [16] /home/rabartl/Trilinos.base/BUILDS/CHECKIN/MPI_RELEASE_DEBUG_SHARED/packages/teuchos/core/src/libteuchoscore.so.12(_ZN7Teuchos18UnitTestRepository12runUnitTestsERNS_18basic_FancyOStreamIcSt11char_traitsIcEEE+0xaff) [0x7f98d47a3e6f]
[crf450:21662] [17] /home/rabartl/Trilinos.base/BUILDS/CHECKIN/MPI_RELEASE_DEBUG_SHARED/packages/teuchos/core/src/libteuchoscore.so.12(_ZN7Teuchos18UnitTestRepository20runUnitTestsFromMainEiPPc+0xdd) [0x7f98d47a531d]
[crf450:21662] [18] /home/rabartl/Trilinos.base/BUILDS/CHECKIN/MPI_RELEASE_DEBUG_SHARED/packages/teuchos/parameterlist/test/ObjectBuilder/TeuchosParameterList_ObjectBuilder_UnitTests.exe(main+0x31) [0x44b981]
[crf450:21662] [19] /lib64/libc.so.6(__libc_start_main+0xfd) [0x3ef0a1ed1d]
[crf450:21662] [20] /home/rabartl/Trilinos.base/BUILDS/CHECKIN/MPI_RELEASE_DEBUG_SHARED/packages/teuchos/parameterlist/test/ObjectBuilder/TeuchosParameterList_ObjectBuilder_UnitTests.exe() [0x418e29]
[crf450:21662] *** End of error message ***
--------------------------------------------------------------------------
mpiexec noticed that process rank 0 with PID 21662 on node crf450.srn.sandia.gov exited on signal 6 (Aborted).
--------------------------------------------------------------------------

It appears that the problem is two unit tests:

TEUCHOS_UNIT_TEST( Teuchos_ObjectBuilder, setParameterList) { ... }
...
TEUCHOS_UNIT_TEST( Teuchos_ObjectBuilder, unsetParameterList) { ... }

depend on behavior when throwing exceptions from destructors.

Apparently this is not the first time this has been seen. These two tests were ifdefed out for GCC 4.8 compilers in the commit:

commit 653e6b188c6ed7f2da7c01b970de7a87f1d03fb9
Author: Roscoe A. Bartlett <[email protected]>
Date:   Mon Mar 23 11:48:13 2015 -0400

    Disabling a few unit tests for GCC 4.8.x not catching exceptions
    
    There are a few unit tests that test if an exception is thrown and GCC 4.8.3
    is ignoring the catch() statement and it is getting thrown clean out and
    triggering terminate().  This passes on every other compiler including GCC
    4.6.1 and GCC 4.9.0.  This has been reported by other people as well:
    
        http://markmail.org/message/wvg5ucgv7rxu3zja
    
        https://groups.google.com/forum/#!topic/googletestframework/aj0Xzp03_Ck
    
    The issue relates to a thrown happening inside of a destructor.  Generally you
    don't want to allow exceptions to leave destructors but this should only be a
    problem when a destructor is being called inside of a stack unwide for another
    exception.
    
    We likely need to add an error handling system for Teuchos to catch and report
    exceptions to be used inside of destructor bodies.

Well, apparently this is a problem for GCC 5.3 as well. It seems this may be a defect in the compiler. However, a similar defect appears to exist in some Clang compilers as well (see #449).

The GCC 5.3.0 compiler is being investigated as a way to provide a standard pre-push CI env across Linix and OSX machines using the SEMS env (see #158 and #482).

@bartlettroscoe bartlettroscoe added type: bug The primary issue is a bug in Trilinos code or tests pkg: Teuchos Issues primarily dealing with the Teuchos Package stage: in progress Work on the issue has started labels Nov 12, 2016
@bartlettroscoe
Copy link
Member Author

That above commit comment:

    We likely need to add an error handling system for Teuchos to catch and report
    exceptions to be used inside of destructor bodies.

basically says it all. We need to stop throwing from destructors and expecting things to be handle gracefully. Just because standard compilers are supposed to allow this and handle this correctly (i.e. if no exceptions are thrown from a destructor during stack unwind), does not mean that we should write tests that depend on such behavior.

In any case, for now, I am going to just ifdef out these two tests for GCC 5.3.0 so that I can make progress.

This will likely need to get fixed once and for all when we disallow exceptions to get thrown from destructors as part of #229.

bartlettroscoe added a commit to bartlettroscoe/Trilinos that referenced this issue Nov 12, 2016
…rilinos#482)

This is needed to get a full passing test suite for the Primary Tested CI
build based on GCC 4.8.2 (see trilinos#482).
bartlettroscoe added a commit to bartlettroscoe/Trilinos that referenced this issue Nov 28, 2016
…rilinos#482)

This is needed to get a full passing test suite for the Primary Tested CI
build based on GCC 4.8.2 (see trilinos#482).
@bartlettroscoe
Copy link
Member Author

This should have been resolved with the merge commit 0acaa65. Closing as complete.

@bartlettroscoe bartlettroscoe self-assigned this Dec 7, 2016
@bartlettroscoe bartlettroscoe removed the stage: in progress Work on the issue has started label Dec 7, 2016
tjfulle added a commit to tjfulle/Trilinos that referenced this issue Dec 7, 2016
… Mac OSX

Issue trilinos#907 is similar to Issue trilinos#831 and the fix is the same.  See the
discussion in trilinos#831 for more details.

Tests: standard checkin-test.sh tests run, but on a Mac, so there are
many test failures.  Tests should be run on a RHEL 6 machine with SEMS
before merging PR.
bartlettroscoe pushed a commit that referenced this issue Dec 7, 2016
Issue #907 is similar to Issue #831 and the fix is the same.  See the
discussion in #831 for more details.

Tests: standard checkin-test.sh tests run, but on a Mac, so there are
many test failures.  Tests should be run on a RHEL 6 machine with SEMS
before merging PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: Teuchos Issues primarily dealing with the Teuchos Package type: bug The primary issue is a bug in Trilinos code or tests
Projects
None yet
Development

No branches or pull requests

1 participant