How do you solve segmentation fault in ns2?