← Back to index
|
Original Bugzilla link
Bug 188 – invalid free during AssertError destructor
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2006-06-09T03:56:00Z
Last change time
2015-06-09T01:31:18Z
Assigned to
dvdfrdmn
Creator
braddr
Attachments
ID
Filename
Summary
Content-Type
Size
146
assert-test.d
original test suite
text/plain
2451
Comments
Comment #0
by braddr — 2006-06-09T03:56:15Z
69 try 70 { 71 assert(false, "test 6 " ~ test5func()); 72 writefln("test 6 failed -- it didn't throw when it should have"); 73 } 74 catch (AssertError e) 75 { 76 if (e.msg == "test 6 message") 77 writefln("test 6 passed "); 78 else 79 writefln("test 6 failed -- threw the wrong message"); 80 } $ gdc -g -funittest -fdebug -o assert-test assert-test.d $ ./assert-test test 6 passed *** glibc detected *** free(): invalid pointer: 0x401d1fe0 *** Aborted (core dumped) Breakpoint 1, std.asserterror.AssertError._dtor() (this=@0x401d4fc0) at ../../../gcc-4.0.2/libphobos/std/asserterror.d:56 56 { std.c.stdlib.free(msg.ptr); (gdb) print this.msg $1 = {length = 14, ptr = 0x401d1fe0 "test 6 message"} (gdb) next *** glibc detected *** free(): invalid pointer: 0x401d1fe0 *** I can't reproduce this with dmd 0.160 so I'm assigning this to gdc for now. It could well be something in the front end or phobos since I haven't dug into it much.
Comment #1
by braddr — 2006-11-25T15:08:15Z
Mass reassignment of gdc bugs from me to David.
Comment #2
by thomas-dloop — 2007-04-29T02:10:35Z
Can anybody reproduce this issue with a gdc-0.19 or newer? (gdc-0.19 contains a change that should fix this issue)
Comment #3
by casantander1 — 2007-04-29T09:18:46Z
Do you have a full compilable example?
Comment #4
by braddr — 2007-04-29T14:51:56Z
I'll double check this. I probably have the original test case floating around my drive somewhere.
Comment #5
by braddr — 2007-05-06T03:21:49Z
Created attachment 146 original test suite Here's the original assert-test.d file.
Comment #6
by braddr — 2007-05-06T03:22:34Z
I've re-tested this with gdc 0.23 and all 6 tests pass. So, I'm resolving this ticket.