hi all, i m getting segfault. but unable to get the reasons why. please go through the following code :- /* * creates folder. * returns 0 if successful else non-zero value. */ int createDir(char *dirName) { char *str = NULL, *str1 = NULL; char *name = NULL, *name1 = NULL; str = str1 = name1 = dirName; printf("str = %s\n", str); printf("str1 = %s\n", str1); printf("name1 = %s\n", name1); printf("dirName = %s\n", dirName); } static void handle_import(int connfd, void *arg1, void *arg2) { ImportOptions *impOptions = (ImportOptions *)arg2; UserInfo *userInfo = (UserInfo *)arg1; createDir(userInfo->userName); } the output is following :- str = mehul str1 = mehul name1 = mehul dirName = mehul but the program seg faults at first printf() in createDir(). the gdb says following :- Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 1026 (LWP 2059)] 0x400efc66 in _IO_vfprintf (s=0x40071cc0, format=0x805161b "str = %s\n", ap=0xbf7ff764) at ../sysdeps/i386/i486/bits/string.h:529 529 ../sysdeps/i386/i486/bits/string.h: No such file or directory. waiting for reply. mehul.