Open nilsvu opened 4 years ago
@kidder and I traced this through the DataBox code. This is what we found:
The offending lines seem to be this:
Removing the body of the add_items_to_box
and also removing its meta arguments didn't help, neither did any variation of forwarding the arguments as a tuple of rvalue refs and taking the tuple itself by rvalue ref or by value. Perhaps such a large tuple of rvalue refs just overflows the stack, though I would find that very odd 🤷♂️
add_items_to_box
in chunks of a reasonable number of tags. Since it's probably very rare that db::create_from
needs to be called with a huge amount of tags that each should be assign an actual value, another workaround is to omit the call to add_items_to_box
altogether when all tags should just be default-constructed. We just want to default-construct the tags anyway in the one situation where I hit this bus error, i.e. in SetupDataBox
, so I suggest the latter approach (here https://github.com/sxs-collaboration/spectre/pull/2899#discussion_r579469906).On my Apple Silicon Mac, I get a bus error when trying to run SolveXcts on more than one core. Specifically, the error happens when trying to call invoke_iterable_action
on the action Actions::SetupDataBox
, which does have a call to db::create_from
inside it
Bug reports:
I get a bus error when calling
db::create_from
with a large amount of simple tags, and running in parallel on 2 or more processors. Splitting the call in two resolves the issue. I haven't investigated this issue any further than this, but noting it down here in case anyone else runs into this problem.Edit: This seems to be an issue only on macOS.