I've fixed this by removing the usage of the function p(). When p() would return no lines of output, the bus error would occur.
I've fixed this by removing the usage of the function p(). When p() would return no lines of output, the bus error would occur.