From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14754 invoked by alias); 31 Oct 2014 08:47:34 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 14717 invoked by uid 48); 31 Oct 2014 08:47:30 -0000 From: "chefmax at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/63696] New: Alloc-dealloc-mismatch in ipa-icf.c Date: Fri, 31 Oct 2014 09:04:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: chefmax at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc cf_gcchost cf_gcctarget cf_gccbuild attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-10/txt/msg02475.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63696 Bug ID: 63696 Summary: Alloc-dealloc-mismatch in ipa-icf.c Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: chefmax at gcc dot gnu.org CC: ygribov at gcc dot gnu.org Host: x86_64-pc-linux-gnu Target: x86_64-pc-linux-gnu Build: x86_64-pc-linux-gnu Created attachment 33850 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33850&action=edit Trivial fix Running ASan-boostrap on GCC 5, I ran into the problem: $ cat /home/max/build/bootstrap-asan/x86_64-unknown-linux-gnu/libgcc/config.log ................................................................................ ================================================================= ==22376==ERROR: AddressSanitizer: alloc-dealloc-mismatch (operator new vs free) on 0x602000002430 #0 0x6b0cc9 in __interceptor_free /home/max/workspace/downloads/gcc/libsanitizer/asan/asan_malloc_linux.cc:28 #1 0x250a6c3 in ipa_icf::sem_function::~sem_function() /home/max/workspace/downloads/gcc/gcc/ipa-icf.c:219 #2 0x250a988 in ipa_icf::sem_function::~sem_function() /home/max/workspace/downloads/gcc/gcc/ipa-icf.c:224 #3 0x250aaa2 in ipa_icf::sem_item_optimizer::~sem_item_optimizer() /home/max/workspace/downloads/gcc/gcc/ipa-icf.c:1286 #4 0x2516271 in ipa_icf_driver /home/max/workspace/downloads/gcc/gcc/ipa-icf.c:2346 #5 0x2516271 in ipa_icf::pass_ipa_icf::execute(function*) /home/max/workspace/downloads/gcc/gcc/ipa-icf.c:2391 #6 0x121ebfb in execute_one_pass(opt_pass*) /home/max/workspace/downloads/gcc/gcc/passes.c:2159 #7 0x1220f46 in execute_ipa_pass_list(opt_pass*) /home/max/workspace/downloads/gcc/gcc/passes.c:2553 #8 0xab3316 in ipa_passes /home/max/workspace/downloads/gcc/gcc/cgraphunit.c:2065 #9 0xab3316 in symbol_table::compile() /home/max/workspace/downloads/gcc/gcc/cgraphunit.c:2145 #10 0xab80d7 in symbol_table::finalize_compilation_unit() /home/max/workspace/downloads/gcc/gcc/cgraphunit.c:2298 #11 0x72cad1 in c_write_global_declarations() /home/max/workspace/downloads/gcc/gcc/c/c-decl.c:10779 #12 0x142ab81 in compile_file /home/max/workspace/downloads/gcc/gcc/toplev.c:581 #13 0x636e4d in do_compile /home/max/workspace/downloads/gcc/gcc/toplev.c:1988 #14 0x636e4d in toplev::main(int, char**) /home/max/workspace/downloads/gcc/gcc/toplev.c:2085 #15 0x63a732 in main /home/max/workspace/downloads/gcc/gcc/main.c:38 #16 0x2b44e29db76c in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2176c) #17 0x63b140 (/home/max/build/bootstrap-asan/gcc/cc1+0x63b140) 0x602000002430 is located 0 bytes inside of 16-byte region [0x602000002430,0x602000002440) allocated by thread T0 here: #0 0x6b1cc9 in operator new(unsigned long) /home/max/workspace/downloads/gcc/libsanitizer/asan/asan_new_delete.cc:60 #1 0x24fd320 in ipa_icf::sem_function::init() /home/max/workspace/downloads/gcc/gcc/ipa-icf.c:736 SUMMARY: AddressSanitizer: alloc-dealloc-mismatch /home/max/workspace/downloads/gcc/libsanitizer/asan/asan_malloc_linux.cc:28 __interceptor_free ==22376==HINT: if you don't care about these warnings you may set ASAN_OPTIONS=alloc_dealloc_mismatch=0 ==22376==ABORTING configure:3398: $? = 1 configure:3586: checking for suffix of object files configure:3608: /home/max/build/bootstrap-asan/./gcc/xgcc -B/home/max/build/bootstrap-asan/./gcc/ -B/home/max/install/bootstrap-asan/x86_64-unknown-linux-gnu/bin/ -B/home/max/install/bootstrap-asan/x86_64-unknown-linux-gnu/lib/ -isystem /home/max/install/bootstrap-asan/x86_64-unknown-linux-gnu/include -isystem /home/max/install/bootstrap-asan/x86_64-unknown-linux-gnu/sys-include -c -g -O2 conftest.c >&5 ================================================================= ==22386==ERROR: AddressSanitizer: alloc-dealloc-mismatch (operator new vs free) on 0x602000002430 #0 0x6b0cc9 in __interceptor_free /home/max/workspace/downloads/gcc/libsanitizer/asan/asan_malloc_linux.cc:28 #1 0x250a6c3 in ipa_icf::sem_function::~sem_function() /home/max/workspace/downloads/gcc/gcc/ipa-icf.c:219 #2 0x250a988 in ipa_icf::sem_function::~sem_function() /home/max/workspace/downloads/gcc/gcc/ipa-icf.c:224 #3 0x250aaa2 in ipa_icf::sem_item_optimizer::~sem_item_optimizer() /home/max/workspace/downloads/gcc/gcc/ipa-icf.c:1286 #4 0x2516271 in ipa_icf_driver /home/max/workspace/downloads/gcc/gcc/ipa-icf.c:2346 #5 0x2516271 in ipa_icf::pass_ipa_icf::execute(function*) /home/max/workspace/downloads/gcc/gcc/ipa-icf.c:2391 #6 0x121ebfb in execute_one_pass(opt_pass*) /home/max/workspace/downloads/gcc/gcc/passes.c:2159 #7 0x1220f46 in execute_ipa_pass_list(opt_pass*) /home/max/workspace/downloads/gcc/gcc/passes.c:2553 #8 0xab3316 in ipa_passes /home/max/workspace/downloads/gcc/gcc/cgraphunit.c:2065 #9 0xab3316 in symbol_table::compile() /home/max/workspace/downloads/gcc/gcc/cgraphunit.c:2145 #10 0xab80d7 in symbol_table::finalize_compilation_unit() /home/max/workspace/downloads/gcc/gcc/cgraphunit.c:2298 #11 0x72cad1 in c_write_global_declarations() /home/max/workspace/downloads/gcc/gcc/c/c-decl.c:10779 #12 0x142ab81 in compile_file /home/max/workspace/downloads/gcc/gcc/toplev.c:581 #13 0x636e4d in do_compile /home/max/workspace/downloads/gcc/gcc/toplev.c:1988 #14 0x636e4d in toplev::main(int, char**) /home/max/workspace/downloads/gcc/gcc/toplev.c:2085 #15 0x63a732 in main /home/max/workspace/downloads/gcc/gcc/main.c:38 #16 0x2b02929fb76c in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2176c) #17 0x63b140 (/home/max/build/bootstrap-asan/gcc/cc1+0x63b140) $ ~/build/bootstrap-asan/gcc$ ./xgcc -v Using built-in specs. COLLECT_GCC=./xgcc Target: x86_64-unknown-linux-gnu Configured with: /home/max/workspace/downloads/gcc/configure --enable-multilib --enable-checking --target=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --build=x86_64-unknown-linux-gnu --prefix=/home/max/install/bootstrap-asan --enable-bootstrap --with-build-config=bootstrap-asan Thread model: posix gcc version 5.0.0 20141030 (experimental) (GCC) Trivial fix seems to resolve the issue.