On 27-10-17 21:14, Gerald Nunn wrote:

I'm trying to run Tilix with GtkD 3.7.0 and am getting a segfault as soon as I call the run method for GTK Application. GDB shows the back trace below. I'm not sure if it's a GtkD problem or something I'm doing on my end since I do have some funky things here and there, but the back trace is pretty minimal of tilix artifacts.

I had look at line 159 in ObjectG, it is the opCast template declaration but unfortunately the back trace doesn't show what line in particular in causing the issue.

Any suggestions?

Thread 1 "tilix" received signal SIGSEGV, Segmentation fault.
0x00007ffff7508cc6 in invariant._d_invariant(Object) () from /usr/lib/libphobos2.so.0.76
(gdb) bte
Undefined command: "bte".  Try "help".
(gdb) bt
#0  0x00007ffff7508cc6 in invariant._d_invariant(Object) () at /usr/lib/libphobos2.so.0.76
#1  0x0000555555f9315a in gobject.ObjectG.ObjectG.opCast!(void*).opCast() (this=0x7ffff7eb6d40) at ../../../.dub/packages/gtk-d-3.7.0/gtk-d/generated/gtkd/gobject/ObjectG.d:159
#2  0x0000555555f91016 in gobject.ObjectG.ObjectG.toggleNotify(gobject.ObjectG.ObjectG, gobject.c.types.GObject*, int) (obj=0x7ffff7eb6d40, object=0x5555569eb040, isLastRef=1)
     at ../../../.dub/packages/gtk-d-3.7.0/gtk-d/generated/gtkd/gobject/ObjectG.d:129
#3  0x00007ffff25b1332 in g_value_unset () at /usr/lib/libgobject-2.0.so.0
#4  0x00007ffff25ad6cd in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0
#5  0x00007ffff25ae920 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
#6  0x00007ffff28877ff in  () at /usr/lib/libgio-2.0.so.0
#7  0x00007ffff28881a1 in  () at /usr/lib/libgio-2.0.so.0
#8  0x00007ffff281613a in g_application_run () at /usr/lib/libgio-2.0.so.0
#9  0x0000555555f27ee4 in gio.Application.Application.run(immutable(char)[][]) (this=0x7ffff7edd800, argv=...)
     at ../../../.dub/packages/gtk-d-3.7.0/gtk-d/generated/gtkd/gio/Application.d:925
#10 0x0000555555dd32fd in D main (args=...) at source/app.d:146

I've spend some time tracking this one down.

The second time gio.ApplicationCommandline is cast to void the invariant
of the class fails. This is related to the call to destroy in
source/gx/tilix/application.d line: 386. I still have to investigate why.

I can't reproduce the issue with ldc (1.4.0), only with dmd.