Skip to content

Commit 78fc0da

Browse files
authored
Merge pull request #6 from FESOM/fix/xios-finalize-segv
xios: null-guard CXios::globalRegistry deref in CContext::finalize (attached-mode SIGSEGV)
2 parents a8ce826 + e1fb71a commit 78fc0da

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

fesom2_ci/xios/src/node/context.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ namespace xios {
494494
{
495495
closeAllFile();
496496
registryOut->hierarchicalGatherRegistry() ;
497-
if (server->intraCommRank==0) CXios::globalRegistry->mergeRegistry(*registryOut) ;
497+
if (server->intraCommRank==0 && CXios::globalRegistry) CXios::globalRegistry->mergeRegistry(*registryOut) ;
498498
}
499499

500500
//! Deallocate client buffers
@@ -534,7 +534,7 @@ namespace xios {
534534
if (hasServer && !hasClient)
535535
{
536536
registryOut->hierarchicalGatherRegistry() ;
537-
if (server->intraCommRank==0) CXios::globalRegistry->mergeRegistry(*registryOut) ;
537+
if (server->intraCommRank==0 && CXios::globalRegistry) CXios::globalRegistry->mergeRegistry(*registryOut) ;
538538
}
539539

540540
//! Deallocate client buffers

fesom2_test_refactoring/xios/src/node/context.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ namespace xios {
494494
{
495495
closeAllFile();
496496
registryOut->hierarchicalGatherRegistry() ;
497-
if (server->intraCommRank==0) CXios::globalRegistry->mergeRegistry(*registryOut) ;
497+
if (server->intraCommRank==0 && CXios::globalRegistry) CXios::globalRegistry->mergeRegistry(*registryOut) ;
498498
}
499499

500500
//! Deallocate client buffers
@@ -534,7 +534,7 @@ namespace xios {
534534
if (hasServer && !hasClient)
535535
{
536536
registryOut->hierarchicalGatherRegistry() ;
537-
if (server->intraCommRank==0) CXios::globalRegistry->mergeRegistry(*registryOut) ;
537+
if (server->intraCommRank==0 && CXios::globalRegistry) CXios::globalRegistry->mergeRegistry(*registryOut) ;
538538
}
539539

540540
//! Deallocate client buffers

0 commit comments

Comments
 (0)