public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/33355]  New: GCC has an invalid pointer.
@ 2007-09-08 13:56 shw_mail at wp dot pl
  2007-09-08 14:45 ` [Bug c++/33355] " rguenth at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: shw_mail at wp dot pl @ 2007-09-08 13:56 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 4700 bytes --]

Dears

I would like to send a bug which was explicit by compiling the code:

        BOOST_STATIC_ASSERT (
            typeid (::connection::SPLight).name()
            == typeid(::connection::LightsStructure::value_type).name()
        );

This line is wrong, but it causes that gcc is going out of compilation process
due to internal errors (see backtrace below).

Regards.

CC optimal_gls.cpp
optimal_gls.cpp: In function ‘std::ostream&
connection::operator<<(std::ostream&, const connection::LightsStructure&)’:
optimal_gls.cpp:370: error: `typeid' operator cannot appear in a
constant-expression
optimal_gls.cpp:388: error: template argument 1 is invalid
*** glibc detected *** /usr/libexec/gcc/i686-pc-linux-gnu/4.1.2/cc1plus:
free(): invalid pointer: 0x084aaef4 ***
======= Backtrace: =========
/lib/libc.so.6[0x400b06d0]
/lib/libc.so.6(__libc_free+0x89)[0x400b1d59]
/usr/libexec/gcc/i686-pc-linux-gnu/4.1.2/cc1plus[0x809980f]
/usr/libexec/gcc/i686-pc-linux-gnu/4.1.2/cc1plus[0x8098f4c]
/usr/libexec/gcc/i686-pc-linux-gnu/4.1.2/cc1plus[0x8097432]
/usr/libexec/gcc/i686-pc-linux-gnu/4.1.2/cc1plus[0x80978a4]
/usr/libexec/gcc/i686-pc-linux-gnu/4.1.2/cc1plus[0x809d25e]
/usr/libexec/gcc/i686-pc-linux-gnu/4.1.2/cc1plus[0x809d751]
/usr/libexec/gcc/i686-pc-linux-gnu/4.1.2/cc1plus[0x809db0a]
/usr/libexec/gcc/i686-pc-linux-gnu/4.1.2/cc1plus[0x809dfcb]
/usr/libexec/gcc/i686-pc-linux-gnu/4.1.2/cc1plus[0x8099958]
/usr/libexec/gcc/i686-pc-linux-gnu/4.1.2/cc1plus[0x8099c70]
/usr/libexec/gcc/i686-pc-linux-gnu/4.1.2/cc1plus[0x809aef1]
/usr/libexec/gcc/i686-pc-linux-gnu/4.1.2/cc1plus[0x80a067e]
/usr/libexec/gcc/i686-pc-linux-gnu/4.1.2/cc1plus[0x80a08f4]
/usr/libexec/gcc/i686-pc-linux-gnu/4.1.2/cc1plus[0x80a0edb]
/usr/libexec/gcc/i686-pc-linux-gnu/4.1.2/cc1plus[0x80a184d]
/usr/libexec/gcc/i686-pc-linux-gnu/4.1.2/cc1plus[0x80a18ff]
/usr/libexec/gcc/i686-pc-linux-gnu/4.1.2/cc1plus[0x80a1aa9]
/usr/libexec/gcc/i686-pc-linux-gnu/4.1.2/cc1plus[0x80a1e30]
/usr/libexec/gcc/i686-pc-linux-gnu/4.1.2/cc1plus[0x80a23aa]
/usr/libexec/gcc/i686-pc-linux-gnu/4.1.2/cc1plus[0x80a06f4]
/usr/libexec/gcc/i686-pc-linux-gnu/4.1.2/cc1plus[0x80a08f4]
/usr/libexec/gcc/i686-pc-linux-gnu/4.1.2/cc1plus[0x80a355e]
/usr/libexec/gcc/i686-pc-linux-gnu/4.1.2/cc1plus[0x80a39f9]
/usr/libexec/gcc/i686-pc-linux-gnu/4.1.2/cc1plus[0x80a3647]
/usr/libexec/gcc/i686-pc-linux-gnu/4.1.2/cc1plus[0x80a39f9]
/usr/libexec/gcc/i686-pc-linux-gnu/4.1.2/cc1plus[0x80a3fe5]
/usr/libexec/gcc/i686-pc-linux-gnu/4.1.2/cc1plus[0x8108a7a]
/usr/libexec/gcc/i686-pc-linux-gnu/4.1.2/cc1plus[0x8389c9c]
/usr/libexec/gcc/i686-pc-linux-gnu/4.1.2/cc1plus[0x8112092]
/lib/libc.so.6(__libc_start_main+0xd8)[0x40062838]
/usr/libexec/gcc/i686-pc-linux-gnu/4.1.2/cc1plus[0x8049d11]
======= Memory map: ========
08048000-08549000 r-xp 00000000 08:03 22296326  
/usr/libexec/gcc/i686-pc-linux-gnu/4.1.2/cc1plus
08549000-0854e000 rw-p 00500000 08:03 22296326  
/usr/libexec/gcc/i686-pc-linux-gnu/4.1.2/cc1plus
0854e000-08688000 rw-p 0854e000 00:00 0          [heap]
40000000-4001a000 r-xp 00000000 08:03 26409389   /lib/ld-2.5.so
4001a000-4001b000 r--p 00019000 08:03 26409389   /lib/ld-2.5.so
4001b000-4001c000 rw-p 0001a000 08:03 26409389   /lib/ld-2.5.so
4001c000-40023000 r--s 00000000 08:03 13415888  
/usr/lib/gconv/gconv-modules.cache
40023000-40024000 r--p 00000000 08:03 44117520  
/usr/lib/locale/pl_PL.utf8/LC_MESSAGES/SYS_LC_MESSAGES
40024000-4004c000 rw-p 40024000 00:00 0 
4004c000-4004d000 rw-p 4004c000 00:00 0 
4004d000-4016f000 r-xp 00000000 08:03 26409409   /lib/libc-2.5.so
4016f000-40170000 r--p 00122000 08:03 26409409   /lib/libc-2.5.so
40170000-40172000 rw-p 00123000 08:03 26409409   /lib/libc-2.5.so
40172000-40176000 rw-p 40172000 00:00 0 
40176000-401b1000 r--p 00000000 08:03 21037921  
/usr/lib/locale/pl_PL.utf8/LC_CTYPE
401b1000-418ad000 rw-p 401b1000 00:00 0 
418dd000-418e7000 r-xp 00000000 08:03 44228654  
/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libgcc_s.so.1
418e7000-418e8000 rw-p 00009000 08:03 44228654  
/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libgcc_s.so.1
41900000-41921000 rw-p 41900000 00:00 0 
41921000-41a00000 ---p 41921000 00:00 0 
bffe8000-bfffe000 rw-p bffe8000 00:00 0          [stack]
ffffe000-fffff000 ---p 00000000 00:00 0          [vdso]
optimal_gls.cpp:370: confused by earlier errors, bailing out
make[1]: *** [optimal_gls.o] BÅ‚Ä…d 1


