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#16492: Emacs won't bootstrap with clang 3.4 on Cygwin Date: Sat, 18 Jan 2014 23:55:52 -0800 Organization: UCLA Computer Science Department Message-ID: <52DB8508.1040605@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1390118229 7498 80.91.229.3 (19 Jan 2014 07:57:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 19 Jan 2014 07:57:09 +0000 (UTC) To: 16492@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jan 19 08:57:17 2014 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 1W4nFt-0005eB-1h for geb-bug-gnu-emacs@m.gmane.org; Sun, 19 Jan 2014 08:57:17 +0100 Original-Received: from localhost ([::1]:45416 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4nFs-00030f-CP for geb-bug-gnu-emacs@m.gmane.org; Sun, 19 Jan 2014 02:57:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60896) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4nFk-0002zR-AV for bug-gnu-emacs@gnu.org; Sun, 19 Jan 2014 02:57:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W4nFf-0005Lp-0D for bug-gnu-emacs@gnu.org; Sun, 19 Jan 2014 02:57:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42557) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4nFe-0005Ll-Si for bug-gnu-emacs@gnu.org; Sun, 19 Jan 2014 02:57:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1W4nFd-0007cN-U6 for bug-gnu-emacs@gnu.org; Sun, 19 Jan 2014 02:57: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, 19 Jan 2014 07:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 16492 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: GNU Emacs bugs Original-Received: via spool by submit@debbugs.gnu.org id=B.139011818529223 (code B ref -1); Sun, 19 Jan 2014 07:57:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Jan 2014 07:56:25 +0000 Original-Received: from localhost ([127.0.0.1]:56576 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W4nF1-0007bD-GL for submit@debbugs.gnu.org; Sun, 19 Jan 2014 02:56:24 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:59111) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W4nEv-0007b1-Q9 for submit@debbugs.gnu.org; Sun, 19 Jan 2014 02:56:18 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W4nEq-0005Gw-42 for submit@debbugs.gnu.org; Sun, 19 Jan 2014 02:56:17 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:37945) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4nEq-0005Gs-19 for submit@debbugs.gnu.org; Sun, 19 Jan 2014 02:56:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60833) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4nEk-0002x3-Uk for bug-gnu-emacs@gnu.org; Sun, 19 Jan 2014 02:56:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W4nEf-0005Bc-VA for bug-gnu-emacs@gnu.org; Sun, 19 Jan 2014 02:56:06 -0500 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:53699) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4nEf-0004x9-Ke for bug-gnu-emacs@gnu.org; Sun, 19 Jan 2014 02:56:01 -0500 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 7B984A60006 for ; Sat, 18 Jan 2014 23:55:54 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id INfLzv8zB3Iz for ; Sat, 18 Jan 2014 23:55:53 -0800 (PST) Original-Received: from [192.168.1.9] (pool-108-0-233-62.lsanca.fios.verizon.net [108.0.233.62]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 7322339E8011 for ; Sat, 18 Jan 2014 23:55:53 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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:83710 Archived-At: [This bug was originally reported by mirek.kaim in http://lists.gnu.org/archive/html/emacs-devel/2014-01/msg01702.html and I'm taking the liberty of copying its contents below.] editfns.c gets miscompiled at -O > 0, causing emacs to crash. backtrace: (gdb) run Starting program: /y/build/emacs/src/temacs --batch --load loadup bootstrap [New Thread 3728.0x10dc] [New Thread 3728.0x10c0] Loading loadup.el (source)... Using load-path (/y/emacs/lisp /y/emacs/lisp/emacs-lisp /y/emacs/lisp/language /y/emacs/lisp/international /y/emacs/lisp/textmodes /y/emacs/lisp/vc) [New Thread 3728.0xdd4] Loading emacs-lisp/byte-run (source)... Loading emacs-lisp/backquote (source)... Loading subr (source)... Loading version (source)... Program received signal SIGSEGV, Segmentation fault. strftime_case_ (upcase=false, s=0x228f00 "\001\212\210", maxsize=, format=0x0, tp=0xa, ut=, ns=) at ../../../emacs/lib/strftime.c:507 507 for (f = format; *f != '\0'; ++f) (gdb) backtrace #0 strftime_case_ (upcase=false, s=0x228f00 "\001\212\210", maxsize=, format=0x0, tp=0xa, ut=, ns=) at ../../../emacs/lib/strftime.c:507 #1 0x005a80c2 in nstrftime (s=0x228f00 "\001\212\210", maxsize=0, format=0x0, tp=0x61256e80 , ut=1, ns=484375000) at ../../../emacs/lib/strftime.c:1449 #2 0x00513ef0 in format_time_string (format=0x0, formatlen=0, t=..., ut=, tmp=) at ../../../emacs/src/editfns.c:1672 #3 0x00513d44 in Fformat_time_string (format_string=, timeval=2268888, universal=) at ../../../emacs/src/editfns.c:1756 #4 0x0051d61c in eval_sub (form=) at ../../../emacs/src/eval.c:2182 #5 0x0051d429 in eval_sub (form=) at ../../../emacs/src/eval.c:2140 #6 0x0051e6e1 in Flet (args=) at ../../../emacs/src/eval.c:937 #7 0x0051d397 in eval_sub (form=) at ../../../emacs/src/eval.c:2124 #8 0x0052175b in funcall_lambda (fun=, nargs=, arg_vector=) at ../../../emacs/src/eval.c:459 #9 0x00520346 in apply_lambda (fun=9104334, args=) at ../../../emacs/src/eval.c:2915 ---Type to continue, or q to quit--- #10 0x0051d53d in eval_sub (form=) at ../../../emacs/src/eval.c:2221 #11 0x0052030b in apply_lambda (fun=9361006, args=) at ../../../emacs/src/eval.c:2906 #12 0x0051d53d in eval_sub (form=) at ../../../emacs/src/eval.c:2221 #13 0x0051d429 in eval_sub (form=) at ../../../emacs/src/eval.c:2140 #14 0x0051d4d9 in eval_sub (form=) at ../../../emacs/src/eval.c:2161 #15 0x0053e568 in readevalloop (readcharfun=8496874, stream=0x864080 , sourcename=, printflag=, unibyte=, readfun=8130560, start=, end=) at ../../../emacs/src/lread.c:1934 #16 0x0053d3f4 in Fload (file=, noerror=, nomessage=, nosuffix=, must_suffix=) at ../../../emacs/src/lread.c:1370 #17 0x0051d675 in eval_sub (form=) at ../../../emacs/src/eval.c:2190 #18 0x0053e568 in readevalloop (readcharfun=8496874, stream=0x864010 , sourcename=, printflag=, unibyte=, readfun=8130560, ---Type to continue, or q to quit--- start=, end=) at ../../../emacs/src/lread.c:1934 #19 0x0053d3f4 in Fload (file=, noerror=, nomessage=, nosuffix=, must_suffix=) at ../../../emacs/src/lread.c:1370 #20 0x0051d675 in eval_sub (form=) at ../../../emacs/src/eval.c:2190 #21 0x005200d7 in Feval (form=8430502, lexical=) at ../../../emacs/src/eval.c:1994 #22 0x004bd1bd in top_level_2 () at ../../../emacs/src/keyboard.c:1179 #23 0x0051f4af in internal_condition_case (bfun=0x77e170 , handlers=, hfun=) at ../../../emacs/src/eval.c:1345 #24 0x004bd183 in top_level_1 (ignore=8450074) at ../../../emacs/src/keyboard.c:1187 #25 0x0051ee24 in internal_catch (tag=, func=0x0, arg=7856496) at ../../../emacs/src/eval.c:1109 #26 0x004ac41a in recursive_edit_1 () at ../../../emacs/src/keyboard.c:1148 #27 0x004ac5d5 in Frecursive_edit () at ../../../emacs/src/keyboard.c:841 #28 0x004ab10a in main ( argc=, argv=) at ../../../emacs/src/emacs.c:1637 (gdb) exact steps to reproduce: http://aurora.irc.arloria.net/~unic0rn/emacs_clang_optimization_bug.html my workaround is kinda silly, but at least it works. i've tried to modify editfns.c to trick llvm's optimizers into generating something that will work, to no avail. it seems like the first param doesn't end up on the stack somehow. since llvm/clang 3.4 is a current release version, i guess it'll land on osx and freebsd sooner than later, and if they won't fix that until then - well, it may cause some problems. unfortunately, i can't test it with higher -march settings, because my cpu doesn't even support SSE2. i've filled a bug for llvm, but i'm not sure how far it'll go: http://llvm.org/bugs/show_bug.cgi?id=18537