public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/50618] New: Virtual inheritance segfault
@ 2011-10-04 20:11 tomboshoven at gmail dot com
  2011-10-04 20:46 ` [Bug c++/50618] [4.4/4.5/4.6/4.7 Regression] " pinskia at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: tomboshoven at gmail dot com @ 2011-10-04 20:11 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 50618
           Summary: Virtual inheritance segfault
    Classification: Unclassified
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: tomboshoven@gmail.com


Created attachment 25417
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25417
A small program using multiple inheritance, segfaults when run.

Affected GCC Versions:
4.6.1 20110819 (prerelease)   (Arch Linux package)
4.5.3    (Compiled using Arch defaults, --march=core2)
Both x64.

GCC 4.2 does not seem to be affected.


The attached source code, when compiled without any additional flags, segfaults
when executed.
The segfault occurs within the ostream.

I tried to further minimize the code, but all components of this code seem to
be required.


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

* [Bug c++/50618] [4.4/4.5/4.6/4.7 Regression] Virtual inheritance segfault
  2011-10-04 20:11 [Bug c++/50618] New: Virtual inheritance segfault tomboshoven at gmail dot com
@ 2011-10-04 20:46 ` pinskia at gcc dot gnu.org
  2011-10-10 15:26 ` rguenth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-10-04 20:46 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
      Known to work|                            |4.3.5
           Keywords|                            |wrong-code
   Last reconfirmed|                            |2011-10-04
     Ever Confirmed|0                           |1
            Summary|Virtual inheritance         |[4.4/4.5/4.6/4.7
                   |segfault                    |Regression] Virtual
                   |                            |inheritance segfault
   Target Milestone|---                         |4.4.7
      Known to fail|                            |4.4.1, 4.5.1, 4.6.1, 4.7.0

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-10-04 20:45:50 UTC ---
Here is a simplier testcase:
struct Base
{
    const int text;
    Base():text(1) {}
    Base(int aText)
    : text(aText) {}
};
struct SubA : public virtual Base
{
protected:
  int x;
public:
  SubA(int aX)
  : x(aX) {}
};
class SubB : public virtual Base
{};
struct Diamond : public SubA, public SubB
{
    Diamond(int text)
    : Base(text), SubA(5), SubB() {}

    void printText()
    {
        if(text != 2)
          __builtin_abort();
        if(x!=5)
          __builtin_abort();
    }
};

int main(int, char**)
{
    Diamond x(2);
    x.printText();
}


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

* [Bug c++/50618] [4.4/4.5/4.6/4.7 Regression] Virtual inheritance segfault
  2011-10-04 20:11 [Bug c++/50618] New: Virtual inheritance segfault tomboshoven at gmail dot com
  2011-10-04 20:46 ` [Bug c++/50618] [4.4/4.5/4.6/4.7 Regression] " pinskia at gcc dot gnu.org
@ 2011-10-10 15:26 ` rguenth at gcc dot gnu.org
  2011-10-11 19:42 ` jason at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-10-10 15:26 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


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

* [Bug c++/50618] [4.4/4.5/4.6/4.7 Regression] Virtual inheritance segfault
  2011-10-04 20:11 [Bug c++/50618] New: Virtual inheritance segfault tomboshoven at gmail dot com
  2011-10-04 20:46 ` [Bug c++/50618] [4.4/4.5/4.6/4.7 Regression] " pinskia at gcc dot gnu.org
  2011-10-10 15:26 ` rguenth at gcc dot gnu.org
@ 2011-10-11 19:42 ` jason at gcc dot gnu.org
  2011-10-13 18:02 ` jason at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2011-10-11 19:42 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |jason at gcc dot gnu.org
                   |gnu.org                     |


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

* [Bug c++/50618] [4.4/4.5/4.6/4.7 Regression] Virtual inheritance segfault
  2011-10-04 20:11 [Bug c++/50618] New: Virtual inheritance segfault tomboshoven at gmail dot com
                   ` (2 preceding siblings ...)
  2011-10-11 19:42 ` jason at gcc dot gnu.org
@ 2011-10-13 18:02 ` jason at gcc dot gnu.org
  2011-10-13 18:02 ` jason at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2011-10-13 18:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> 2011-10-13 18:01:58 UTC ---
Author: jason
Date: Thu Oct 13 18:01:51 2011
New Revision: 179934

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=179934
Log:
    PR c++/50618
    * init.c (expand_aggr_init_1): Don't zero-initialize virtual
    bases of a base subobject.

Added:
    trunk/gcc/testsuite/g++.dg/init/vbase1.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/init.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/50618] [4.4/4.5/4.6/4.7 Regression] Virtual inheritance segfault
  2011-10-04 20:11 [Bug c++/50618] New: Virtual inheritance segfault tomboshoven at gmail dot com
                   ` (3 preceding siblings ...)
  2011-10-13 18:02 ` jason at gcc dot gnu.org