-- 
           Summary: GCC has an invalid pointer.
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: shw_mail at wp dot pl


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/33355] GCC has an invalid pointer.
  2007-09-08 13:56 [Bug c++/33355] New: GCC has an invalid pointer shw_mail at wp dot pl
@ 2007-09-08 14:45 ` rguenth at gcc dot gnu dot org
  2007-09-08 15:31 ` shw_mail at wp dot pl
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-09-08 14:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2007-09-08 14:45 -------
Can you please attach preprocessed source for a testcase triggering this?


-- 


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/33355] GCC has an invalid pointer.
  2007-09-08 13:56 [Bug c++/33355] New: GCC has an invalid pointer shw_mail at wp dot pl
  2007-09-08 14:45 ` [Bug c++/33355] " rguenth at gcc dot gnu dot org
@ 2007-09-08 15:31 ` shw_mail at wp dot pl
  2007-09-08 17:24 ` rguenth at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: shw_mail at wp dot pl @ 2007-09-08 15:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from shw_mail at wp dot pl  2007-09-08 15:31 -------
(In reply to comment #1)
> Can you please attach preprocessed source for a testcase triggering this?
> 

Below is separated FULL example :-).

// test_case.cpp
#include <boost/static_assert.hpp>
#include <typeinfo>

struct MyType1{};
typedef Mytype1 MyType2;

int main ()
{
    BOOST_STATIC_ASSERT (
        typeid (Mytype1).name()
        == typeid(MyType2).name()
    );
}

$ g++ test_case.cpp 

causes internal error.

The macro is expanded to:

typedef ::boost::static_assert_test< sizeof(::boost::STATIC_ASSERTION_FAILURE<
(bool)( typeid (Mytype1).name() == typeid(MyType2).name() ) >)>
boost_static_assert_typedef_12;

Regards.


-- 


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/33355] GCC has an invalid pointer.
  2007-09-08 13:56 [Bug c++/33355] New: GCC has an invalid pointer shw_mail at wp dot pl
  2007-09-08 14:45 ` [Bug c++/33355] " rguenth at gcc dot gnu dot org
  2007-09-08 15:31 ` shw_mail at wp dot pl
@ 2007-09-08 17:24 ` rguenth at gcc dot gnu dot org
  2007-09-08 19:05 ` shw_mail at wp dot pl
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-09-08 17:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rguenth at gcc dot gnu dot org  2007-09-08 17:23 -------
Can you attach the *.ii file that is generated if you compile this with
-save-temps added to the command line?

Thanks.


-- 


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/33355] GCC has an invalid pointer.
  2007-09-08 13:56 [Bug c++/33355] New: GCC has an invalid pointer shw_mail at wp dot pl
                   ` (2 preceding siblings ...)
  2007-09-08 17:24 ` rguenth at gcc dot gnu dot org
@ 2007-09-08 19:05 ` shw_mail at wp dot pl
  2007-09-08 19:06 ` shw_mail at wp dot pl
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: shw_mail at wp dot pl @ 2007-09-08 19:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from shw_mail at wp dot pl  2007-09-08 19:04 -------
Created an attachment (id=14175)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14175&action=view)
-save-temp from the code.

This is an .ii file contains preprocessed code.


-- 


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/33355] GCC has an invalid pointer.
  2007-09-08 13:56 [Bug c++/33355] New: GCC has an invalid pointer shw_mail at wp dot pl
                   ` (3 preceding siblings ...)
  2007-09-08 19:05 ` shw_mail at wp dot pl
@ 2007-09-08 19:06 ` shw_mail at wp dot pl
  2007-12-26 20:05 ` [Bug c++/33355] [4.1 regression] ICE with typeid in template parameter reichelt at gcc dot gnu dot org
  2008-07-04 16:13 ` jsm28 at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: shw_mail at wp dot pl @ 2007-09-08 19:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from shw_mail at wp dot pl  2007-09-08 19:05 -------
