This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/60516] New: cc1plus crashes compiling a method with a huge struct as argument


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]