Access on moved object in MultiDomainNewtonConvergenceWriter
Bug report
What happened / Problem description:
I tried to use the MultiDomainNewtonConvergenceWriter
but encountered a segmentation fault due to a null ptr exception.
What you expected to happen: I expected the compiled program to run without a segmentation fault.
How to reproduce it (as minimally and precisely as possible):
Instantiate the MultiDomainNewtonConvergenceWriter
for a multi-domain problem and attach the writer to the NewtonSolver
, see #1365 (closed).
Compile and run the program, calling the solve
method of the NewtonSolver.
Anything else we need to know?: The bug is caused by the following line: https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/blob/7e8c2744b2b69db3357390970748c8cd92dc6b21/dumux/multidomain/newtonconvergencewriter.hh#L68
It can be solved by
- a quick fix: changing
gridGeometryTuple
togridGeometryTuple_
in L68 - a change of the member variable
GridGeometryTuple gridGeometryTuple_;
ofMultiDomainNewtonConvergenceWriter
to a const ref (or shared_ptr) just like inNewtonConvergenceWriter
. This would mean also removing thestd::move(...)
in the initializer list to not destroy the original object.
Environment
- Dune version: 2.9
- DuMux version: 3.8 (master)
- Others: