Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Ticket #101 (closed defect: fixed)

Opened 13 years ago

Last modified 13 years ago

DemoCustomList seg faults when built 64bit

Reported by: JNewt Assigned to: Mike Wey
Priority: major Milestone: Release 1.5
Component: gtkd - classes Version: TRUNK
Keywords: 64 bits size_t Cc:

Description

Building the DemoCustomList? example on a 64bit system with the following:

dmd -m64 DemoCustomList.d CustomList.d -I../../../src/ -L../../../libgtkd.a -L-ldl

and running causes a seg fault in g_slice_alloc. GDB backtrace is attached.

Compiling gtkd and the demo as 32bit does not exhibit the problem. DMD version: 2.052, gtkd revision 824.

Attachments

backtrace.txt (1.6 kB) - added by JNewt on 04/19/11 19:14:09.
GDB backtrace

Change History

04/19/11 19:14:09 changed by JNewt

  • attachment backtrace.txt added.

GDB backtrace

04/19/11 19:49:54 changed by JNewt

It appears that this is due to gsize being defined as uint in glibtypes.d. According to http://developer.gnome.org/glib/2.28/glib-Basic-Types.html#gsize, it should be wide enough to hold a pointer. Redefining it to size_t (and gssize as ptrdiff_t) causes lots of build errors where various libraries use hardcoded uints (particularly gio). I'm working through these, converting them--we'll see if I get a usable build that fixes this issue.

04/19/11 21:52:18 changed by Mike Wey

  • owner changed from JJR to Mike Wey.
  • status changed from new to assigned.
  • keywords set to 64 bits size_t.

Rewrapped in svn r826, the manualy added function still need to be checked tough.

04/19/11 23:25:40 changed by JNewt

Still getting the seg fault with the new revision. Here's a slightly more complete backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6f28f74 in g_slice_alloc () from /usr/lib/libglib-2.0.so
(gdb) bt
#0  0x00007ffff6f28f74 in g_slice_alloc () from /usr/lib/libglib-2.0.so
#1  0x00007ffff6f29636 in g_slice_alloc0 () from /usr/lib/libglib-2.0.so
#2  0x00007ffff5a2adbb in g_type_create_instance (type=11324816)
    at /build/buildd/glib2.0-2.26.1/gobject/gtype.c:1867
#3  0x00007ffff5a0ebc9 in g_object_constructor (type=64, n_construct_properties=3, 
    construct_params=0x558948f075894853)
    at /build/buildd/glib2.0-2.26.1/gobject/gobject.c:1601
#4  0x00007ffff5a0d001 in g_object_newv (object_type=<value optimized out>, n_parameters=2, 
    parameters=<value optimized out>) at /build/buildd/glib2.0-2.26.1/gobject/gobject.c:1466
#5  0x00007ffff5a0da8d in g_object_new_valist (object_type=11324816, 
    first_property_name=0x0, var_args=0x7fffffffddf0)
    at /build/buildd/glib2.0-2.26.1/gobject/gobject.c:1582
#6  0x00007ffff5a0dcd1 in g_object_new (object_type=11324816, 
    first_property_name=0x7ffff208820f "spacing")
    at /build/buildd/glib2.0-2.26.1/gobject/gobject.c:1300
#7  0x00007ffff1fe9cf8 in ?? () from /usr/lib/libgtk-x11-2.0.so
#8  0x00007ffff1fec7f1 in ?? () from /usr/lib/libgtk-x11-2.0.so
#9  0x00007ffff1fd878e in gtk_tree_view_insert_column () from /usr/lib/libgtk-x11-2.0.so
...snip...

Unfortunately, I can't seem to load the symbols to examine the args to g_slice_alloc and g_slice_alloc0, though I can inspect the g_type_create_instance call.

04/19/11 23:49:41 changed by JNewt

When running with always-malloc, the problem does not appear:

G_SLICE=always-malloc ./DemoCustomList

04/20/11 21:15:26 changed by Mike Wey

Should be fixed in svn r829.

04/20/11 22:12:48 changed by JNewt

  • status changed from assigned to closed.
  • resolution set to fixed.

Works for me.

08/14/11 20:13:14 changed by Mike Wey

  • milestone set to Release 1.5.