From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9964 invoked by alias); 24 Sep 2017 09:30:50 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 9910 invoked by uid 48); 24 Sep 2017 09:30:45 -0000 From: "luanjunchao at 163 dot com" To: elfutils-devel@sourceware.org Subject: [Bug backends/22196] New: possible memory leak in libcpu in elfutils 0.170(HEAD) Date: Sun, 24 Sep 2017 09:30:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: elfutils X-Bugzilla-Component: backends X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: luanjunchao at 163 dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot 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 target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2017-q3/txt/msg00126.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=3D22196 Bug ID: 22196 Summary: possible memory leak in libcpu in elfutils 0.170(HEAD) Product: elfutils Version: unspecified Status: UNCONFIRMED Severity: normal Priority: P2 Component: backends Assignee: unassigned at sourceware dot org Reporter: luanjunchao at 163 dot com CC: elfutils-devel at sourceware dot org Target Milestone: --- When I compile elfutils from the latest source code of git with address sanitizer, it aborted with memory leak. The command I run is "./configure CFLAGS=3D'-g -fsanitize=3Daddress' CXXFLA= GS=3D'-g -fsanitize=3Daddress' --enable-maintainer-mode && make". Part of the log is as follows: ...... Making all in libcpu GEN i386_defs GEN i386.mnemonics CC i386_gendis.o LEX i386_lex.c YACC i386_parse.c updating i386_parse.h CC i386_lex.o CC i386_parse.o CCLD i386_gendis GEN i386_dis.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D19600=3D=3DERROR: LeakSanitizer: detected memory leaks Direct leak of 17088 byte(s) in 3745 object(s) allocated from: #0 0x7ff12d6ba602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602) #1 0x4122e6 in xmalloc /work/elfutils-asan/lib/xmalloc.c:51 #2 0x412186 in xstrndup /work/elfutils-asan/lib/xstrndup.c:44 #3 0x402bd3 in i386_lex /work/elfutils-asan/libcpu/i386_lex.l:75 #4 0x407a10 in i386_parse /work/elfutils-asan/libcpu/i386_parse.c:1398 #5 0x401acb in main /work/elfutils-asan/libcpu/i386_gendis.c:69 #6 0x7ff12cf6f82f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f) Direct leak of 10608 byte(s) in 663 object(s) allocated from: #0 0x7ff12d6ba602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602) #1 0x4122e6 in xmalloc /work/elfutils-asan/lib/xmalloc.c:51 #2 0x409b5e in i386_parse /work/elfutils-asan/libcpu/i386_parse.y:474 #3 0x401acb in main /work/elfutils-asan/libcpu/i386_gendis.c:69 #4 0x7ff12cf6f82f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f) Direct leak of 1248 byte(s) in 52 object(s) allocated from: #0 0x7ff12d6ba602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602) #1 0x4122e6 in xmalloc /work/elfutils-asan/lib/xmalloc.c:51 #2 0x40a388 in i386_parse /work/elfutils-asan/libcpu/i386_parse.y:534 #3 0x401acb in main /work/elfutils-asan/libcpu/i386_gendis.c:69 #4 0x7ff12cf6f82f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f) Indirect leak of 44064 byte(s) in 1836 object(s) allocated from: #0 0x7ff12d6ba602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602) #1 0x4122e6 in xmalloc /work/elfutils-asan/lib/xmalloc.c:51 #2 0x409d5d in i386_parse /work/elfutils-asan/libcpu/i386_parse.y:493 #3 0x401acb in main /work/elfutils-asan/libcpu/i386_gendis.c:69 #4 0x7ff12cf6f82f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f) Indirect leak of 9168 byte(s) in 573 object(s) allocated from: #0 0x7ff12d6ba602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602) #1 0x4122e6 in xmalloc /work/elfutils-asan/lib/xmalloc.c:51 #2 0x409a21 in i386_parse /work/elfutils-asan/libcpu/i386_parse.y:467 #3 0x401acb in main /work/elfutils-asan/libcpu/i386_gendis.c:69 #4 0x7ff12cf6f82f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f) Indirect leak of 1344 byte(s) in 56 object(s) allocated from: #0 0x7ff12d6ba602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602) #1 0x4122e6 in xmalloc /work/elfutils-asan/lib/xmalloc.c:51 #2 0x40a1c3 in i386_parse /work/elfutils-asan/libcpu/i386_parse.y:525 #3 0x401acb in main /work/elfutils-asan/libcpu/i386_gendis.c:69 #4 0x7ff12cf6f82f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f) Indirect leak of 167 byte(s) in 52 object(s) allocated from: #0 0x7ff12d6ba602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602) #1 0x4122e6 in xmalloc /work/elfutils-asan/lib/xmalloc.c:51 #2 0x412186 in xstrndup /work/elfutils-asan/lib/xstrndup.c:44 #3 0x402e31 in i386_lex /work/elfutils-asan/libcpu/i386_lex.l:82 #4 0x407a10 in i386_parse /work/elfutils-asan/libcpu/i386_parse.c:1398 #5 0x401acb in main /work/elfutils-asan/libcpu/i386_gendis.c:69 #6 0x7ff12cf6f82f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f) SUMMARY: AddressSanitizer: 83687 byte(s) leaked in 6977 allocation(s). Makefile:730: recipe for target 'i386_dis.h' failed make[2]: *** [i386_dis.h] Error 23 rm i386_defs Makefile:485: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 Makefile:401: recipe for target 'all' failed make: *** [all] Error 2 It shows there are memory leaks in i386 arch and I wonder if there are memo= ry leaks in other archs. The os version is ubuntu 16.04 amd64 and I can reproduce it. --=20 You are receiving this mail because: You are on the CC list for the bug.