compile ok, but halt by segmentation fault