I need to verify this, but here's what I think is happening:
- Mainloop destroys stonith API connection, calling stonith_connection_destroy() on the stonith client.
- The stonith client sends out T_STONITH_NOTIFY_DISCONNECT notifications via foreach_notify_entry() -> stonith_send_notification().
- One notification triggers crm_mon.c:mon_st_callback_display() (or event()), which calls mon_cib_connection_destroy().
- mon_cib_connection_destroy() calls stonith_api_delete(), which calls stonith_api_free() and destroys the entire client object.
- Control returns to stonith_send_notification() and foreach_notify_entry().
- One of the further attempts to access members of the stonith client object causes a segfault, since the object and all the members that it owns have been freed.