the program given below creates a child process with two threads accessing a shared variable. Unfortunately, Thread Analyzer does not detect the race (neither version 12.0 nor 12.3). The race is only detected if it occurs in the parent process. Option "-F on/all" to instrument child processes does not work in conjunction with option "-r all" (the collect tool emits the error message "
Race-detection data cannot be collected with any of -F -j -J -x"). Is this an inherent limitation of Thread Analyzer or is there a way to detect races and deadlocks in child processes?
Thank you very much in advance for your help.
int main ()
x = 0;
int pid = fork();
assert(pid >= 0);
if (pid == 0)
/* Child process */
assert(pthread_create(&thread, NULL, fun, NULL) == 0);
assert(pthread_join(thread, NULL) == 0);
/* Parent process */