detecting and flagging segfaults in Query.py