amrex
amrex copied to clipboard
Segfault when refluxing with fine layer that covers entire domain
I am running into a segfault when my domain is completely covered by the fine grid.
The sequence of events is as follows:
- Generate an empty m_cfpatch in YAFluxRegister due to the complete coverage of the domain with the fine grid
- Call Reflux which calls ParallelCopy on m_crse_data and m_cfpatch
- Calls ParallelCopy_nowait, which exits at line 276 because we have an empty FabArray, thus it does not load the a pointer into pc_src
- Fail in ParallelCopy_finish when we try to call size() on pc_src as it is still null
I have attached my backtrace as well:
1 std::__shared_ptr<amrex::BARef, (__gnu_cxx::_Lock_policy)2>::get shared_ptr_base.h 1310 0x414fce
2 std::__shared_ptr_access<amrex::BARef, (__gnu_cxx::_Lock_policy)2, false, false>::_M_get shared_ptr_base.h 1021 0x416ae4
3 std::__shared_ptr_access<amrex::BARef, (__gnu_cxx::_Lock_policy)2, false, false>::operator-> shared_ptr_base.h 1015 0x414fbc
4 amrex::BoxArray::size AMReX_BoxArray.H 581 0x443484
5 amrex::FabArrayBase::size AMReX_FabArrayBase.H 101 0x4d0e0a
6 amrex::FabArray<amrex::FArrayBox>::ParallelCopy_finish AMReX_FabArrayCommI.H 474 0x7af263
7 amrex::FabArray<amrex::FArrayBox>::ParallelCopy AMReX_FabArrayCommI.H 259 0x7abbdf
8 amrex::FabArray<amrex::FArrayBox>::ParallelCopy AMReX_FabArray.H 554 0x7e0403
9 amrex::FabArray<amrex::FArrayBox>::ParallelCopy AMReX_FabArray.H 471 0x7db687
10 amrex::EBFluxRegister::Reflux AMReX_EBFluxRegister.cpp 251 0xd4016a
11 MFP::post_timestep MFP.cpp 309 0x4336b4
12 amrex::Amr::timeStep AMReX_Amr.cpp 2043 0x9ed356
13 amrex::Amr::coarseTimeStep AMReX_Amr.cpp 2094 0x9ed920
14 main main.cpp 162 0x411b6b
@kngott I think you may want to take a look at this
Thank you for the concise description of the problem! It was extremely helpful.
We just pushed a new pull request to development that should fix the problem. Please pull development, try it out, and let us know: https://github.com/AMReX-Codes/amrex/pull/1845
@kngott that seems to have fixed it. Thanks for the quick response!