segfaults, but the heap looks ok