Make it clear when traces end abnormally during replay, and add select() test.