From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#22065: core dumped during compilation (emacs-25 branch on FreeBSD 9) Date: Sun, 14 Feb 2016 11:47:57 -0800 Organization: UCLA Computer Science Department Message-ID: <56C0D9ED.3030002@cs.ucla.edu> References: <867fkz16lw.fsf@phe.ftfl.ca> <85si0vjkos.fsf@iznogoud.viz> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------010207020600040400070300" X-Trace: ger.gmane.org 1455479364 20562 80.91.229.3 (14 Feb 2016 19:49:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 14 Feb 2016 19:49:24 +0000 (UTC) Cc: ashish@FreeBSD.org, 22065@debbugs.gnu.org, Dmitry Antipov To: Wolfgang Jenkner , Joseph Mingrone Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Feb 14 20:49:13 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 1aV2fO-00069K-8s for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Feb 2016 20:49:10 +0100 Original-Received: from localhost ([::1]:53253 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aV2fN-0002WP-Ea for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Feb 2016 14:49:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60138) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aV2fJ-0002W4-S0 for bug-gnu-emacs@gnu.org; Sun, 14 Feb 2016 14:49:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aV2fG-0007lJ-N8 for bug-gnu-emacs@gnu.org; Sun, 14 Feb 2016 14:49:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48308) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aV2fG-0007lF-Iw for bug-gnu-emacs@gnu.org; Sun, 14 Feb 2016 14:49:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aV2fG-0007xI-BX for bug-gnu-emacs@gnu.org; Sun, 14 Feb 2016 14:49:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Feb 2016 19:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22065 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22065-submit@debbugs.gnu.org id=B22065.145547928930521 (code B ref 22065); Sun, 14 Feb 2016 19:49:02 +0000 Original-Received: (at 22065) by debbugs.gnu.org; 14 Feb 2016 19:48:09 +0000 Original-Received: from localhost ([127.0.0.1]:39083 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aV2eP-0007wD-5o for submit@debbugs.gnu.org; Sun, 14 Feb 2016 14:48:09 -0500 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:55086) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aV2eO-0007w0-1r for 22065@debbugs.gnu.org; Sun, 14 Feb 2016 14:48:08 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id D83D3160FC1; Sun, 14 Feb 2016 11:47:58 -0800 (PST) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id IVwTJdyt5Fg2; Sun, 14 Feb 2016 11:47:58 -0800 (PST) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 26682160FD0; Sun, 14 Feb 2016 11:47:58 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id xESEdr3UQqGS; Sun, 14 Feb 2016 11:47:58 -0800 (PST) Original-Received: from [192.168.1.9] (pool-100-32-155-148.lsanca.fios.verizon.net [100.32.155.148]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id F0EBB160FC1; Sun, 14 Feb 2016 11:47:57 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 In-Reply-To: <85si0vjkos.fsf@iznogoud.viz> 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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:113035 Archived-At: This is a multi-part message in MIME format. --------------010207020600040400070300 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Wolfgang Jenkner wrote: > So, perhaps, the FreeBSD 9 default base cc (a patched gcc 4.2.1) has > some stack-related optimization bug, even on amd64? Thanks for the detective work. It inspired me to search GCC bug reports, where I found a couple that appear to be directly relevant. The corresponding bug was fixed in 2008 but GCC 4.2.1 predates the fix. I installed the attached patch into the emacs-25 branch, and I hope it works around the compiler bug with stack-allocated Lisp objects on FreeBSD 9. Please give it a try. --------------010207020600040400070300 Content-Type: text/x-diff; name="emacs.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="emacs.diff" diff --git a/src/lisp.h b/src/lisp.h index af73c4b..8eab38b 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -4522,6 +4522,12 @@ extern void *record_xmalloc (size_t) ATTRIBUTE_ALLOC_SIZE ((1)); This feature is experimental and requires careful debugging. Build with CPPFLAGS='-DUSE_STACK_LISP_OBJECTS=0' to disable it. */ +#if (!defined USE_STACK_LISP_OBJECTS \ + && defined __GNUC__ && !defined __clang__ \ + && !(4 < __GNUC__ + (3 < __GNUC_MINOR__ + (2 <= __GNUC_PATCHLEVEL__)))) + /* Work around GCC bugs 36584 and 35271, which were fixed in GCC 4.3.2. */ +# define USE_STACK_LISP_OBJECTS false +#endif #ifndef USE_STACK_LISP_OBJECTS # define USE_STACK_LISP_OBJECTS true #endif --------------010207020600040400070300--