public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60213] New: Weird crash when delete an object
@ 2014-02-15 15:40 hubert.vansteenhuyse at freecode dot be
  2014-02-15 15:45 ` [Bug c++/60213] " hubert.vansteenhuyse at freecode dot be
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: hubert.vansteenhuyse at freecode dot be @ 2014-02-15 15:40 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60213
           Summary: Weird crash when delete an object
           Product: gcc
           Version: 4.6.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hubert.vansteenhuyse at freecode dot be


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

* [Bug c++/60213] Weird crash when delete an object
  2014-02-15 15:40 [Bug c++/60213] New: Weird crash when delete an object hubert.vansteenhuyse at freecode dot be
@ 2014-02-15 15:45 ` hubert.vansteenhuyse at freecode dot be
  2014-02-15 15:57 ` glisse at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: hubert.vansteenhuyse at freecode dot be @ 2014-02-15 15:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from hubert.vansteenhuyse at freecode dot be ---
struct A {
 A *a[2];
 A() { a[0] = 0; a[1] = 0; }
 ~A(){ if(a[0]) delete a[0];  if(a[1]) delete a[1];
}

void main(){
A *a = new A();
a->a[0] = new A();
a->a[1] = new A();

delete a; //<----<< crash, because adress of a == address of a.a[0] :(
}


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

* [Bug c++/60213] Weird crash when delete an object
  2014-02-15 15:40 [Bug c++/60213] New: Weird crash when delete an object hubert.vansteenhuyse at freecode dot be
  2014-02-15 15:45 ` [Bug c++/60213] " hubert.vansteenhuyse at freecode dot be
@ 2014-02-15 15:57 ` glisse at gcc dot gnu.org
  2014-02-15 19:31 ` hubert.vansteenhuyse at freecode dot be
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: glisse at gcc dot gnu.org @ 2014-02-15 15:57 UTC (permalink / raw)
  To: gcc-bugs

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

Marc Glisse <glisse at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2014-02-15
     Ever confirmed|0                           |1

--- Comment #2 from Marc Glisse <glisse at gcc dot gnu.org> ---
Your example is bogus: { and } don't match, main must return int, etc. If I fix
it so it compiles, I don't see any crash.


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

* [Bug c++/60213] Weird crash when delete an object
  2014-02-15 15:40 [Bug c++/60213] New: Weird crash when delete an object hubert.vansteenhuyse at freecode dot be
  2014-02-15 15:45 ` [Bug c++/60213] " hubert.vansteenhuyse at freecode dot be
  2014-02-15 15:57 ` glisse at gcc dot gnu.org
@ 2014-02-15 19:31 ` hubert.vansteenhuyse at freecode dot be
  2014-02-15 20:32 ` glisse at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: hubert.vansteenhuyse at freecode dot be @ 2014-02-15 19:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from hubert.vansteenhuyse at freecode dot be ---
(In reply to Marc Glisse from comment #2)
> Your example is bogus: { and } don't match, main must return int, etc. If I
> fix it so it compiles, I don't see any crash.

Of course it is, the example is merely a pseudo code to make clear what
happened.
In any case GDB reported a double deletion of the same address in similar code.
Don't worry about it, if someone else ever reports it then it might be worth to
take a closer look to it. 
Thx.


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

* [Bug c++/60213] Weird crash when delete an object
  2014-02-15 15:40 [Bug c++/60213] New: Weird crash when delete an object hubert.vansteenhuyse at freecode dot be
                   ` (2 preceding siblings ...)
  2014-02-15 19:31 ` hubert.vansteenhuyse at freecode dot be
@ 2014-02-15 20:32 ` glisse at gcc dot gnu.org
  2014-02-16  8:48 ` redi at gcc dot gnu.org
  2014-02-16  9:30 ` hubert.vansteenhuyse at freecode dot be
  5 siblings, 0 replies; 7+ messages in thread
From: glisse at gcc dot gnu.org @ 2014-02-15 20:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to hubert.vansteenhuyse from comment #3)
> Of course it is, the example is merely a pseudo code to make clear what
> happened.

That's my point, pseudo-code is useless, if we can't reproduce the issue it
doesn't make it clear at all what is going on. Compiler bugs (in case this is
one) often have unpredictable symptoms.

> Don't worry about it, if someone else ever reports it then it might be worth
> to take a closer look to it.

But we will have no idea that it is related. If you can post a valid,
self-contained example that exhibits the issue (preferably with a supported
version of gcc, so at least 4.7), that would be helpful. Otherwise I'll just
close the PR.


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

* [Bug c++/60213] Weird crash when delete an object
  2014-02-15 15:40 [Bug c++/60213] New: Weird crash when delete an object hubert.vansteenhuyse at freecode dot be
                   ` (3 preceding siblings ...)
  2014-02-15 20:32 ` glisse at gcc dot gnu.org
@ 2014-02-16  8:48 ` redi at gcc dot gnu.org
  2014-02-16  9:30 ` hubert.vansteenhuyse at freecode dot be
  5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2014-02-16  8:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to hubert.vansteenhuyse from comment #3)
> Of course it is, the example is merely a pseudo code to make clear what
> happened.

Didn't you read http://gcc.gnu.org/bugs/ ?


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

* [Bug c++/60213] Weird crash when delete an object
  2014-02-15 15:40 [Bug c++/60213] New: Weird crash when delete an object hubert.vansteenhuyse at freecode dot be
                   ` (4 preceding siblings ...)
  2014-02-16  8:48 ` redi at gcc dot gnu.org
@ 2014-02-16  9:30 ` hubert.vansteenhuyse at freecode dot be
  5 siblings, 0 replies; 7+ messages in thread
From: hubert.vansteenhuyse at freecode dot be @ 2014-02-16  9:30 UTC (permalink / raw)
  To: gcc-bugs

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

hubert.vansteenhuyse at freecode dot be changed:

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

--- Comment #6 from hubert.vansteenhuyse at freecode dot be ---
Yes I did. I think the crash came from somehere else in my code. I really
should be more carefull before reporting a bug. I thank you for your time spent
on this.


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

end of thread, other threads:[~2014-02-16  9:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-15 15:40 [Bug c++/60213] New: Weird crash when delete an object hubert.vansteenhuyse at freecode dot be
2014-02-15 15:45 ` [Bug c++/60213] " hubert.vansteenhuyse at freecode dot be
2014-02-15 15:57 ` glisse at gcc dot gnu.org
2014-02-15 19:31 ` hubert.vansteenhuyse at freecode dot be
2014-02-15 20:32 ` glisse at gcc dot gnu.org
2014-02-16  8:48 ` redi at gcc dot gnu.org
2014-02-16  9:30 ` hubert.vansteenhuyse at freecode dot be

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