closure conversion mysterious segfault