SIGSEGV in invariant._d_invariant(Object)

Keywan Ghadami via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jan 6 13:50:23 PST 2016


Hi @all,

how to fix an SIGSEGV in invariant._d_invariant(Object)?

Maybe i should give some context:

I am learning D and started hacking the 
dlangide(https://github.com/buggins/dlangide), and normally 
finding the cause of an segmentation fault isn't that hard. But 
this time it is somehow different because gdb prints something 
about a function "_d_invariant" and not directly giving the stack 
trace.

I guess the segmentation fault happens somewhere in the druntime 
(https://github.com/D-Programming-Language/druntime/blob/master/src/rt/invariant.d).

I am wondering if am searching i the right direction. Should i 
try to debug the runtime somehow or better search in the 
application code to find the reason?


This is the output from gdb crashdump:

Using host libthread_db library 
"/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `bin/dlangide'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000000000cca5de in invariant._d_invariant(Object) ()
[Current thread is 1 (Thread 0x7fd86bf965c0 (LWP 3665))]
(gdb) up
#1  0x0000000000c2f092 in 
dlangui.widgets.lists.StringListAdapter.itemCount() const (
     this=0x7fd85bc03d00) at 
../.dub/packages/dlangui-0.7.32/src/dlangui/widgets/lists.d:306
306	    @property override int itemCount() const {
(gdb) up
#2  0x0000000000c2fefe in 
dlangui.widgets.lists.ListWidget.itemCount() (this=0x7fd85c3af400)
     at 
../.dub/packages/dlangui-0.7.32/src/dlangui/widgets/lists.d:513
513	            return _adapter.itemCount;


More information about the Digitalmars-d-learn mailing list