GNU bug report logs -
#24065
commit 09ece4d341a7 (Restore the calloc family) causes miscompile for gcc-5 and higher
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 24065 in the body.
You can then email your comments to 24065 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24065
; Package
emacs
.
(Mon, 25 Jul 2016 07:23:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Markus Trippelsdorf <markus <at> trippelsdorf.de>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Mon, 25 Jul 2016 07:23:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
commit 09ece4d341a7e07fab7be22868ebcadae8641c79
Author: Wolfgang Jenkner <wjenkner <at> inode.at>
Date: Tue Feb 9 15:04:40 2016 -0800
Restore the calloc family.
causes gcc-5 and higher to compile calloc to an endless loop.
-fno-builtin-malloc should be used to work around the problem.
See: https://gcc.gnu.org/ml/gcc-help/2015-03/msg00109.html
for a similar example.
--
Markus
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24065
; Package
emacs
.
(Mon, 25 Jul 2016 12:39:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 24065 <at> debbugs.gnu.org (full text, mbox):
Markus Trippelsdorf <markus <at> trippelsdorf.de> wrote:
> commit 09ece4d341a7e07fab7be22868ebcadae8641c79
> Author: Wolfgang Jenkner <wjenkner <at> inode.at>
> Date: Tue Feb 9 15:04:40 2016 -0800
>
> Restore the calloc family.
>
> causes gcc-5 and higher to compile calloc to an endless loop.
> -fno-builtin-malloc should be used to work around the problem.
This was the reason for the (compiler-independent) work-around
discussed in
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22085
and committed in
commit 4b1436b702d56eedd27a0777fc7232cdfb7ac4f6
Author: Wolfgang Jenkner <wjenkner <at> inode.at>
Date: Sat Dec 26 12:12:02 2015 -0800
Always define gmalloc etc. in src/gmalloc.c
The commit you cited shouldn't change that, I think.
In any case, that work-around seems to work for DragonflyBSD, which
has gcc 5 as base compiler, and, for the time being (i.e., emacs-25
branch), actually uses the malloc implemented in src/gmalloc, cf.
https://github.com/DragonFlyBSD/DPorts/tree/master/editors/emacs-devel
So, it would be useful to know on which system compilation fails.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24065
; Package
emacs
.
(Mon, 25 Jul 2016 12:56:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 24065 <at> debbugs.gnu.org (full text, mbox):
On 2016.07.25 at 14:38 +0200, Wolfgang Jenkner wrote:
> Markus Trippelsdorf <markus <at> trippelsdorf.de> wrote:
>
> > commit 09ece4d341a7e07fab7be22868ebcadae8641c79
> > Author: Wolfgang Jenkner <wjenkner <at> inode.at>
> > Date: Tue Feb 9 15:04:40 2016 -0800
> >
> > Restore the calloc family.
> >
> > causes gcc-5 and higher to compile calloc to an endless loop.
> > -fno-builtin-malloc should be used to work around the problem.
>
> This was the reason for the (compiler-independent) work-around
> discussed in
>
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22085
>
> and committed in
>
> commit 4b1436b702d56eedd27a0777fc7232cdfb7ac4f6
> Author: Wolfgang Jenkner <wjenkner <at> inode.at>
> Date: Sat Dec 26 12:12:02 2015 -0800
>
> Always define gmalloc etc. in src/gmalloc.c
>
> The commit you cited shouldn't change that, I think.
>
> In any case, that work-around seems to work for DragonflyBSD, which
> has gcc 5 as base compiler, and, for the time being (i.e., emacs-25
> branch), actually uses the malloc implemented in src/gmalloc, cf.
>
> https://github.com/DragonFlyBSD/DPorts/tree/master/editors/emacs-devel
>
> So, it would be useful to know on which system compilation fails.
This happens on a Gentoo system (glibc trunk, gcc-6 latest branch):
(gdb) run
Starting program: /var/tmp/portage/app-editors/emacs-24.5-r3/work/emacs-24.5/src/temacs --batch --load loadup bootstrap
Program received signal SIGSEGV, Segmentation fault.
0x00000000005cac25 in calloc (nmemb=<error reading variable: DWARF-2 expression error: Loop detected (257).>, size=size <at> entry=1) at gmalloc.c:1529
1529 result = malloc (bytes);
(gdb) bt
#0 0x00000000005cac25 in calloc (nmemb=<error reading variable: DWARF-2 expression error: Loop detected (257).>, size=size <at> entry=1) at gmalloc.c:1529
#1 0x00000000005cac2a in calloc (nmemb=<error reading variable: DWARF-2 expression error: Loop detected (257).>, size=size <at> entry=1) at gmalloc.c:1529
#2 0x00000000005cac2a in calloc (nmemb=<error reading variable: DWARF-2 expression error: Loop detected (257).>, size=size <at> entry=1) at gmalloc.c:1529
...
Adding -fno-builtin-malloc to CFLAGS fixes the issue for me.
--
Markus
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24065
; Package
emacs
.
(Mon, 25 Jul 2016 13:28:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 24065 <at> debbugs.gnu.org (full text, mbox):
Markus Trippelsdorf <markus <at> trippelsdorf.de> wrote:
> On 2016.07.25 at 14:38 +0200, Wolfgang Jenkner wrote:
[...]
> > Author: Wolfgang Jenkner <wjenkner <at> inode.at>
> > Date: Sat Dec 26 12:12:02 2015 -0800
> >
> > Always define gmalloc etc. in src/gmalloc.c
> >
[...]
> > So, it would be useful to know on which system compilation fails.
>
> This happens on a Gentoo system (glibc trunk, gcc-6 latest branch):
>
> (gdb) run
> Starting program: /var/tmp/portage/app-editors/emacs-24.5-r3/work/emacs-24.5/src/temacs --batch --load loadup bootstrap
According to ftp://alpha.gnu.org/gnu/emacs/pretest/ your emacs
version has been made available in April 2015 and so predates
the fix from December 2015 above. Also, your version belongs to
an older (and effectively unmaintained) release series.
tl; dr: Please update to a current release candidate.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24065
; Package
emacs
.
(Mon, 25 Jul 2016 14:25:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 24065 <at> debbugs.gnu.org (full text, mbox):
On 2016.07.25 at 15:27 +0200, Wolfgang Jenkner wrote:
> Markus Trippelsdorf <markus <at> trippelsdorf.de> wrote:
>
> > On 2016.07.25 at 14:38 +0200, Wolfgang Jenkner wrote:
> [...]
> > > Author: Wolfgang Jenkner <wjenkner <at> inode.at>
> > > Date: Sat Dec 26 12:12:02 2015 -0800
> > >
> > > Always define gmalloc etc. in src/gmalloc.c
> > >
> [...]
> > > So, it would be useful to know on which system compilation fails.
> >
> > This happens on a Gentoo system (glibc trunk, gcc-6 latest branch):
> >
> > (gdb) run
> > Starting program: /var/tmp/portage/app-editors/emacs-24.5-r3/work/emacs-24.5/src/temacs --batch --load loadup bootstrap
>
> According to ftp://alpha.gnu.org/gnu/emacs/pretest/ your emacs
> version has been made available in April 2015 and so predates
> the fix from December 2015 above. Also, your version belongs to
> an older (and effectively unmaintained) release series.
>
> tl; dr: Please update to a current release candidate.
Ok. Sorry for pointing to the wrong commit.
But version 24.5 is the latest stable release.
It is sad, that it cannot be compiled with gcc-5 or gcc-6.
--
Markus
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24065
; Package
emacs
.
(Mon, 25 Jul 2016 15:49:01 GMT)
Full text and
rfc822 format available.
Message #20 received at 24065 <at> debbugs.gnu.org (full text, mbox):
Markus Trippelsdorf <markus <at> trippelsdorf.de> wrote:
> > > This happens on a Gentoo system (glibc trunk, gcc-6 latest branch):
> But version 24.5 is the latest stable release.
> It is sad, that it cannot be compiled with gcc-5 or gcc-6.
Actually, on GNU/Linux src/gmalloc.c (which contains the code in
question) is not even compiled, normally.
The reason for your compilation troubles seems to be that you use
a recent git checkout of glibc (as you stated above) which I guess
already contains
http://repo.or.cz/glibc.git/commitdiff/2ba3cfa1607c36613f3b30fb1ae4ec530245ce64
IIUC, this commit removes the declaration of __malloc_initialize_hook,
so the emacs configure check for "whether malloc is Doug Lea style"
will fail.
And this is the reason why you suddenly need malloc etc. from
src/gmalloc.c.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24065
; Package
emacs
.
(Mon, 25 Jul 2016 15:59:01 GMT)
Full text and
rfc822 format available.
Message #23 received at 24065 <at> debbugs.gnu.org (full text, mbox):
On 2016.07.25 at 17:48 +0200, Wolfgang Jenkner wrote:
> Markus Trippelsdorf <markus <at> trippelsdorf.de> wrote:
>
> > > > This happens on a Gentoo system (glibc trunk, gcc-6 latest branch):
>
> > But version 24.5 is the latest stable release.
> > It is sad, that it cannot be compiled with gcc-5 or gcc-6.
>
> Actually, on GNU/Linux src/gmalloc.c (which contains the code in
> question) is not even compiled, normally.
>
> The reason for your compilation troubles seems to be that you use
> a recent git checkout of glibc (as you stated above) which I guess
> already contains
>
> http://repo.or.cz/glibc.git/commitdiff/2ba3cfa1607c36613f3b30fb1ae4ec530245ce64
>
> IIUC, this commit removes the declaration of __malloc_initialize_hook,
> so the emacs configure check for "whether malloc is Doug Lea style"
> will fail.
>
> And this is the reason why you suddenly need malloc etc. from
> src/gmalloc.c.
Thanks for finding the root cause.
I can confirm that my glibc versions contains the commit in question.
--
Markus
Reply sent
to
Paul Eggert <eggert <at> cs.ucla.edu>
:
You have taken responsibility.
(Tue, 26 Jul 2016 07:09:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
Markus Trippelsdorf <markus <at> trippelsdorf.de>
:
bug acknowledged by developer.
(Tue, 26 Jul 2016 07:09:01 GMT)
Full text and
rfc822 format available.
Message #28 received at 24065-done <at> debbugs.gnu.org (full text, mbox):
On 07/25/2016 05:48 PM, Wolfgang Jenkner wrote:
> IIUC, this commit removes the declaration of __malloc_initialize_hook,
> so the emacs configure check for "whether malloc is Doug Lea style"
> will fail.
This problem should be fixed on Emacs master and emacs-25, as well as in
the current release candidate for Emacs 25
<ftp://alpha.gnu.org/gnu/emacs/pretest/emacs-25.1-rc1.tar.xz>. If you're
still observing the problem in any of these editions of Emacs, please
let us know. In the meantime I will close the bug report as I think this
bug is fixed now.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Tue, 23 Aug 2016 11:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 8 years and 295 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.