public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60516] New: cc1plus crashes compiling a method with a huge struct as argument
@ 2014-03-13 15:05 zaskar_84 at yahoo dot com.ar
  2014-03-16 20:37 ` [Bug c++/60516] [4.9/4.8 regression]: " ktietz at gcc dot gnu.org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: zaskar_84 at yahoo dot com.ar @ 2014-03-13 15:05 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60516
           Summary: cc1plus crashes compiling a method with a huge struct
                    as argument
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zaskar_84 at yahoo dot com.ar

cc1plus crashes when trying to compile a class method that receives a very big
argument (a 65kb struct) in Windows (reproducible with mingw32, no problems on
linux versions). I know that we are not supposed to make so big static
variables, but the compiler should compile and let the resulting program crash
or complaint about that instead of crashing itself. Here's the minimal code
that generates the error:

    struct huge {
        char c[256][256]; 
    };
    class Bar {
        void foo(huge x);
    };
    void Bar::foo (huge x) {
    }

I've noted that there's no problem if the method is implemented inline.

And here are versions and compiler output

    C:\Users\usuario\Desktop>g++ --version
    g++ (GCC) 4.8.1
    Copyright (C) 2013 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    C:\Users\usuario\Desktop>ld -v
    GNU ld (GNU Binutils) 2.24

    C:\Users\usuario\Desktop>g++ -c problema_mingw.cpp
    problema_mingw.cpp: In member function 'void
GestionMaquina::AgregarMaquina(Maquinas)':
    problema_mingw.cpp:11:1: internal compiler error: Segmentation fault
     }
     ^

    This application has requested the Runtime to terminate it in an unusual
way.
    Please contact the application's support team for more information.

    problema_mingw.cpp:11:1: internal compiler error: Aborted

    This application has requested the Runtime to terminate it in an unusual
way.
    Please contact the application's support team for more information.
    g++: internal compiler error: Aborted (program cc1plus)
    libbacktrace could not find executable to open
    Please submit a full bug report,
    with preprocessed source if appropriate.
    See <http://gcc.gnu.org/bugs.html> for instructions.

Tested on win7 ultimate 64bits, g++ was mannually installed, just by
decompressing the following packages from mingw32:
binutils-2.24-1-mingw32-bin.tar.xz expat-2.1.0-1-mingw32-dll.tar
gcc-c++-4.8.1-4-mingw32-bin.tar gcc-c++-4.8.1-4-mingw32-dll.tar
gcc-core-4.8.1-4-mingw32-bin.tar gcc-core-4.8.1-4-mingw32-dll.tar
gdb-7.6.1-1-mingw32-bin.tar gmp-5.1.2-1-mingw32-dll.tar
libiconv-1.14-3-mingw32-dll.tar mingwrt-4.0.3-1-mingw32-dev.tar
mingwrt-4.0.3-1-mingw32-dll.tar mpc-1.0.1-2-mingw32-dll.tar
mpfr-3.1.2-2-mingw32-dll.tar w32api-4.0.3-1-mingw32-dev.tar

The same problem was reproduce by someone else with 4.8.2, see
http://sourceforge.net/p/mingw/bugs/2195/


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

end of thread, other threads:[~2014-06-12 13:38 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-13 15:05 [Bug c++/60516] New: cc1plus crashes compiling a method with a huge struct as argument zaskar_84 at yahoo dot com.ar
2014-03-16 20:37 ` [Bug c++/60516] [4.9/4.8 regression]: " ktietz at gcc dot gnu.org
2014-03-16 20:37 ` ktietz at gcc dot gnu.org
2014-03-16 20:51 ` ktietz at gcc dot gnu.org
2014-03-16 22:27 ` mikpelinux at gmail dot com
2014-03-17  6:27 ` [Bug target/60516] [4.7/4.8/4.9 " jakub at gcc dot gnu.org
2014-03-17  6:28 ` jakub at gcc dot gnu.org
2014-03-17  8:24 ` ktietz at gcc dot gnu.org
2014-03-17  9:12 ` jakub at gcc dot gnu.org
2014-03-17 11:23 ` ktietz at gcc dot gnu.org
2014-03-17 19:03 ` jakub at gcc dot gnu.org
2014-03-17 19:04 ` [Bug target/60516] [4.7/4.8 " jakub at gcc dot gnu.org
2014-04-10  7:49 ` jakub at gcc dot gnu.org
2014-04-10  8:04 ` [Bug target/60516] [4.7 " jakub at gcc dot gnu.org
2014-06-12 13:38 ` rguenth at gcc dot gnu.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).