www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Explicit Class Instance Allocation causes Segfault

With dmd v0.102, the following code causes a Linux Segfault (or Win32 Exception)
when delete is called on the object. This is basically the same code found in
the docs. here: http://digitalmars.com/d/memory.html#newdelete

#import std.outofmemory;
#import std.c.stdlib;
#import std.gc;

#class Foo





















#void main()





The segfault happens when the destructor is called (even though there isn't one
for the class above ;).

#extern (C)
#void _d_callfinalizer(void *p)

























If the call to _d_finalizer in _d_delclass is commented out, the segfault
happens when the deallocator is called.

#void _d_delclass(Object *p)


























Looks like maybe the ClassInfo initialization isn't happening correctly.

- Dave
Sep 27 2004