https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97461
--- Comment #19 from Sergei Trofimovich <slyfox at gcc dot gnu.org> --- (In reply to Martin Liška from comment #16) > (In reply to Sergei Trofimovich from comment #15) > > allocate_gcov_kvp() gets called 89 times. Tried as: > > All right, it's quite close to what we have. > So can you please test the following patch: > > diff --git a/gcc/gcov-io.h b/gcc/gcov-io.h > index 4e95c7c82ee..a899a02b765 100644 > --- a/gcc/gcov-io.h > +++ b/gcc/gcov-io.h > @@ -293,7 +293,7 @@ GCOV_COUNTERS > #define GCOV_TOPN_MAXIMUM_TRACKED_VALUES 32 > > /* Number of pre-allocated gcov_kvp structures. */ > -#define GCOV_PREALLOCATED_KVP 64 > +#define GCOV_PREALLOCATED_KVP 128 > > /* Convert a counter index to a tag. */ > #define GCOV_TAG_FOR_COUNTER(COUNT) \ Still hangs somewhere in the middle of firefox inners: (gdb) bt #0 __lll_lock_wait (futex=0x7f03a8900018, private=0) at lowlevellock.c:52 #1 0x00007f03a9097305 in __GI___pthread_mutex_lock (mutex=0x7f03a8900018) at ../nptl/pthread_mutex_lock.c:135 #2 0x0000556eee199141 in arena_t::MallocSmall(unsigned long, bool) () #3 0x0000556eee19a06c in arena_t::Malloc(unsigned long, bool) () #4 0x0000556eee19b1e2 in calloc () #5 0x0000556eee28ba2b in allocate_gcov_kvp () at /var/tmp/portage/sys-devel/gcc-11.0.0_pre9999/work/gcc-11.0.0_pre9999/libgcc/libgcov.h:431 #6 gcov_topn_add_value (count=1, use_atomic=1, increment_total=1, value=480, counters=0x556eee2fc8c0 <__gcov3._ZL20arena_run_reg_dallocP11arena_run_tP11arena_bin_tPvm>) at /var/tmp/portage/sys-devel/gcc-11.0.0_pre9999/work/gcc-11.0.0_pre9999/libgcc/libgcov.h:477 #7 __gcov_topn_values_profiler_body (use_atomic=1, value=480, counters=0x556eee2fc8c0 <__gcov3._ZL20arena_run_reg_dallocP11arena_run_tP11arena_bin_tPvm>) at /var/tmp/portage/sys-devel/gcc-11.0.0_pre9999/work/gcc-11.0.0_pre9999/libgcc/libgcov-profiler.c:103 #8 __gcov_topn_values_profiler_atomic (counters=0x556eee2fc8c0 <__gcov3._ZL20arena_run_reg_dallocP11arena_run_tP11arena_bin_tPvm>, value=480) at /var/tmp/portage/sys-devel/gcc-11.0.0_pre9999/work/gcc-11.0.0_pre9999/libgcc/libgcov-profiler.c:128 #9 0x0000556eee198055 in arena_t::DallocSmall(arena_chunk_t*, void*, arena_chunk_map_t*) () #10 0x0000556eee19865c in free () #11 0x00007f03a8ca5bff in _IO_deallocate_file (fp=0x7f0372220b60) at libioP.h:863 #12 _IO_new_fclose (fp=0x7f0372220b60) at iofclose.c:74 #13 0x00007f039dbd5b62 in __gcov_close () at /var/tmp/portage/sys-devel/gcc-11.0.0_pre9999/work/gcc-11.0.0_pre9999/libgcc/../gcc/gcov-io.c:212 #14 0x00007f039dbd62ed in dump_one_gcov (run_max=139, run_counted=0, gf=<synthetic pointer>, gi_ptr=0x7f03a3c432e0) at /var/tmp/portage/sys-devel/gcc-11.0.0_pre9999/work/gcc-11.0.0_pre9999/libgcc/libgcov-driver.c:516 #15 gcov_do_dump (list=<optimized out>, run_counted=0) at /var/tmp/portage/sys-devel/gcc-11.0.0_pre9999/work/gcc-11.0.0_pre9999/libgcc/libgcov-driver.c:555 #16 0x00007f039dbd7152 in __gcov_dump_one (root=0x7f03a616b700 <__gcov_root>) at /var/tmp/portage/sys-devel/gcc-11.0.0_pre9999/work/gcc-11.0.0_pre9999/libgcc/libgcov-driver.c:578 #17 __gcov_dump_one (root=0x7f03a616b700 <__gcov_root>) at /var/tmp/portage/sys-devel/gcc-11.0.0_pre9999/work/gcc-11.0.0_pre9999/libgcc/libgcov-driver.c:573 #18 0x00007f039dbd7318 in __gcov_dump_int () at /var/tmp/portage/sys-devel/gcc-11.0.0_pre9999/work/gcc-11.0.0_pre9999/libgcc/libgcov-interface.c:160 #19 __gcov_dump () at /var/tmp/portage/sys-devel/gcc-11.0.0_pre9999/work/gcc-11.0.0_pre9999/libgcc/libgcov-interface.c:170 #20 0x00007f039dbd5497 in __gcov_execve (path=0x7f036db530b0 "/home/slyfox/tmp/portage/www-client/firefox-82.0/work/firefox_build/instrumented/dist/firefox/firefox", argv=0x7f0372632a00, envp=0x7f036cc8e000) at /var/tmp/portage/sys-devel/gcc-11.0.0_pre9999/work/gcc-11.0.0_pre9999/libgcc/libgcov-interface.c:343 #21 0x00007f039388b0fb in base::LaunchApp(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, base::LaunchOptions const&, int*) () at /home/slyfox/tmp/portage/www-client/firefox-82.0/work/firefox_build/instrumented/dist/firefox/libxul.so #22 0x00007f0393929bac in mozilla::ipc::PosixProcessLauncher::DoLaunch() () at /home/slyfox/tmp/portage/www-client/firefox-82.0/work/firefox_build/instrumented/dist/firefox/libxul.so #23 0x00007f039392a35a in mozilla::ipc::BaseProcessLauncher::PerformAsyncLaunch() () at /home/slyfox/tmp/portage/www-client/firefox-82.0/work/firefox_build/instrumented/dist/firefox/libxul.so #24 0x00007f0393920296 in mozilla::detail::ProxyRunnable<mozilla::MozPromise<mozilla::ipc::LaunchResults, mozilla::ipc::LaunchError, false>, RefPtr<mozilla::MozPromise<mozilla::ipc::LaunchResults, mozilla::ipc::LaunchError, false> > (mozilla::ipc::BaseProcessLauncher::*)(), mozilla::ipc::BaseProcessLauncher>::Run() () at /home/slyfox/tmp/portage/www-client/firefox-82.0/work/firefox_build/instrumented/dist/firefox/libxul.so #25 0x00007f0392db38f0 in mozilla::TaskQueue::Runner::Run() () at /home/slyfox/tmp/portage/www-client/firefox-82.0/work/firefox_build/instrumented/dist/firefox/libxul.so #26 0x00007f0392d978f5 in nsThread::ProcessNextEvent(bool, bool*) () at /home/slyfox/tmp/portage/www-client/firefox-82.0/work/firefox_build/instrumented/dist/firefox/libxul.so #27 0x00007f0392d77130 in NS_ProcessNextEvent(nsIThread*, bool) () at /home/slyfox/tmp/portage/www-client/firefox-82.0/work/firefox_build/instrumented/dist/firefox/libxul.so #28 0x00007f03939554cd in mozilla::ipc::MessagePumpForNonMainThreads::Run(base::MessagePump::Delegate*) () at /home/slyfox/tmp/portage/www-client/firefox-82.0/work/firefox_build/instrumented/dist/firefox/libxul.so #29 0x00007f0393891ecd in MessageLoop::Run() () at /home/slyfox/tmp/portage/www-client/firefox-82.0/work/firefox_build/instrumented/dist/firefox/libxul.so #30 0x00007f0392dbc45a in nsThread::ThreadFunc(void*) () at /home/slyfox/tmp/portage/www-client/firefox-82.0/work/firefox_build/instrumented/dist/firefox/libxul.so #31 0x00007f03a8adf880 in _pt_root () at /usr/lib64/libnspr4.so #32 0x00007f03a9094e6e in start_thread (arg=0x7f0372755640) at pthread_create.c:463 #33 0x00007f03a8d2ed2f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95