I think @bgoodri released an RStan patch on CRAN (v2.21.2) that might fix this (I don’t know but could be worth a try), but one way to run VB without crashing R is to use the new the new CmdStanR interface (as I just suggested over in this thread: R Session Aborted). With CmdStanR you might still get errors if the VB algorithm encounters errors but it shouldn’t crash your R session.