From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Markus Trippelsdorf Newsgroups: gmane.emacs.bugs Subject: bug#24065: commit 09ece4d341a7 (Restore the calloc family) causes miscompile for gcc-5 and higher Date: Mon, 25 Jul 2016 14:55:49 +0200 Message-ID: <20160725125549.GC315@x4> References: <20160725072232.GA315@x4> <57960850.TeswPyw0Vd9RvMtd%wjenkner@inode.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1469451802 15473 80.91.229.3 (25 Jul 2016 13:03:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 25 Jul 2016 13:03:22 +0000 (UTC) Cc: 24065@debbugs.gnu.org To: Wolfgang Jenkner Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 25 15:03:11 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bRfXJ-0003oS-4O for geb-bug-gnu-emacs@m.gmane.org; Mon, 25 Jul 2016 15:03:09 +0200 Original-Received: from localhost ([::1]:60535 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRfXI-00060q-Gl for geb-bug-gnu-emacs@m.gmane.org; Mon, 25 Jul 2016 09:03:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59706) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRfQW-0000TY-Dd for bug-gnu-emacs@gnu.org; Mon, 25 Jul 2016 08:56:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bRfQQ-0007us-RG for bug-gnu-emacs@gnu.org; Mon, 25 Jul 2016 08:56:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:52271) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRfQQ-0007uk-Dk for bug-gnu-emacs@gnu.org; Mon, 25 Jul 2016 08:56:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bRfQQ-0005kw-69 for bug-gnu-emacs@gnu.org; Mon, 25 Jul 2016 08:56:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Markus Trippelsdorf Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Jul 2016 12:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24065 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24065-submit@debbugs.gnu.org id=B24065.146945135622115 (code B ref 24065); Mon, 25 Jul 2016 12:56:02 +0000 Original-Received: (at 24065) by debbugs.gnu.org; 25 Jul 2016 12:55:56 +0000 Original-Received: from localhost ([127.0.0.1]:36375 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bRfQJ-0005kd-Vf for submit@debbugs.gnu.org; Mon, 25 Jul 2016 08:55:56 -0400 Original-Received: from ud10.udmedia.de ([194.117.254.50]:45248 helo=mail.ud10.udmedia.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bRfQH-0005kT-LZ for 24065@debbugs.gnu.org; Mon, 25 Jul 2016 08:55:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=trippelsdorf.de; h=date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=k1; bh=Fex8et3G19SPi/ELJ4Pd3tQL9Lhq DKM0gwKjHYoR/rM=; b=FW3zX38mZSMRspDm+Fqd5VzRTA85UZjBgN5ShHkQrdsV DRnnkKKxF6fWuvpRps+bOA/R48Gp6+pBPgDR3yhwBD/GThHW/w932R8eUedlcIyx tzp4yG9WvO0mXAqCPQ7qu9Dv8loIPOQUzxUm7aLt6E+Y0ozLz+94KFqCa5eurX4= Original-Received: (qmail 21765 invoked from network); 25 Jul 2016 14:55:49 +0200 Original-Received: from ip5b41f88a.dynamic.kabel-deutschland.de (HELO x4) (ud10?360p3@91.65.248.138) by mail.ud10.udmedia.de with ESMTPSA (ECDHE-RSA-AES256-SHA encrypted, authenticated); 25 Jul 2016 14:55:49 +0200 Content-Disposition: inline In-Reply-To: <57960850.TeswPyw0Vd9RvMtd%wjenkner@inode.at> 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:121514 Archived-At: On 2016.07.25 at 14:38 +0200, Wolfgang Jenkner wrote: > Markus Trippelsdorf wrote: > > > commit 09ece4d341a7e07fab7be22868ebcadae8641c79 > > Author: Wolfgang Jenkner > > 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 > 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=, size=size@entry=1) at gmalloc.c:1529 1529 result = malloc (bytes); (gdb) bt #0 0x00000000005cac25 in calloc (nmemb=, size=size@entry=1) at gmalloc.c:1529 #1 0x00000000005cac2a in calloc (nmemb=, size=size@entry=1) at gmalloc.c:1529 #2 0x00000000005cac2a in calloc (nmemb=, size=size@entry=1) at gmalloc.c:1529 ... Adding -fno-builtin-malloc to CFLAGS fixes the issue for me. -- Markus