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++/52263] New: Zero-initialization doesn't seem to work correctly for virtual inheritance


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

             Bug #: 52263
           Summary: Zero-initialization doesn't seem to work correctly for
                    virtual inheritance
    Classification: Unclassified
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: ryan_at_work_also@hotmail.com


Created attachment 26666
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26666
error testcase

Using:

g++ (GCC) 4.6.1 20110908 (Red Hat 4.6.1-9)
Copyright (C) 2011 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.

The following code will abort due to the failed check on deconstruction at exit
(damaged memory). Uncomment the constructor of "Derived" and things work fine. 

The larger workspace I found this in actually had data being zeroed for other
objects in memory (from a "rep stos" instruction). It looked like the
initialization of the "Base" object occurred followed by a zero-initialization
of that same object (which had already been created) occurred, BUT at the wrong
memory address in my case (over memory used by other objects in my
application).

The output from compilation:

g++ -Wall -Wextra  -o gcc_fail  gcc_fail.cxx
cc_fail.cxx:53:2: warning: #warning "When uncommented, everything works fine -
when commented, abort occurs" [-Wcpp]
gcc_fail.cxx:66:1: warning: unused parameter âargcâ [-Wunused-parameter]
gcc_fail.cxx:66:1: warning: unused parameter âargvâ [-Wunused-parameter]


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