I have a 20 by 20 array called img. I noticed it is causing the segfaults in my (fairly lengthy) haskell program at run-time. Firstly, I can call extent on this array with no problem and I get back a shape of 20 by 20. However if I index img with any index in the range 0-19 on both axis I get a segfault. It is a delayed array of unboxed doubles and I also get a segfault if I try to run computeUnboxedS or sumAllS or traverse on the array img.
It is also worth mentioning img is an array I get by slicing a 4D array using 'All' on two of the axis and specific indicies on the other two axes. I have removed all behavior based random on random number generation from the program and the segfault still shows up at different times every time the program is rerun. Removing the offending operations on the array confirms that it is certainly the array causing the segfaults and the program runs for a long time with no sign of any segfault.