Strange, just tested exactly the same scenario several times, and it works without problems. What is the xterm output before the segmentation fault occurs?