When i run my program it shows just segmentation fault. As my knowledge, segmentation fault can occur for pointer and memory related fault. But i could not find out my mistake. Please see some part of code(maybe, that is related to segmentation fault):
char *state_in; //state_in = malloc(1024); char pls = "./faultinjectors/fi_"; strcat(pls, argv); strcat(pls, ".so"); const char* preloadStr = pls; strcpy(state_in, argv); .... ... setenv("LD_PRELOAD", preloadStr, 1); ... ...
I think above part of my code are related to segmentation fault.
Could anybody know me where is my mistake?