Skip to content

Fix memory error in MPI runs

!107 (merged) introduced a bug with the addition of a user-defined ~BoundaryValues() destructor that only deletes the send/recv buffers when MPI is enabled.

Because MeshBlock was destructed before the Hydro/MHD/etc. objects, the int nnghbr = pmy_pack->pmb->nnghbr; became undefined and the subsequent delete calls cause:

free(): double free detected in tcache 2

even when running a single MPI rank. The fix is to delete pmb last in ~MeshBlockPack(). There might be a more elegant way of fixing this.

Merge request reports

Loading