BullseyeCoverage Up Contents Search

Segmentation Fault Upon fork

Symptoms

On a Unix-like operating system, the child process of a call to fork terminates with a segmentation fault immediately upon startup. The parent process previously unloaded an instrumented shared object via dlclose.

Cause

When auto-save is enabled, the BullseyeCoverage run-time uses pthread_atfork to prevent synchronization errors between parent and child processes. When a shared object is instrumented, the function pointer parameter to pthread_atfork points into the BullseyeCoverage run-time in the shared object. If the shared object is unloaded, the function pointer becomes invalid. A call to fork causes the function pointer to be dereferenced, resulting in a crash.

Resolution

Disable auto-save by setting environment variable COVAUTOSAVE=0.

More Information

See also Unix-like Systems

segfault shared object

Updated: 23 Mar 2015