From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#25364: etags malloc problems Date: Thu, 05 Jan 2017 17:36:19 +0200 Message-ID: <83eg0hecy4.fsf@gnu.org> References: <91a665173f0064eaaf432cb1d52f3dd57635@sharklasers.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1483630885 4912 195.159.176.226 (5 Jan 2017 15:41:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 5 Jan 2017 15:41:25 +0000 (UTC) Cc: 25364@debbugs.gnu.org To: 5upnzm+87w9w470225qs@sharklasers.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jan 05 16:41:21 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cPAAK-0000fT-GW for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Jan 2017 16:41:20 +0100 Original-Received: from localhost ([::1]:47058 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cPAAO-0004Z8-RL for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Jan 2017 10:41:24 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33015) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cPA6E-0001N7-QD for bug-gnu-emacs@gnu.org; Thu, 05 Jan 2017 10:37:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cPA69-0006aV-T6 for bug-gnu-emacs@gnu.org; Thu, 05 Jan 2017 10:37:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:56815) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cPA69-0006aO-QV for bug-gnu-emacs@gnu.org; Thu, 05 Jan 2017 10:37:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cPA69-0000M5-MI for bug-gnu-emacs@gnu.org; Thu, 05 Jan 2017 10:37:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 Jan 2017 15:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25364 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25364-submit@debbugs.gnu.org id=B25364.14836305751294 (code B ref 25364); Thu, 05 Jan 2017 15:37:01 +0000 Original-Received: (at 25364) by debbugs.gnu.org; 5 Jan 2017 15:36:15 +0000 Original-Received: from localhost ([127.0.0.1]:43981 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cPA5O-0000Kn-UL for submit@debbugs.gnu.org; Thu, 05 Jan 2017 10:36:15 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:41848) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cPA5N-0000Ka-6C for 25364@debbugs.gnu.org; Thu, 05 Jan 2017 10:36:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cPA5C-0006ML-Hb for 25364@debbugs.gnu.org; Thu, 05 Jan 2017 10:36:07 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:60390) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cPA5C-0006MH-E0; Thu, 05 Jan 2017 10:36:02 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4905 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cPA5B-00052W-TT; Thu, 05 Jan 2017 10:36:02 -0500 In-reply-to: <91a665173f0064eaaf432cb1d52f3dd57635@sharklasers.com> (5upnzm+87w9w470225qs@sharklasers.com) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:127784 Archived-At: > Date: Thu, 05 Jan 2017 03:07:13 +0000 > From: <5upnzm+87w9w470225qs@sharklasers.com> > > clang-3.9 -g -pipe -Wall -O1 -fsanitize=address -fno-omit-frame-pointer -MD -MF.depend.etags.o -MTetags.o -std=gnu99 -fstack-protector-strong -Qunused-arguments -c etags.c -o etags.o > etags.c:6367:25: warning: assigning to 'unsigned char *' from 'char [256]' > converts between pointers to integer types with different sign > [-Wpointer-sign] > patbuf->translate = lc_trans; /* translation table to fold case */ > ^ ~~~~~~~~ > 1 warning generated. This warning is a harmless nuisance, AFAIU. > ==5176==ERROR: LeakSanitizer: detected memory leaks > > Direct leak of 120 byte(s) in 1 object(s) allocated from: > #0 0x4cba68 in __interceptor_malloc (/tmp/etags/etags+0x4cba68) > #1 0x5043f8 in xmalloc /tmp/etags/etags.c:7238:18 > #2 0x5036c5 in main /tmp/etags/etags.c:1097:15 > #3 0x7fb31bc332b0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202b0) > > Direct leak of 40 byte(s) in 1 object(s) allocated from: > #0 0x4cba68 in __interceptor_malloc (/tmp/etags/etags+0x4cba68) > #1 0x5043f8 in xmalloc /tmp/etags/etags.c:7238:18 > #2 0x5036b8 in main /tmp/etags/etags.c:1091:20 > #3 0x7fb31bc332b0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202b0) > > Direct leak of 24 byte(s) in 1 object(s) allocated from: > #0 0x4cba68 in __interceptor_malloc (/tmp/etags/etags+0x4cba68) > #1 0x5043f8 in xmalloc /tmp/etags/etags.c:7238:18 > #2 0x50447c in concat /tmp/etags/etags.c:6958:18 > #3 0x503706 in main /tmp/etags/etags.c:1109:15 > #4 0x7fb31bc332b0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202b0) > > SUMMARY: AddressSanitizer: 184 byte(s) leaked in 3 allocation(s). > > the attached patch is what i used to make etags.c compile. I'm not sure I understand why all those patches are needed. Is that just to shut up the above warning? If there were other problems during compilation, please show the warning/error messages. Also, it looks like you are using some old version of the Emacs sources, because neither Emacs 25.1, the latest released version, nor the current master branch match the line numbers reported by the compiler. Could you try the latest version of the sources, and see if the problems you found are still there? Thanks.