Open brentp opened 4 years ago
Looking at the stacktrace we have this
(*s).calldepth = (NI16)((*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).calldepth + ((NI16) 1));
NI16 is int16 and can only hold integer up to 16384. It probably is crashing on an overflow error. How big was the tensor? I'm surprised that the calldepth could reach that much, there shouldn't be any recursion in the sum functions mentioned. https://github.com/mratsim/Arraymancer/blob/fe896870f8a67f961a930f832af72354f32c3da2/src/tensor/aggregate.nim#L27-L35
nimFrame
are not inserted in release mode hence it doesn't appear there.
It should also disappear with --stacktraces:off
(which push/pop probably being the proper fix) and maybe with --overflowChecks:off
with --stackTrace:off
I get:
Error: unhandled exception: /home/brentp/.nimble/pkgs/arraymancer-0.6.0/tensor/selectors.nim(218, 26) `dstSlice`gensym34935440[axis].a == size`gensym34935437` [AssertionDefect]
that's occurring in the code that's using the new fancy indexing, so I assume that's corrupting memory and then the error is appearing later (?).
that assertion error reproducible with:
var T = randomTensor(2504, 17384, 0.5'f32)
var sel = randomTensor(T.shape[1], 1'f32).asType(bool)
sel[100..200] = false
T = T[_, sel]
It seems like the issue is with reassign a tensor to itself, this doesn't trigger the assertion:
var T = randomTensor(2504, 17384, 0.5'f32)
var sel = randomTensor(T.shape[1], 1'f32).asType(bool)
sel[100..200] = false
let U = T[_, sel]
It might even solve your original bug, I'm not sure how to prevent that though.
I am getting a segfault with pca, but only when built without release and without danger.
with gdb, I see:
if that's not helpful I can try to get means to recreate (from somalier)