Process 62641 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2, address=0x100000648) frame #0: 0x00000001132c4288 libpetsc.3.018.dylib`PetscTrFreeDefault(aa=0x00000001120c3c50, lineno=217, function="PetscFunctionListDLAllPop_Private", filename="/Users/sasyed/Documents/packages/petsc/src/sys/dll/reg.c") at mtr.c:328:36 325 if (head->prev) head->prev->next = head->next; 326 else TRhead = head->next; 327 -> 328 if (head->next) head->next->prev = head->prev; 329 PetscCall(PetscFreeAlign(a, lineno, function, filename)); 330 PetscFunctionReturn(PETSC_SUCCESS); 331 } (lldb) bt * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2, address=0x100000648) * frame #0: 0x00000001132c4288 libpetsc.3.018.dylib`PetscTrFreeDefault(aa=0x00000001120c3c50, lineno=217, function="PetscFunctionListDLAllPop_Private", filename="/Users/sasyed/Documents/packages/petsc/src/sys/dll/reg.c") at mtr.c:328:36 frame #1: 0x0000000112e2344c libpetsc.3.018.dylib`PetscFunctionListDLAllPop_Private(fl=0x00000001120c3450) at reg.c:217:9 frame #2: 0x0000000112e22c3c libpetsc.3.018.dylib`PetscFunctionListDestroy(fl=0x00000001120c00b0) at reg.c:318:3 frame #3: 0x000000011305c67c libpetsc.3.018.dylib`PetscHeaderDestroy_Private(obj=0x00000001120c0050, clear_for_reuse=PETSC_FALSE) at inherit.c:156:5 frame #4: 0x00000001138fd508 libpetsc.3.018.dylib`VecDestroy(v=0x00000001178f8f60) at vector.c:532:3 frame #5: 0x0000000115db26e8 libpetsc.3.018.dylib`KSPSolve_Private(ksp=0x00000001178f8c50, b=0x0000000111910850, x=0x0000000111919050) at itfunc.c:811:5 frame #6: 0x0000000115db1da8 libpetsc.3.018.dylib`KSPSolve(ksp=0x00000001178f8c50, b=0x0000000111910850, x=0x0000000111919050) at itfunc.c:1070:3 frame #7: 0x000000011586d67c libpetsc.3.018.dylib`PCMGMCycle_Private(pc=0x000000010997ee50, mglevelsin=0x00000001178b7660, transpose=PETSC_FALSE, matapp=PETSC_FALSE, reason=0x0000000000000000) at mg.c:28:7 frame #8: 0x00000001158a1cf8 libpetsc.3.018.dylib`PCApply_MG_Internal(pc=0x000000010997ee50, b=0x0000000111910850, x=0x0000000111919050, B=0x0000000000000000, X=0x0000000000000000, transpose=PETSC_FALSE) at mg.c:611:48 frame #9: 0x000000011589dab4 libpetsc.3.018.dylib`PCApply_MG(pc=0x000000010997ee50, b=0x0000000111910850, x=0x0000000111919050) at mg.c:633:3 frame #10: 0x00000001153fc224 libpetsc.3.018.dylib`PCApply(pc=0x000000010997ee50, x=0x0000000111910850, y=0x0000000111919050) at precon.c:441:3 frame #11: 0x000000011540c1c8 libpetsc.3.018.dylib`PCApplyBAorAB(pc=0x000000010997ee50, side=PC_LEFT, x=0x0000000111914c50, y=0x0000000111919050, work=0x0000000111910850) at precon.c:715:7 frame #12: 0x0000000115cc27f0 libpetsc.3.018.dylib`KSP_PCApplyBAorAB(ksp=0x00000001118b5c50, x=0x0000000111914c50, y=0x0000000111919050, w=0x0000000111910850) at kspimpl.h:416:5 frame #13: 0x0000000115cbf150 libpetsc.3.018.dylib`KSPGMRESCycle(itcount=0x000000016fdf961c, ksp=0x00000001118b5c50) at gmres.c:147:5 frame #14: 0x0000000115cc5268 libpetsc.3.018.dylib`KSPSolve_GMRES(ksp=0x00000001118b5c50) at gmres.c:228:5 frame #15: 0x0000000115db4694 libpetsc.3.018.dylib`KSPSolve_Private(ksp=0x00000001118b5c50, b=0x00000001098ed050, x=0x00000001098e7450) at itfunc.c:898:3 frame #16: 0x0000000115db1da8 libpetsc.3.018.dylib`KSPSolve(ksp=0x00000001118b5c50, b=0x00000001098ed050, x=0x00000001098e7450) at itfunc.c:1070:3 frame #17: 0x000000010185cf70 libsynergia_collective.dylib`solve(sctx=0x0000000107d1c138, gctx=0x0000000107d1c040) at space_charge_3d_fd_utils.cc:413:5 frame #18: 0x000000010184c694 libsynergia_collective.dylib`Space_charge_3d_fd::apply_bunch(this=0x0000000107d1bed8, bunch=0x0000000107d1cc50, time_step=2.7959814862440695E-8, logger=0x000000016fdfa7d8) at space_charge_3d_fd.cc:249:9 frame #19: 0x0000000101845acc libsynergia_collective.dylib`Space_charge_3d_fd::apply_impl(this=0x0000000107d1bed8, sim=0x000000016fdfad28, time_step=2.7959814862440695E-8, logger=0x000000016fdfa7d8) at space_charge_3d_fd.cc:149:13 frame #20: 0x0000000102990b8c libsynergia_simulation.dylib`Operator::apply(this=0x0000000107d1bed8, simulator=0x000000016fdfad28, time_step=2.7959814862440695E-8, logger=0x000000016fdfa7d8) at operator.h:64:5 frame #21: 0x000000010299076c libsynergia_simulation.dylib`Step::apply(this=0x0000600003b00f18, simulator=0x000000016fdfad28, logger=0x000000016fdfa7d8) const at step.cc:56:9 frame #22: 0x0000000102a59ca8 libsynergia_simulation.dylib`Propagator::do_step(this=0x000000016fdfafa8, simulator=0x000000016fdfad28, step=0x0000600003b00f18, step_count=2, turn_count=11, logger=0x000000016fdfa7d8) at propagator.cc:112:10 frame #23: 0x0000000102a5add0 libsynergia_simulation.dylib`Propagator::propagate(this=0x000000016fdfafa8, sim=0x000000016fdfad28, logger=0x000000016fdfa7d8, max_turns=20) at propagator.cc:455:17 frame #24: 0x0000000100011dd0 fodo_cxx`run(opts=) at fodo_cxx.cc:169:16 frame #25: 0x00000001000934dc fodo_cxx`main(argc=6, argv=0x000000016fdfb770) at fodo_cxx.cc:188:5 frame #26: 0x0000000100fd108c dyld`start + 520 (lldb)