On 31/07/17 13:04, Xi Ruoyao wrote: > By using exit(), the functions registered by atexit() and on_exit() would be > called. GCC registers one atexit function to produce .gcda file. Yups. I have run into this problem in the past, too; a coveraged binary must exit() to generate coverage output. > Even if without gcov, it's recommended to catch SIGTERM and terminate your > service cleanly. What! I didn't know this. But you can't *do* anything much in a signal handler, no?