It crashes on larger rank-1 arrays too. 128!:5 ] 1006 $ 0j1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 128!:5 ] 1007 $ 0j1 (Crashes)
Dan Bron wrote: > Devon wrote: >> I've managed to build an array that's crashing my code. > > There's nothing interesting or special about the array. The interpreter > just has a bug; the simple sentence: > > $(128!:5) 3 335 $ 0j1 > > also crashes J. It seems to be sensitive to two features of the array: its > type and shape. > > The crash doesn't occur for any boolean, integer, floating point, rational, > or extended int array I tried. So it has to be complex. > > It only crashes on complex arrays with particular shape patterns. As you > noticed, it doesn't crash of the table has 334 columns or less; it does > crash if it has 335 or more. It doesn't crash if the table has only one > row, but it does crash if it has more than one row. It doesn't crash on > the ravel of the table (i.e. a rank 1 array), but it does crash if the > array is rank 3 (along with the previous other constraints), etc etc etc. > >> I suspected it contained NaNs but my attempt to check it >> crashes J. > > Nope. Your array only contains two values: > > ~. , badarray > _1j_1 _1j_0.96875 > > and the latter value is rare: > > #/.~ , badarray > 1003 2 > > at the indices: > > ($ #: _1j_1 I.@:~: ,) badarray > 1 332 > 2 333 > > -Dan > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
