precice / openfoam-adapter

OpenFOAM-preCICE adapter
https://precice.org/adapter-openfoam-overview.html
GNU General Public License v3.0
135 stars 80 forks source link

Bus error in adapter destruction #133

Closed davidscn closed 4 years ago

davidscn commented 4 years ago

Currently working with the Stress data field and OpenFOAM 7, I face the following error, when the simulation has finished:

---[preciceAdapter] [DEBUG] Destroying the preCICE solver interface...
---[preciceAdapter] [DEBUG] Deleting the interfaces...

Bus error (core dumped)

This error was reported by @Eder-K in the recent system tests and I can reproduce it locally.

I still need to investigate, if other data fields are affected as well, I guess there is something wrong in the destructors.

uekerman commented 4 years ago

Which preCICE version do you use? We recently changed quite a bit there in the destructor. The first logging setting here could help to find out whether preCICE or the adaper is the problem.

davidscn commented 4 years ago

I'm working with the latest debian packages. Using a verbose logging doesn't give any additional information. Since the systemtest prints a stacktrace, which points (at first readable) to the data field in the adapter (Stress) my best guess would be, that the issue is in the adapter.

I inherited the Force calculation in my Stress data field, since they are related. This might be the problem here in case it is not a more general problem in the adapter.

MakisH commented 4 years ago

The stack trace indeed indicates a problem in the adapter:

openfoam-adapter    | ---[preciceAdapter] [DEBUG] Finalizing the preCICE solver interface...
openfoam-adapter    | ---[preciceAdapter] [DEBUG] Destroying the preCICE solver interface...
openfoam-adapter    | ---[preciceAdapter] [DEBUG] Deleting the interfaces...
openfoam-adapter    | #0  Foam::error::printStack(Foam::Ostream&) at ??:?
openfoam-adapter    | #1  Foam::sigSegv::sigHandler(int) at ??:?
openfoam-adapter    | #2  ? in "/lib/x86_64-linux-gnu/libc.so.6"
openfoam-adapter    | #3  preciceAdapter::FSI::Force::~Force() at ??:?
openfoam-adapter    | #4  preciceAdapter::FSI::Stress::~Stress() at ??:?
openfoam-adapter    | #5  preciceAdapter::Interface::~Interface() at ??:?
openfoam-adapter    | #6  preciceAdapter::Adapter::teardown() at ??:?
openfoam-adapter    | #7  preciceAdapter::Adapter::finalize() at ??:?
openfoam-adapter    | #8  preciceAdapter::Adapter::execute() at ??:?
openfoam-adapter    | #9  Foam::functionObjects::preciceAdapterFunctionObject::execute() at ??:?
openfoam-adapter    | #10  Foam::functionObjectList::execute() at ??:?
openfoam-adapter    | #11  Foam::Time::run() const at Time.C:?
openfoam-adapter    | #12  ? at ??:?
openfoam-adapter    | #13  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
openfoam-adapter    | #14  ? at ??:?
openfoam-adapter    | /bin/bash: line 1:   162 Segmentation fault      (core dumped) pimpleDyMFoam -case /home/precice/Data/Input

Could you please: