GNU bug report logs - #25364
etags malloc problems

Previous Next

Package: emacs;

Reported by: <5upnzm+87w9w470225qs <at> sharklasers.com>

Date: Thu, 5 Jan 2017 04:11:02 UTC

Severity: minor

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 25364 in the body.
You can then email your comments to 25364 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#25364; Package emacs. (Thu, 05 Jan 2017 04:11:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to <5upnzm+87w9w470225qs <at> sharklasers.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 05 Jan 2017 04:11:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: <5upnzm+87w9w470225qs <at> sharklasers.com>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: etags malloc problems
Date: Thu, 05 Jan 2017 03:07:13 +0000
[Message part 1 (text/plain, inline)]
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.
clang-3.9 -g -pipe -Wall -O1 -fsanitize=address -fno-omit-frame-pointer -std=gnu99 -fstack-protector-strong -Qunused-arguments  -o etags etags.o  
echo ./etags.c | ./etags -l auto -S -

=================================================================
==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.





----
Sent using Sharklasers.com
Block or report abuse: https://www.sharklasers.com//abuse/?a=Q1RzSAoOVvkQhQ%2B3414YfAGJQtiX
[etagswithoutemacs.diff (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25364; Package emacs. (Thu, 05 Jan 2017 15:37:01 GMT) Full text and rfc822 format available.

Message #8 received at 25364 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: 5upnzm+87w9w470225qs <at> sharklasers.com
Cc: 25364 <at> debbugs.gnu.org
Subject: Re: bug#25364: etags malloc problems
Date: Thu, 05 Jan 2017 17:36:19 +0200
> Date: Thu, 05 Jan 2017 03:07:13 +0000
> From: <5upnzm+87w9w470225qs <at> 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25364; Package emacs. (Thu, 05 Jan 2017 15:53:01 GMT) Full text and rfc822 format available.

Message #11 received at 25364 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: <5upnzm+87w9w470225qs <at> sharklasers.com>
Cc: 25364 <at> debbugs.gnu.org
Subject: Re: bug#25364: etags malloc problems
Date: Thu, 05 Jan 2017 16:52:47 +0100
On Jan 05 2017, <5upnzm+87w9w470225qs <at> sharklasers.com> wrote:

> ==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)

These are all allocations in main, no point in freeing them if the
process is exiting anyway.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25364; Package emacs. (Thu, 05 Jan 2017 16:55:01 GMT) Full text and rfc822 format available.

Message #14 received at 25364 <at> debbugs.gnu.org (full text, mbox):

From: Richard Stallman <rms <at> gnu.org>
To: <5upnzm+87w9w470225qs <at> sharklasers.com>
Cc: 25364 <at> debbugs.gnu.org
Subject: Re: bug#25364: etags malloc problems
Date: Thu, 05 Jan 2017 11:54:48 -0500
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

Placating clang is not a design goal of Emacs.  If this is an actual
bug, then we should fix it.  Otherwhse we should ignore it.

-- 
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25364; Package emacs. (Sun, 29 Sep 2019 15:18:02 GMT) Full text and rfc822 format available.

Message #17 received at 25364 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Richard Stallman <rms <at> gnu.org>
Cc: 5upnzm+87w9w470225qs <at> sharklasers.com, 25364 <at> debbugs.gnu.org
Subject: Re: bug#25364: etags malloc problems
Date: Sun, 29 Sep 2019 17:17:46 +0200
Richard Stallman <rms <at> gnu.org> writes:

> Placating clang is not a design goal of Emacs.  If this is an actual
> bug, then we should fix it.  Otherwhse we should ignore it.

I don't think there were any actual bugs in this report, so I'm closing
it.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 25364 <at> debbugs.gnu.org and <5upnzm+87w9w470225qs <at> sharklasers.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 29 Sep 2019 15:18:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 28 Oct 2019 11:24:15 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 182 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.