Process exits with signal 11 when running tests


#1

When writing some tests to my advent of code, one of the tests caused the process to exit with the message:

test tests::part2_test1 ... Process didn't exit successfully: `.../target/debug/day6-c959ab1e4c55edbf` (signal: 11)

The code that causes the error and lldb output can be found here.

The program runs fine, btw, it only fails only when running tests.


#2

Probably has something to do with the default stack size; it’s generally a bad idea to allocate an 8MB array on the stack.


#3

You are right, I changed the array from u32 to u16 and it worked!

Thanks!