pi test compiles, but crashes randomly