How can i exit DS Process

i quit DS process by exit(0), buf it make a coredump. How can i exit DS Process?
Looking forward to any suggestions, thank you.