diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolAuxContainerCnv.icc b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolAuxContainerCnv.icc index 71a685760f5b141c32ed9ef4c7d083ec427a0b51..b42868087bdec42c19ce0e919b55aedc3e1c725d 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolAuxContainerCnv.icc +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolAuxContainerCnv.icc @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /** * @file AthenaPoolCnvSvc/T_AthenaPoolAuxContainerCnv.icc @@ -9,6 +9,7 @@ */ +#include "AthenaPoolCnvSvc/exceptions.h" #include "AthContainers/tools/copyThinned.h" #include "AthenaKernel/getThinningCache.h" @@ -46,8 +47,13 @@ T_AthenaPoolAuxContainerCnv<AUXSTORE, TPCNVS...>::createPersistentWithKey( AUXST try { const SG::ThinningInfo* info = SG::getThinningInfo (key2); return SG::copyThinned (*trans, info).release(); - }catch( const std::exception &ex ) { - throw std::runtime_error( std::string("Exception from AuxContainer Thinning of type: ") + typeid(ex).name() + ", msg: " + ex.what()); + } + catch( const std::exception &ex ) { + AthenaPoolCnvSvc::throwExcCaughtException (__PRETTY_FUNCTION__, + "thinning aux container", + ex, + typeid(AUXSTORE), + key); } } diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCnvBase.icc b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCnvBase.icc index 5b3708838674f71d97d998f2e71728ca51b50f74..d1c6f94e839db69cc472c9a725603840665b451a 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCnvBase.icc +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCnvBase.icc @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /** @file T_AthenaPoolCnvBase.icc @@ -22,6 +22,7 @@ #include "AthenaKernel/CLASS_DEF.h" #include "AthenaKernel/ClassName.h" #include "AthenaKernel/StorableConversions.h" +#include "AthenaPoolCnvSvc/exceptions.h" //__________________________________________________________________________ template <class T> @@ -85,16 +86,19 @@ StatusCode T_AthenaPoolCnvBase<T>::DataObjectToPool(IOpaqueAddress* pAddr, DataO template <class T> StatusCode T_AthenaPoolCnvBase<T>::PoolToDataObject(DataObject*& pObj, const Token* token, - const std::string& /*key*/) + const std::string& key) { const std::string className = ClassName<T>::name(); void* voidPtr = nullptr; try { m_athenaPoolCnvSvc->setObjPtr(voidPtr, token); - } catch (std::exception &e) { - std::string error = e.what(); - ATH_MSG_ERROR("poolToObject: caught error: " << error); - return(StatusCode::FAILURE); + } + catch (const std::exception& ex) { + AthenaPoolCnvSvc::throwExcCaughtException (__PRETTY_FUNCTION__, + "converting to DataObject", + ex, + typeid(T), + key); } T* obj = reinterpret_cast<T*>(voidPtr); pObj = SG::asStorable(obj); diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCoolMultChanCnv.icc b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCoolMultChanCnv.icc index f2b83c45b1e3fd42bfa05bc19f67040c0087a7f3..94bce3ad0dd692f0d0f2f81f5c5da87d13efa6b2 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCoolMultChanCnv.icc +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCoolMultChanCnv.icc @@ -278,7 +278,7 @@ T_AthenaPoolCoolMultChanCnv<COLL_T, ELEM_T, ELEM_P>::attrListCollToObject(CondAt token=attrList["PoolRef"].data<std::string>(); } // FIXME exception - catch(std::exception& x) { + catch(const std::exception& x) { ATH_MSG_ERROR("PoolRef not found in attribute list"); return(StatusCode::FAILURE); } diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCustCnv.icc b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCustCnv.icc index 986176a84ed8f48775084efa8d700a835f0fcc3f..e45b2e3a04c697efe7af31aa082f3f2bcf588a77 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCustCnv.icc +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCustCnv.icc @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /** @file T_AthenaPoolCustCnv.icc @@ -8,6 +8,7 @@ **/ #include "AthenaPoolCnvSvc/IAthenaPoolCnvSvc.h" +#include "AthenaPoolCnvSvc/exceptions.h" #include "GaudiKernel/StatusCode.h" #include "GaudiKernel/DataObject.h" @@ -81,9 +82,13 @@ StatusCode T_AthenaPoolCustCnv<TRANS, PERS>::poolToObject(const Token*& token, P void* voidPtr = nullptr; try { this->m_athenaPoolCnvSvc->setObjPtr(voidPtr, token); - } catch (std::exception &e) { - ATH_MSG_ERROR("poolToObject: caught error: " << e.what()); - return(StatusCode::FAILURE); + } + catch (const std::exception& ex) { + AthenaPoolCnvSvc::throwExcCaughtException (__PRETTY_FUNCTION__, + "pooltoObject", + ex, + typeid(P), + token->toString()); } if (voidPtr == nullptr) { ATH_MSG_ERROR("poolToObject: Could not get object for Token = " << (token != nullptr ? token->toString() : "")); diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.icc b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.icc index c8efe8a5ff8650fd0aef70f21ca971d989cd82af..aec92f536b0bb3eeaa62f64241599990706fc4d6 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.icc +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.icc @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ /** @file T_AthenaPoolCustomCnv.icc @@ -16,6 +16,7 @@ #include "AthenaKernel/StorableConversions.h" +#include "AthenaPoolCnvSvc/exceptions.h" #include "AthenaPoolCnvTPExtension.h" #include <sstream> @@ -44,9 +45,13 @@ StatusCode T_AthenaPoolCustomCnvWithKey<TRANS, PERS>::DataObjectToPool(IOpaqueAd } try { persObj = createPersistentWithKey(obj, pObj->name()); - } catch (std::exception &e) { - ATH_MSG_ERROR("Failed to create persistent object: " << e.what()); - return(StatusCode::FAILURE); + } + catch (const std::exception& ex) { + AthenaPoolCnvSvc::throwExcCaughtException (__PRETTY_FUNCTION__, + "creating persistent object", + ex, + typeid(TRANS), + pObj->name()); } Token* token = nullptr; StatusCode status = this->objectToPool(persObj, token, pObj->name(), *pAddr->par()); @@ -92,13 +97,13 @@ T_AthenaPoolCustomCnvWithKey<TRANS, PERS>::PoolToDataObject(DataObject*& pObj, } try { transObj = createTransientWithKey(key); - } catch(std::exception &e) { - ATH_MSG_ERROR("Failed to convert persistent object to transient: " << e.what()); - // cleanup - if (extCnv != nullptr) { - extCnv->deletePersistentObjects(); - } - return(StatusCode::FAILURE); + } + catch(const std::exception& ex) { + AthenaPoolCnvSvc::throwExcCaughtException (__PRETTY_FUNCTION__, + "creating transient object", + ex, + typeid(TRANS), + key); } if (extCnv != nullptr) { extCnv->deletePersistentObjects(); diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/exceptions.h b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/exceptions.h index 18a6db845d1446de972420b6c290d2b216d72109..9f2ba9a1f06bff62da1b28e22cceeea83cdbe26a 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/exceptions.h +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/exceptions.h @@ -1,10 +1,9 @@ // This file's extension implies that it's C, but it's really -*- C++ -*-. /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ -// $Id$ /** * @file AthenaPoolCnvSvc/exceptions.h * @author scott snyder <snyder@bnl.gov> @@ -73,11 +72,54 @@ public: * @brief Throw a AthenaPoolCnvSvc::ExcUnsupportedVersion exception. * @param ti The class being read. * @param guid The GUID of the persistent class. -o */ + */ [[noreturn]] void throwExcUnsupportedVersion (const std::type_info& ti, const Guid& guid); +/** + * @brief Exception --- Caught an exception during conversion. + * + * Encountered an exception during conversion. + */ +class ExcCaughtException + : public std::runtime_error +{ +public: + /** + * @brief Constructor. + * @param fnname Name of the function being executed. + * @param action What we were doing when we caught the exception. + * @param ex The caught exception. + * @param ti The class being thinned. + * @param key Key of the class being thinned. + */ + ExcCaughtException (const char* fnname, + const char* action, + const std::exception& ex, + const std::type_info& ti, + const std::string& key); +}; + + +/** + * @brief Throw a AthenaPoolCnvSvc::ExcCaughtException exception. + * @param fnname Name of the function being executed. + * @param action What we were doing when we caught the exception. + * @param ex The caught exception. + * @param ti The class being thinned. + * @param key Key of the class being thinned. + * + * Will also print a stack trace if exctrace is enabled. + */ +[[noreturn]] +void throwExcCaughtException (const char* fnname, + const char* action, + const std::exception& ex, + const std::type_info& ti, + const std::string& key); + + } // namespace AthenaPoolCnvSvc diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/CMakeLists.txt b/Database/AthenaPOOL/AthenaPoolCnvSvc/CMakeLists.txt index b51f4c7ce566738b0eca70aff47a7206e6452fc3..01343f1028df23ed46c4563a5760c3f4cf02ed36 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/CMakeLists.txt +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( AthenaPoolCnvSvc ) @@ -49,22 +49,26 @@ atlas_add_test( T_AthenaPoolCreateFuncs_test atlas_add_test( T_AthenaPoolViewVectorCnv_test SOURCES test/T_AthenaPoolViewVectorCnv_test.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib TestTools ) + LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib TestTools + LOG_IGNORE_PATTERN "basic_string" ) atlas_add_test( T_AthenaPoolxAODCnv_test SOURCES test/T_AthenaPoolxAODCnv_test.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib TestTools ) + LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib TestTools + LOG_IGNORE_PATTERN "basic_string" ) atlas_add_test( T_AthenaPoolAuxContainerCnv_test SOURCES test/T_AthenaPoolAuxContainerCnv_test.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib TestTools ) + LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib TestTools + LOG_IGNORE_PATTERN "basic_string" ) atlas_add_test( T_AthenaPoolTPCnvCnv_test SOURCES test/T_AthenaPoolTPCnvCnv_test.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib TestTools ) + LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib TestTools + LOG_IGNORE_PATTERN "basic_string" ) atlas_add_test( T_AuxContainerCopyTPCnv_test SOURCES test/T_AuxContainerCopyTPCnv_test.cxx diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/share/T_AthenaPoolAuxContainerCnv_test.ref b/Database/AthenaPOOL/AthenaPoolCnvSvc/share/T_AthenaPoolAuxContainerCnv_test.ref index 3185ff4fc675710846a1a8a6d630df40762f1fa0..9bdf547c275af746a1f10fe0c00dc24053e39655 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/share/T_AthenaPoolAuxContainerCnv_test.ref +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/share/T_AthenaPoolAuxContainerCnv_test.ref @@ -1,20 +1,19 @@ -Initializing Gaudi ApplicationMgr using job opts ../share/test.txt -JobOptionsSvc INFO Job options successfully read in from ../share/test.txt +Initializing Gaudi ApplicationMgr using job opts /home/sss/atlas/dvtest/build/joboptions/AthenaPoolCnvSvc/test.txt +JobOptionsSvc INFO Job options successfully read in from /home/sss/atlas/dvtest/build/joboptions/AthenaPoolCnvSvc/test.txt ApplicationMgr SUCCESS ==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v999r999) - running on karma on Thu Jan 21 14:08:47 2016 + Welcome to ApplicationMgr (GaudiCoreSvc v27r1p99) + running on karma on Thu Mar 25 17:20:07 2021 ==================================================================================================================================== ApplicationMgr INFO Application Manager Configured successfully EventLoopMgr WARNING Unable to locate service "EventSelector" EventLoopMgr WARNING No events will be processed from external input. -HistogramPersis...WARNING Histograms saving not required. ApplicationMgr INFO Application Manager Initialized successfully ApplicationMgr Ready test1 test2 -AthenaPoolConve... ERROR Failed to convert persistent object to transient: AthenaPoolCnvSvc::::ExcUnsupported version: Unsupported persistent version of AthenaPoolCnvSvcTest::YAuxCont_v2 found; guid: 8ACD1C53-D3C7-4FE5-9BC0-E388701DB8FA -AthenaPoolConve... ERROR createObj PoolToDataObject() failed, Token = [DB=00000000-0000-0000-0000-000000000000][CNT=][CLID=8ACD1C53-D3C7-4FE5-9BC0-E388701DB8FA][TECH=00000000][OID=FFFFFFFFFFFFFFFF-FFFFFFFFFFFFFFFF] +Exception: AthenaPoolCnvSvc::::ExcUnsupportedVersion: Unsupported persistent version of AthenaPoolCnvSvcTest::YAuxCont_v2 found; guid: 8ACD1C53-D3C7-4FE5-9BC0-E388701DB8FA (no backtrace available). +AthenaPoolConve... ERROR createObj - caught exception: AthenaPoolCnvSvc::::ExcCaughtException: Caught exception in StatusCode T_AthenaPoolCustomCnvWithKey<TRANS, PERS>::PoolToDataObject(DataObject*&, const Token*, const string&) [with TRANS = AthenaPoolCnvSvcTest::YAuxCont_v2; PERS = AthenaPoolCnvSvcTest::YAuxCont_v2; std::string = std::__cxx11::basic_string<char>] while creating transient objectAthenaPoolCnvSvcTest::YAuxCont_v2/: AthenaPoolCnvSvc::ExcUnsupportedVersion: AthenaPoolCnvSvc::::ExcUnsupportedVersion: Unsupported persistent version of AthenaPoolCnvSvcTest::YAuxCont_v2 found; guid: 8ACD1C53-D3C7-4FE5-9BC0-E388701DB8FA AthenaPoolConve... ERROR createObj failed to get DataObject, Token = [DB=00000000-0000-0000-0000-000000000000][CNT=][CLID=8ACD1C53-D3C7-4FE5-9BC0-E388701DB8FA][TECH=00000000][OID=FFFFFFFFFFFFFFFF-FFFFFFFFFFFFFFFF] diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/share/T_AthenaPoolTPCnvCnv_test.ref b/Database/AthenaPOOL/AthenaPoolCnvSvc/share/T_AthenaPoolTPCnvCnv_test.ref index cabfcb0f73c7e1a5ea11db916dc3a57ec5d35c2a..82602e4c549dcc678321cbb34a8e099fa6c56003 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/share/T_AthenaPoolTPCnvCnv_test.ref +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/share/T_AthenaPoolTPCnvCnv_test.ref @@ -1,20 +1,19 @@ -Initializing Gaudi ApplicationMgr using job opts ../share/test.txt -JobOptionsSvc INFO Job options successfully read in from ../share/test.txt +Initializing Gaudi ApplicationMgr using job opts /home/sss/atlas/dvtest/build/joboptions/AthenaPoolCnvSvc/test.txt +JobOptionsSvc INFO Job options successfully read in from /home/sss/atlas/dvtest/build/joboptions/AthenaPoolCnvSvc/test.txt ApplicationMgr SUCCESS ==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v999r999) - running on karma on Fri Jan 22 14:26:54 2016 + Welcome to ApplicationMgr (GaudiCoreSvc v27r1p99) + running on karma on Thu Mar 25 17:19:52 2021 ==================================================================================================================================== ApplicationMgr INFO Application Manager Configured successfully EventLoopMgr WARNING Unable to locate service "EventSelector" EventLoopMgr WARNING No events will be processed from external input. -HistogramPersis...WARNING Histograms saving not required. ApplicationMgr INFO Application Manager Initialized successfully ApplicationMgr Ready test1 test2 -AthenaPoolConve... ERROR Failed to convert persistent object to transient: AthenaPoolCnvSvc::::ExcUnsupported version: Unsupported persistent version of DataVector<AthenaPoolCnvSvcTest::X,DataModel_detail::NoBase> found; guid: 8ACD1C53-D3C7-4FE5-9BC0-E388701DB8FA -AthenaPoolConve... ERROR createObj PoolToDataObject() failed, Token = [DB=00000000-0000-0000-0000-000000000000][CNT=][CLID=8ACD1C53-D3C7-4FE5-9BC0-E388701DB8FA][TECH=00000000][OID=FFFFFFFFFFFFFFFF-FFFFFFFFFFFFFFFF] +Exception: AthenaPoolCnvSvc::::ExcUnsupportedVersion: Unsupported persistent version of DataVector<AthenaPoolCnvSvcTest::X,DataModel_detail::NoBase> found; guid: 8ACD1C53-D3C7-4FE5-9BC0-E388701DB8FA (no backtrace available). +AthenaPoolConve... ERROR createObj - caught exception: AthenaPoolCnvSvc::::ExcCaughtException: Caught exception in StatusCode T_AthenaPoolCustomCnvWithKey<TRANS, PERS>::PoolToDataObject(DataObject*&, const Token*, const string&) [with TRANS = DataVector<AthenaPoolCnvSvcTest::X>; PERS = AthenaPoolCnvSvcTest::XCont_p2; std::string = std::__cxx11::basic_string<char>] while creating transient objectDataVector<AthenaPoolCnvSvcTest::X,DataModel_detail::NoBase>/: AthenaPoolCnvSvc::ExcUnsupportedVersion: AthenaPoolCnvSvc::::ExcUnsupportedVersion: Unsupported persistent version of DataVector<AthenaPoolCnvSvcTest::X,DataModel_detail::NoBase> found; guid: 8ACD1C53-D3C7-4FE5-9BC0-E388701DB8FA AthenaPoolConve... ERROR createObj failed to get DataObject, Token = [DB=00000000-0000-0000-0000-000000000000][CNT=][CLID=8ACD1C53-D3C7-4FE5-9BC0-E388701DB8FA][TECH=00000000][OID=FFFFFFFFFFFFFFFF-FFFFFFFFFFFFFFFF] diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/share/T_AthenaPoolViewVectorCnv_test.ref b/Database/AthenaPOOL/AthenaPoolCnvSvc/share/T_AthenaPoolViewVectorCnv_test.ref index 70549329e491fc995d67031df8ffbca38ce8c6a4..91b403b1afc34b16629eafc30ebace864e6d33e1 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/share/T_AthenaPoolViewVectorCnv_test.ref +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/share/T_AthenaPoolViewVectorCnv_test.ref @@ -1,20 +1,19 @@ -Initializing Gaudi ApplicationMgr using job opts ../share/test.txt -JobOptionsSvc INFO Job options successfully read in from ../share/test.txt +Initializing Gaudi ApplicationMgr using job opts /home/sss/atlas/dvtest/build/joboptions/AthenaPoolCnvSvc/test.txt +JobOptionsSvc INFO Job options successfully read in from /home/sss/atlas/dvtest/build/joboptions/AthenaPoolCnvSvc/test.txt ApplicationMgr SUCCESS ==================================================================================================================================== Welcome to ApplicationMgr (GaudiCoreSvc v27r1p99) - running on karma on Mon Oct 10 19:17:16 2016 + running on karma on Thu Mar 25 17:22:26 2021 ==================================================================================================================================== ApplicationMgr INFO Application Manager Configured successfully EventLoopMgr WARNING Unable to locate service "EventSelector" EventLoopMgr WARNING No events will be processed from external input. -HistogramPersis...WARNING Histograms saving not required. ApplicationMgr INFO Application Manager Initialized successfully ApplicationMgr Ready test1 -AthenaPoolConve... ERROR Failed to convert persistent object to transient: AthenaPoolCnvSvc::::ExcUnsupported version: Unsupported persistent version of ViewVector<DataVector<AthenaPoolCnvSvcTest::Y_v2,DataModel_detail::NoBase> > found; guid: 79E2478D-C17F-45E9-848D-278240C2FED3 -AthenaPoolConve... ERROR createObj PoolToDataObject() failed, Token = [DB=00000000-0000-0000-0000-000000000000][CNT=][CLID=79E2478D-C17F-45E9-848D-278240C2FED3][TECH=00000000][OID=FFFFFFFFFFFFFFFF-FFFFFFFFFFFFFFFF] +Exception: AthenaPoolCnvSvc::::ExcUnsupportedVersion: Unsupported persistent version of ViewVector<DataVector<AthenaPoolCnvSvcTest::Y_v2,DataModel_detail::NoBase> > found; guid: 79E2478D-C17F-45E9-848D-278240C2FED3 (no backtrace available). +AthenaPoolConve... ERROR createObj - caught exception: AthenaPoolCnvSvc::::ExcCaughtException: Caught exception in StatusCode T_AthenaPoolCustomCnvWithKey<TRANS, PERS>::PoolToDataObject(DataObject*&, const Token*, const string&) [with TRANS = ViewVector<DataVector<AthenaPoolCnvSvcTest::Y_v2> >; PERS = ViewVector<DataVector<AthenaPoolCnvSvcTest::Y_v2> >; std::string = std::__cxx11::basic_string<char>] while creating transient objectViewVector<DataVector<AthenaPoolCnvSvcTest::Y_v2,DataModel_detail::NoBase> >/: AthenaPoolCnvSvc::ExcUnsupportedVersion: AthenaPoolCnvSvc::::ExcUnsupportedVersion: Unsupported persistent version of ViewVector<DataVector<AthenaPoolCnvSvcTest::Y_v2,DataModel_detail::NoBase> > found; guid: 79E2478D-C17F-45E9-848D-278240C2FED3 AthenaPoolConve... ERROR createObj failed to get DataObject, Token = [DB=00000000-0000-0000-0000-000000000000][CNT=][CLID=79E2478D-C17F-45E9-848D-278240C2FED3][TECH=00000000][OID=FFFFFFFFFFFFFFFF-FFFFFFFFFFFFFFFF] test2 diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/share/T_AthenaPoolxAODCnv_test.ref b/Database/AthenaPOOL/AthenaPoolCnvSvc/share/T_AthenaPoolxAODCnv_test.ref index 0d634f54b84335ee0850ea14473dc295edebf21a..c6d7f7e80520c22e50a8553ea231b09d7fd082c8 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/share/T_AthenaPoolxAODCnv_test.ref +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/share/T_AthenaPoolxAODCnv_test.ref @@ -1,20 +1,19 @@ -Initializing Gaudi ApplicationMgr using job opts ../share/test.txt -JobOptionsSvc INFO Job options successfully read in from ../share/test.txt +Initializing Gaudi ApplicationMgr using job opts /home/sss/atlas/dvtest/build/joboptions/AthenaPoolCnvSvc/test.txt +JobOptionsSvc INFO Job options successfully read in from /home/sss/atlas/dvtest/build/joboptions/AthenaPoolCnvSvc/test.txt ApplicationMgr SUCCESS ==================================================================================================================================== Welcome to ApplicationMgr (GaudiCoreSvc v27r1p99) - running on karma on Wed Oct 16 11:26:09 2019 + running on karma on Thu Mar 25 17:21:54 2021 ==================================================================================================================================== ApplicationMgr INFO Application Manager Configured successfully EventLoopMgr WARNING Unable to locate service "EventSelector" EventLoopMgr WARNING No events will be processed from external input. -HistogramPersis...WARNING Histograms saving not required. ApplicationMgr INFO Application Manager Initialized successfully ApplicationMgr Ready test1 -AthenaPoolConve... ERROR Failed to convert persistent object to transient: AthenaPoolCnvSvc::::ExcUnsupported version: Unsupported persistent version of DataVector<AthenaPoolCnvSvcTest::Y_v2,DataModel_detail::NoBase> found; guid: 8ACD1C53-D3C7-4FE5-9BC0-E388701DB8FA -AthenaPoolConve... ERROR createObj PoolToDataObject() failed, Token = [DB=00000000-0000-0000-0000-000000000000][CNT=][CLID=8ACD1C53-D3C7-4FE5-9BC0-E388701DB8FA][TECH=00000000][OID=FFFFFFFFFFFFFFFF-FFFFFFFFFFFFFFFF] +Exception: AthenaPoolCnvSvc::::ExcUnsupportedVersion: Unsupported persistent version of DataVector<AthenaPoolCnvSvcTest::Y_v2,DataModel_detail::NoBase> found; guid: 8ACD1C53-D3C7-4FE5-9BC0-E388701DB8FA (no backtrace available). +AthenaPoolConve... ERROR createObj - caught exception: AthenaPoolCnvSvc::::ExcCaughtException: Caught exception in StatusCode T_AthenaPoolCustomCnvWithKey<TRANS, PERS>::PoolToDataObject(DataObject*&, const Token*, const string&) [with TRANS = DataVector<AthenaPoolCnvSvcTest::Y_v2>; PERS = DataVector<AthenaPoolCnvSvcTest::Y_v2>; std::string = std::__cxx11::basic_string<char>] while creating transient objectDataVector<AthenaPoolCnvSvcTest::Y_v2,DataModel_detail::NoBase>/key: AthenaPoolCnvSvc::ExcUnsupportedVersion: AthenaPoolCnvSvc::::ExcUnsupportedVersion: Unsupported persistent version of DataVector<AthenaPoolCnvSvcTest::Y_v2,DataModel_detail::NoBase> found; guid: 8ACD1C53-D3C7-4FE5-9BC0-E388701DB8FA AthenaPoolConve... ERROR createObj failed to get DataObject, Token = [DB=00000000-0000-0000-0000-000000000000][CNT=][CLID=8ACD1C53-D3C7-4FE5-9BC0-E388701DB8FA][TECH=00000000][OID=FFFFFFFFFFFFFFFF-FFFFFFFFFFFFFFFF] test2 diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/share/exceptions_test.ref b/Database/AthenaPOOL/AthenaPoolCnvSvc/share/exceptions_test.ref index 8809968d6245e8b2dcc9f58caf74ab4b8a5687bb..7f37946eeb0444e3ff85644e1f3fbd5e40e9860e 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/share/exceptions_test.ref +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/share/exceptions_test.ref @@ -1,3 +1,4 @@ test1 AthenaPoolCnvSvc::::ExcNoDictForClass: Can't find dictionary information for class: int -AthenaPoolCnvSvc::::ExcUnsupported version: Unsupported persistent version of int found; guid: 336F636C-D414-4261-8286-37429F353F0A +AthenaPoolCnvSvc::::ExcUnsupportedVersion: Unsupported persistent version of int found; guid: 336F636C-D414-4261-8286-37429F353F0A +AthenaPoolCnvSvc::::ExcCaughtException: Caught exception in fnname while chasing my tailint/key: std::runtime_error: foofoo diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/exceptions.cxx b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/exceptions.cxx index 7a46d4896963d54ad5a89f11dc11e3f13598ff20..f85780d0c8a25bf5de18b01192a08a15845c3653 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/exceptions.cxx +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/exceptions.cxx @@ -1,8 +1,7 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ -// $Id$ /** * @file AthenaPoolCnvSvc/src/exceptions.cxx * @author scott snyder <snyder@bnl.gov> @@ -12,6 +11,7 @@ #include "AthenaPoolCnvSvc/exceptions.h" +#include "CxxUtils/exctrace.h" #include "GaudiKernel/System.h" #include <sstream> @@ -58,7 +58,7 @@ std::string excUnsupportedVersion_format (const std::type_info& ti, const Guid& guid) { std::ostringstream os; - os << "AthenaPoolCnvSvc::::ExcUnsupported version: " + os << "AthenaPoolCnvSvc::::ExcUnsupportedVersion: " << "Unsupported persistent version of " << System::typeinfoName(ti) << " found; guid: " << guid.toString(); @@ -89,4 +89,65 @@ void throwExcUnsupportedVersion (const std::type_info& ti, const Guid& guid) } +//************************************************************************* + + +/// Helper: format exception error string. +std::string excCaughtException_format (const char* fnname, + const char* action, + const std::exception& ex, + const std::type_info& ti, + const std::string& key) +{ + std::ostringstream os; + os << "AthenaPoolCnvSvc::::ExcCaughtException: " + << "Caught exception in " << fnname + << " while " << action + << System::typeinfoName(ti) << "/" << key + << ": " << System::typeinfoName(typeid(ex)) << ": " << ex.what(); + return os.str(); +} + + +/** + * @brief Constructor. + * @param fnname Name of the function being executed. + * @param action What we were doing when we caught the exception. + * @param ex The caught exception. + * @param ti The class being thinned. + * @param key Key of the class being thinned. + */ +ExcCaughtException::ExcCaughtException (const char* fnname, + const char* action, + const std::exception& ex, + const std::type_info& ti, + const std::string& key) + : std::runtime_error (excCaughtException_format (fnname, action, ex, ti, key)) +{ +} + + +/** + * @brief Throw a AthenaPoolCnvSvc::ExcCaughtException exception. + * @param fnname Name of the function being executed. + * @param action What we were doing when we caught the exception. + * @param ex The caught exception. + * @param ti The class being thinned. + * @param key Key of the class being thinned. + * + * Will also print a stack trace if exctrace is enabled. + */ +void throwExcCaughtException (const char* fnname, + const char* action, + const std::exception& ex, + const std::type_info& ti, + const std::string& key) +{ + std::cout.flush(); + std::cerr.flush(); + CxxUtils::exctrace (ex); + throw ExcCaughtException (fnname, action, ex, ti, key); +} + + } // namespace AthenaPoolCnvSvc diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/test/exceptions_test.cxx b/Database/AthenaPOOL/AthenaPoolCnvSvc/test/exceptions_test.cxx index c72d18fa9ce71295725109a334c3354f9e60144b..fc5fc2c4ea4fee57fe4b7b9d21edb5ce7bdc2e03 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/test/exceptions_test.cxx +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/test/exceptions_test.cxx @@ -1,8 +1,7 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ -// $Id$ /** * @file AthenaPoolCnvSvc/test/exceptions_test.cxx * @author scott snyder <snyder@bnl.gov> @@ -25,6 +24,12 @@ void test1() std::cout << AthenaPoolCnvSvc::ExcUnsupportedVersion ( typeid(int), Guid("336F636C-D414-4261-8286-37429F353F0A") ).what() << "\n"; + std::cout << AthenaPoolCnvSvc::ExcCaughtException + ( "fnname", + "chasing my tail", + std::runtime_error ("foofoo"), + typeid(int), + "key").what() << "\n"; }