public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "edwintorok at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/36524] regression: crash when compiling IdentifierTable.cpp
Date: Fri, 13 Jun 2008 13:38:00 -0000	[thread overview]
Message-ID: <20080613133755.20600.qmail@sourceware.org> (raw)
In-Reply-To: <bug-36524-15165@http.gcc.gnu.org/bugzilla/>



------- Comment #5 from edwintorok at gmail dot com  2008-06-13 13:37 -------
I have built with --enable-checking=yes (instead of all), because all was
taking too long.

It looks like a value of a pointer is invalid.
See the gdb session below.

What should I do next to help debug the problem?

Starting program: /usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.3.1/cc1plus
-E -quiet -v -I/home/edwin/llvm-svn/llvm/include
-I/home/edwin/llvm-svn/llvm/tools/clang/lib/Basic
 -I/home/edwin/llvm-svn/llvm/tools/clang/lib/Basic/../../include -MMD I.d -MF
/home/edwin/llvm-svn/llvm/tools/clang/lib/Basic/Release/IdentifierTable.d.tmp
-MP -MT /home/edwin/ll
vm-svn/llvm/tools/clang/lib/Basic/Release/IdentifierTable.lo -MT
/home/edwin/llvm-svn/llvm/tools/clang/lib/Basic/Release/IdentifierTable.o -MT
/home/edwin/llvm-svn/llvm/tools/cla
ng/lib/Basic/Release/IdentifierTable.d -D_GNU_SOURCE -D_DEBUG -D_GNU_SOURCE
-D__STDC_LIMIT_MACROS IdentifierTable.cpp -o I.ii -mtune=generic
-Woverloaded-virtual -pedantic -Wall
-W -Wwrite-strings -Wno-long-long -Wunused -Wno-unused-parameter -Winvalid-pch
-fomit-frame-pointer -fno-exceptions -fno-rtti -O1
ignoring nonexistent directory
"/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.3.1/../../../../x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/home/edwin/llvm-svn/llvm/include
 /home/edwin/llvm-svn/llvm/tools/clang/lib/Basic
 /home/edwin/llvm-svn/llvm/tools/clang/lib/Basic/../../include

/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.3.1/../../../../include/c++/4.3.1

/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.3.1/../../../../include/c++/4.3.1/x86_64-unknown-linux-gnu

/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.3.1/../../../../include/c++/4.3.1/backward
 /usr/local/include
/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.3.1/include
 /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.3.1/include-fixed
 /usr/include
End of search list.

Program received signal SIGSEGV, Segmentation fault.
0x0000000000c111d3 in new_string_token (pfile=0x2ae4280, text=0x22745f323372
<Address 0x22745f323372 out of bounds>, len=2743223540) at
../../gcc-4.3.1/libcpp/macro.c:100
(gdb) bt
#0  0x0000000000c111d3 in new_string_token (pfile=0x2ae4280,
text=0x22745f323372 <Address 0x22745f323372 out of bounds>, len=2743223540) at
../../gcc-4.3.1/libcpp/macro.c:100
#1  0x0000000000c11cbb in stringify_arg (pfile=0x2ae4280, arg=0x2b439a0) at
../../gcc-4.3.1/libcpp/macro.c:434
#2  0x0000000000c12a61 in replace_args (pfile=0x2ae4280, node=0x7f8657b614a0,
macro=0x7f8657a15140, args=0x2b439a0) at ../../gcc-4.3.1/libcpp/macro.c:921
#3  0x0000000000c12888 in enter_macro_context (pfile=0x2ae4280,
node=0x7f8657b614a0, result=0x2ae4710) at ../../gcc-4.3.1/libcpp/macro.c:850
#4  0x0000000000c133e7 in cpp_get_token (pfile=0x2ae4280) at
../../gcc-4.3.1/libcpp/macro.c:1234
#5  0x00000000005a4a28 in preprocess_file (pfile=0x2ae4280) at
../../gcc-4.3.1/gcc/c-ppoutput.c:148
#6  0x00000000005a08a9 in c_common_init () at ../../gcc-4.3.1/gcc/c-opts.c:1244
#7  0x00000000004bf843 in cxx_init () at ../../gcc-4.3.1/gcc/cp/lex.c:421
#8  0x0000000000807698 in toplev_main (argc=<value optimized out>, argv=<value
optimized out>) at ../../gcc-4.3.1/gcc/toplev.c:2123
#9  0x0000003cbb81e1a6 in __libc_start_main () from /lib/libc.so.6
#10 0x0000000000404269 in _start ()

(gdb) p text
$1 = (unsigned char *) 0x22745f323372 <Address 0x22745f323372 out of bounds>
(gdb) p len
$2 = 2743223540
(gdb) up
(gdb) p dest
$3 = (unsigned char *) 0x2b47866 ""
(gdb) p len
$4 = 18446706190546257140
^^^^^^^^^^^^^^^^ looks like a negative number to me

(gdb) p pfile->u_buff
$5 = (_cpp_buff *) 0x2b47850

432   len = dest - BUFF_FRONT (pfile->u_buff);
433   BUFF_FRONT (pfile->u_buff) = dest + 1;
434   return new_string_token (pfile, dest - len, len);

(gdb) display arg->first[0]
(gdb) b 433
Breakpoint 6 at 0xc11c8a: file ../../gcc-4.3.1/libcpp/macro.c, line 433.
(gdb) cond 6 len>100000
(gdb) r
...
Breakpoint 6, stringify_arg (pfile=0x2a0f280, arg=0x2a6e9a0) at
../../gcc-4.3.1/libcpp/macro.c:433
1: *arg->first[0] = {src_loc = 9522344, type = CPP_NAME, flags = 0 '\0', val =
{node = 0x7f472c117020, source = 0x7f472c117020, str = {len = 739340320, text =
0x2a72512 "\"clang/
Basic/TokenKinds.def\""}, arg_no = 739340320, pragma = 739340320}}
(gdb) p pfile->u_buff->cur
$30 = (unsigned char *) 0x22745f323372 <Address 0x22745f323372 out of bounds>


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36524


  parent reply	other threads:[~2008-06-13 13:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-13 10:39 [Bug tree-optimization/36524] New: " edwintorok at gmail dot com
2008-06-13 11:24 ` [Bug tree-optimization/36524] " rguenth at gcc dot gnu dot org
2008-06-13 11:35 ` edwintorok at gmail dot com
2008-06-13 11:46 ` rguenth at gcc dot gnu dot org
2008-06-13 12:02 ` edwintorok at gmail dot com
2008-06-13 13:38 ` edwintorok at gmail dot com [this message]
2009-03-30  0:22 ` [Bug preprocessor/36524] " jsm28 at gcc dot gnu dot org
2009-11-22 19:26 ` jsm28 at gcc dot gnu dot 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=20080613133755.20600.qmail@sourceware.org \
    --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: link
Be 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).