pkmoore / rrapper

Wrap rr in order to inject abnormal system call behavior
3 stars 5 forks source link

rrtest create fails for programs returning -1 and exiting beforehand : `rr record` failed [exit status: 255] #141

Open Aniket025 opened 5 years ago

Aniket025 commented 5 years ago

`#include

include

include <sys/types.h>

include <sys/stat.h>

include

include

include

include

int main() { int f_d = 0; struct stat st;

f_d = open("test.txt",O_RDONLY); 

// If lines 17 -21 and 25 to 30 are removed rrtest does not give error if(-1 == f_d) { printf("\n NULL File descriptor\n"); return -1; }

errno = 0; 

// If lines 17 -21 and 25 to 30 are removed rrtest does not give error if(fstat(f_d, &st)) { printf("\nfstat error: [%s]\n",strerror(errno)); close(f_d); return -1; }

rename("snazzyjazz.txt", "test2.txt"); int x = 0 ; x = 5 ; rename("test2.txt", "test3.txt"); int y = 0 ; y = 5 ; rename("test3.txt", "test4.txt"); return 0; }