need to check segfault when n>100k