@ 2011-10-13 18:02 ` jason at gcc dot gnu.org
  2011-10-13 18:04 ` jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2011-10-13 18:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> 2011-10-13 18:02:15 UTC ---
Author: jason
Date: Thu Oct 13 18:02:10 2011
New Revision: 179935

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=179935
Log:
    PR c++/50618
    * init.c (expand_aggr_init_1): Don't zero-initialize virtual
    bases of a base subobject.

Added:
    branches/gcc-4_6-branch/gcc/testsuite/g++.dg/init/vbase1.C
Modified:
    branches/gcc-4_6-branch/gcc/cp/ChangeLog
    branches/gcc-4_6-branch/gcc/cp/init.c
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog


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

* [Bug c++/50618] [4.4/4.5/4.6/4.7 Regression] Virtual inheritance segfault
  2011-10-04 20:11 [Bug c++/50618] New: Virtual inheritance segfault tomboshoven at gmail dot com
                   ` (4 preceding siblings ...)
  2011-10-13 18:02 ` jason at gcc dot gnu.org
@ 2011-10-13 18:04 ` jason at gcc dot gnu.org
  2011-10-13 18:09 ` jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2011-10-13 18:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> 2011-10-13 18:03:13 UTC ---
Author: jason
Date: Thu Oct 13 18:03:06 2011
New Revision: 179938

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=179938
Log:
    PR c++/50618
    * init.c (expand_aggr_init_1): Don't zero-initialize virtual
    bases of a base subobject.

Added:
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/init/vbase1.C
Modified:
    branches/gcc-4_4-branch/gcc/cp/ChangeLog
    branches/gcc-4_4-branch/gcc/cp/init.c
    branches/gcc-4_4-branch/gcc/testsuite/ChangeLog


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

* [Bug c++/50618] [4.4/4.5/4.6/4.7 Regression] Virtual inheritance segfault
  2011-10-04 20:11 [Bug c++/50618] New: Virtual inheritance segfault tomboshoven at gmail dot com
                   ` (6 preceding siblings ...)
  2011-10-13 18:09 ` jason at gcc dot gnu.org
@ 2011-10-13 18:09 ` jason at gcc dot gnu.org
  2011-11-29  7:01 ` pinskia at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2011-10-13 18:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> 2011-10-13 18:02:34 UTC ---
Author: jason
Date: Thu Oct 13 18:02:27 2011
New Revision: 179936

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=179936
Log:
    PR c++/50618
    * init.c (expand_aggr_init_1): Don't zero-initialize virtual
    bases of a base subobject.

Added:
    branches/gcc-4_5-branch/gcc/testsuite/g++.dg/init/vbase1.C
Modified:
    branches/gcc-4_5-branch/gcc/cp/ChangeLog
    branches/gcc-4_5-branch/gcc/cp/init.c
    branches/gcc-4_5-branch/gcc/testsuite/ChangeLog


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

* [Bug c++/50618] [4.4/4.5/4.6/4.7 Regression] Virtual inheritance segfault
  2011-10-04 20:11 [Bug c++/50618] New: Virtual inheritance segfault tomboshoven at gmail dot com
                   ` (5 preceding siblings ...)
  2011-10-13 18:04 ` jason at gcc dot gnu.org
@ 2011-10-13 18:09 ` jason at gcc dot gnu.org
  2011-10-13 18:09 ` jason at gcc dot gnu.org
  2011-11-29  7:01 ` pinskia at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2011-10-13 18:09 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> 2011-10-13 18:05:57 UTC ---
Fixed for 4.4.7.


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

* [Bug c++/50618] [4.4/4.5/4.6/4.7 Regression] Virtual inheritance segfault
  2011-10-04 20:11 [Bug c++/50618] New: Virtual inheritance segfault tomboshoven at gmail dot com
                   ` (7 preceding siblings ...)
  2011-10-13 18:09 ` jason at gcc dot gnu.org
@ 2011-11-29  7:01 ` pinskia at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-11-29  7:01 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |zhezherun at yandex dot ru

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-11-29 05:01:12 UTC ---
*** Bug 51331 has been marked as a duplicate of this bug. ***


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

end of thread, other threads:[~2011-11-29  5:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-04 20:11 [Bug c++/50618] New: Virtual inheritance segfault tomboshoven at gmail dot com
2011-10-04 20:46 ` [Bug c++/50618] [4.4/4.5/4.6/4.7 Regression] " pinskia at gcc dot gnu.org
2011-10-10 15:26 ` rguenth at gcc dot gnu.org
2011-10-11 19:42 ` jason at gcc dot gnu.org
2011-10-13 18:02 ` jason at gcc dot gnu.org
2011-10-13 18:02 ` jason at gcc dot gnu.org
2011-10-13 18:04 ` jason at gcc dot gnu.org
2011-10-13 18:09 ` jason at gcc dot gnu.org
2011-10-13 18:09 ` jason at gcc dot gnu.org
2011-11-29  7:01 ` pinskia 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).