public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "dan.doel at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug preprocessor/60436] New: C preprocessor segfaults on assembly file Date: Thu, 06 Mar 2014 02:05:00 -0000 [thread overview] Message-ID: <bug-60436-4@http.gcc.gnu.org/bugzilla/> (raw) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60436 Bug ID: 60436 Summary: C preprocessor segfaults on assembly file Product: gcc Version: 4.8.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: preprocessor Assignee: unassigned at gcc dot gnu.org Reporter: dan.doel at gmail dot com Greetings, While testing the latest GHC, I came across a segfault in GCC. I've tracked it down to the preprocessor segfaulting on an intermediate assembly file produced during compilation. I've also reproduced the segfault using the stock 4.8.2 release, although I first encountered it on the 2014-02-06 snapshot which is currently distributed on Arch. The assembly file is very large, but I have no smaller test case. I cannot attach it here, because xz -9e only compresses it to ~2MiB. However, you can find it at the Arch bug report I'll link below. Various bits about the reproduction of the segfault are also quite odd: The assembly file contains no macros or includes. A macro must be defined to produce the segfault. The one GHC uses is -DTABLES_NEXT_TO_CODE. One can also get the segfault by putting '#define TABLES_NEXT_TO_CODE' at the top of the file TABLES_NEXT_TO_CODE is meaningless, though. Any macro definition of 13 letters or more triggers the segfault. But 12 or fewer seems to work fine. Adding a blank line anywhere before line 395,848 stops the segfault, but adding blank lines after does nothing. Truncating the file before line 4,400,769 stops the segfault, but truncating after does nothing. Here's the crash output of running `cpp -v -DABCDEFGHIJKLM` on the file: ---- Using built-in specs. COLLECT_GCC=cpp Target: x86_64-unknown-linux-gnu Configured with: ./configure Thread model: posix gcc version 4.8.2 (GCC) COLLECT_GCC_OPTIONS='-E' '-v' '-D' 'ABCDEFGHIJKLM' '-o' 'ghc3240_8.pps' '-mtune=generic' '-march=x86-64' /usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.8.2/cc1 -E -lang-asm -quiet -v -D ABCDEFGHIJKLM ghc3240_8.s -o ghc3240_8.pps -mtune=generic -march=x86-64 -fno-directives-only ignoring nonexistent directory "/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../x86_64-unknown-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/include /usr/local/include /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/include-fixed /usr/include End of search list. ghc3240_8.s:1:0: internal compiler error: Segmentation fault .section .rodata ^ 0x80cdcf crash_signal ../.././gcc/toplev.c:332 0xc4916e get_data_from_adhoc_loc(line_maps*, unsigned int) ../.././libcpp/line-map.c:156 0xc371db expand_location_1 ../.././gcc/input.c:57 0xc3740d expand_location(unsigned int) ../.././gcc/input.c:150 0x578c1d scan_translation_unit ../.././gcc/c-family/c-ppoutput.c:214 0x578c1d preprocess_file(cpp_reader*) ../.././gcc/c-family/c-ppoutput.c:101 0x5774d0 c_common_init() ../.././gcc/c-family/c-opts.c:1026 0x52e59d c_objc_common_init() ../.././gcc/c/c-objc-common.c:63 0x80e7c6 lang_dependent_init ../.././gcc/toplev.c:1688 0x80e7c6 do_compile ../.././gcc/toplev.c:1850 ---- Here is a link to the Arch bug I've filed. You can find the offending file (compressed) there: https://bugs.archlinux.org/task/39180 If any further information is desired, let me know. Thanks.
next reply other threads:[~2014-03-06 2:05 UTC|newest] Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-03-06 2:05 dan.doel at gmail dot com [this message] 2014-03-06 8:30 ` [Bug preprocessor/60436] [4.8/4.9 Regression] " trippels at gcc dot gnu.org 2014-03-06 9:24 ` jakub at gcc dot gnu.org 2014-03-06 10:29 ` trippels at gcc dot gnu.org 2014-03-06 10:40 ` trippels at gcc dot gnu.org 2014-03-06 14:09 ` trippels at gcc dot gnu.org 2014-03-06 14:31 ` trippels at gcc dot gnu.org 2014-03-06 18:09 ` joseph at codesourcery dot com 2014-03-31 9:31 ` rguenth at gcc dot gnu.org 2014-11-24 12:29 ` [Bug preprocessor/60436] [4.8/4.9/5 " jakub at gcc dot gnu.org 2014-11-25 11:17 ` jakub at gcc dot gnu.org 2014-11-28 13:37 ` jakub at gcc dot gnu.org 2014-11-28 17:06 ` jakub at gcc dot gnu.org 2014-11-28 17:11 ` jakub at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-60436-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).