https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69919
Bug ID: 69919 Summary: pool allocator and mem-stat race at program exit Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: rguenth at gcc dot gnu.org Target Milestone: --- ==16301== Invalid read of size 8 ==16301== at 0x843457: mem_alloc_description<pool_usage>::release_instance_overhead(void*, unsigned long, bool) (mem-stats.h:513) ==16301== by 0x8427C4: base_pool_allocator<memory_block_pool>::release() (alloc-pool.h:311) ==16301== by 0x84299D: base_pool_allocator<memory_block_pool>::~base_pool_allocator() (alloc-pool.h:335) ==16301== by 0x844E1B: object_allocator<cselib_val>::~object_allocator() (alloc-pool.h:474) ==16301== by 0x5E13058: __run_exit_handlers (in /lib64/libc-2.18.so) ==16301== by 0x5E130A4: exit (in /lib64/libc-2.18.so) ==16301== by 0x5DFCBEB: (below main) (in /lib64/libc-2.18.so) ==16301== Address 0x72529b0 is 1,088 bytes inside a block of size 3,048 free'd ==16301== at 0x4C28ADC: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==16301== by 0x844C81: xcallocator<hash_map<void const*, mem_usage_pair<pool_usage>, simple_hashmap_traits<default_hash_traits<void const*>, mem_usage_pair<pool_usage> > >::hash_entry>::data_free(hash_map<void const*, mem_usage_pair<pool_usage>, simple_hashmap_traits<default_hash_traits<void const*>, mem_usage_pair<pool_usage> > >::hash_entry*) (hash-table.h:273) ==16301== by 0x14DC512: hash_table<hash_map<void const*, mem_usage_pair<pool_usage>, simple_hashmap_traits<default_hash_traits<void const*>, mem_usage_pair<pool_usage> > >::hash_entry, xcallocator>::~hash_table() (hash-table.h:627) ==16301== by 0x14DCD77: hash_map<void const*, mem_usage_pair<pool_usage>, simple_hashmap_traits<default_hash_traits<void const*>, mem_usage_pair<pool_usage> > >::~hash_map() (hash-map.h:26) ==16301== by 0x14DCE52: mem_alloc_description<pool_usage>::~mem_alloc_description() (mem-stats.h:559) ==16301== by 0x5E13058: __run_exit_handlers (in /lib64/libc-2.18.so) ==16301== by 0x5E130A4: exit (in /lib64/libc-2.18.so) ==16301== by 0x5DFCBEB: (below main) (in /lib64/libc-2.18.so)