Weird segfault

Happens in Ubuntu but not cygwin