https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64123
--- Comment #21 from Jan Hubicka <hubicka at gcc dot gnu.org> --- OK, I am currently on a trip with sporadic internet access but I can try to build the shared libraries. In meantime you can also just try out firefox profiledbuild ;) What happens IMO is that 1) fork calls __gcov_fork 2) __gcov_fork calls __gcov_dump_int 3) gcov_dump_int traverses the global master root and walks into objects from other DSO and calls __gcov_dump_one 4) __gcov_dump_one eventaully calls dump_one_gcov that calls merge_one_data 5) merge_one_data uses pointer from other DSO to call merge function that calls wrong copy of gcov-io So unlike the atexit machinery, IMO the bug is that gcov_dump_int walks the master_root without dispatching to a proper copy of the gcov_dump_one Honza