trapping segmentation fault from shell