Created an attachment (id=14176)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14176&action=view)
The program which causes error.

Source code of the program.


-- 


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/33355] [4.1 regression] ICE with typeid in template parameter
  2007-09-08 13:56 [Bug c++/33355] New: GCC has an invalid pointer shw_mail at wp dot pl
                   ` (4 preceding siblings ...)
  2007-09-08 19:06 ` shw_mail at wp dot pl
@ 2007-12-26 20:05 ` reichelt at gcc dot gnu dot org
  2008-07-04 16:13 ` jsm28 at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2007-12-26 20:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from reichelt at gcc dot gnu dot org  2007-12-26 20:05 -------
Confirmed. Here's a reduced testcase:

===================================
template<typename> struct A {};

int i = sizeof A<typeid>;
===================================

The bug appeared in GCC 3.4.1 and is already fixed in GCC 4.2.0.


-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |reichelt at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |ice-on-invalid-code
   Last reconfirmed|0000-00-00 00:00:00         |2007-12-26 20:05:02
               date|                            |
            Summary|GCC has an invalid pointer. |[4.1 regression] ICE with
                   |                            |typeid in template parameter
   Target Milestone|---                         |4.1.3


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/33355] [4.1 regression] ICE with typeid in template parameter
  2007-09-08 13:56 [Bug c++/33355] New: GCC has an invalid pointer shw_mail at wp dot pl
                   ` (5 preceding siblings ...)
  2007-12-26 20:05 ` [Bug c++/33355] [4.1 regression] ICE with typeid in template parameter reichelt at gcc dot gnu dot org
@ 2008-07-04 16:13 ` jsm28 at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-07-04 16:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jsm28 at gcc dot gnu dot org  2008-07-04 16:12 -------
Closing 4.1 branch.


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
      Known to fail|                            |4.1.3
      Known to work|                            |4.2.0
         Resolution|                            |FIXED
   Target Milestone|4.1.3                       |4.2.0


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-07-04 16:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-08 13:56 [Bug c++/33355] New: GCC has an invalid pointer shw_mail at wp dot pl
2007-09-08 14:45 ` [Bug c++/33355] " rguenth at gcc dot gnu dot org
2007-09-08 15:31 ` shw_mail at wp dot pl
2007-09-08 17:24 ` rguenth at gcc dot gnu dot org
2007-09-08 19:05 ` shw_mail at wp dot pl
2007-09-08 19:06 ` shw_mail at wp dot pl
2007-12-26 20:05 ` [Bug c++/33355] [4.1 regression] ICE with typeid in template parameter reichelt at gcc dot gnu dot org
2008-07-04 16:13 ` jsm28 at gcc dot gnu dot org

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).