openPMD / openPMD/openPMD-api

ADIOS1 Destructors Must Not Throw

Open
#550 2 comments 0 reactions 0 assignees View on GitHub
backend: ADIOS1 bug good first issue help wanted
Dominant language
C++
Stars
161
Forks
59
Avg merge
2d 22h
Merged PRs (30d)
7

Description

**Describe the bug**
[Destructors may not fail](http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rc-dtor-fail) in clean C++, which otherwise makes object destruction and associated resource occupation unreliable. Also given by [C++ core guidelines](http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rc-dtor-noexcept).

**To Reproduce**
Compile the project with clang-tidy-7 or newer with enabled ADIOS1 backend.
The warning [`bugprone-exception-escape`](https://clang.llvm.org/extra/clang-tidy/checks/bugprone-exception-escape.html) will be visible in `ParallelADIOS1IOHandlerImpl::~ParallelADIOS1IOHandlerImpl()` (`src/IO/ADIOS/ParallelADIOS1IOHandler.cpp`) and `ADIOS1IOHandlerImpl::~ADIOS1IOHandlerImpl()` (`src/IO/ADIOS/ADIOS1IOHandler.cpp`).

Example:
```bash
# in directory $HOME/src/openPMD-api
mkdir build && cd build

CXX=clang++-7 CC=clang-7 cmake -DCMAKE_CXX_CLANG_TIDY="$(which clang-tidy-7);-system-headers=0" -DCMAKE_CXX_STANDARD=17 -DopenPMD_USE_PYTHON=OFF ..
make
```

**Expected behavior**
A clear and concise description of what you expected to happen.

**Software Environment**
- version of openPMD-api: `0.9.0-alpha-18-g0bf8862`
- installed openPMD-api via: from source
- operating system: Ubuntu 18.04
- machine: local x86
- name and version of Python implementation: N/A
- version of HDF5: 1.10.5
- version of ADIOS1: 1.13.1
- name and version of MPI: MPICH 3.3.1

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.