unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* segfault in guile-1.6 with guile-gobject
@ 2003-04-03 19:16 Andy Wingo
  0 siblings, 0 replies; only message in thread
From: Andy Wingo @ 2003-04-03 19:16 UTC (permalink / raw)


Hello schemers,

I'm trying to get the guile-gnome package working (0.4.0 and cvs) and I
run into segfaults with guile 1.6.3 (debian unstable). I'm afraid the
backtrace is rather useless:

guile> (use-modules (gnome gobject))
 
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 16338)]
0x40058afa in scm_sys_prep_layout_x (class=0x80885d0) at goops.c:511
511               len = scm_ilength (SCM_CDAR (slots));
(gdb) p slots
$16 = 0x2974
(gdb) p *(SCM*)slots
Cannot access memory at address 0x2974
(gdb) (bt)
#0  0x40058afa in scm_sys_prep_layout_x (class=0x80885e0) at goops.c:511
#1  0x4004d6e6 in scm_deval (x=0x2974, env=0x4028b730) at eval.c:2800
#2  0x4004d424 in scm_deval (x=0x40289c68, env=0x40372d78) at
#eval.c:1999
#3  0x40048d6f in scm_eval_body (code=0x40341c40, env=0x40372e10) at
#eval.c:1580

[It goes on for 105 more frames. I can post it somewhere if you like.]

(gdb) l
506           allocation = scm_i_get_keyword (k_allocation, SCM_CDAR (slots),
507                                           len, k_instance, FUNC_NAME);
508           while (!SCM_EQ_P (allocation, k_instance))
509             {
510               slots = SCM_CDR (slots);
511               len = scm_ilength (SCM_CDAR (slots));
512               allocation = scm_i_get_keyword (k_allocation, SCM_CDAR (slots),
513                                               len, k_instance, FUNC_NAME);
514             }
(gdb) 

I'm really at a loss here... I tried to try it out with guile 1.4, but I
need the 1.6 for gnucash et al... and why shouldn't it work with 1.6,
anyway? ;)

Thinking out loud a bit more, it's probably a problem with the slots
somehow. The init code for gobject.scm calls the scheme gtype->class,
which ends up calling
guile-gnome-gobject-primitives.c:scm_sys_gtype_bind_to_class():

SCM_DEFINE (scm_sys_gtype_bind_to_class, "%gtype-bind-to-class", 2, 0, 0,
            (SCM class, SCM type),
                "")
#define FUNC_NAME s_scm_sys_gtype_bind_to_class
{
    SCM name, slotdef, offset;
    GType gtype;

    SCM_VALIDATE_GTYPE_CLASS (1, class);
    SCM_VALIDATE_GTYPE_COPY (2, type, gtype);

    slotdef = slot_definition_using_name (class, scm_sym_gtype);
    offset = scm_list_ref (slotdef, SCM_MAKINUM (4));
    SCM_SET_SLOT (class, SCM_INUM (offset), type);

    g_type_set_qdata (gtype, quark_class, scm_permanent_object (class));

    return SCM_UNSPECIFIED;
}
#undef FUNC_NAME

The one remaining definition, slot_definition_using_name():

static SCM
slot_definition_using_name (SCM class, SCM slot_name)
{
    register SCM slots = SCM_SLOT (class, scm_si_getters_n_setters);
    for (; SCM_NIMP (slots); slots = SCM_CDR (slots))
    if (SCM_CAAR (slots) == slot_name)
        return SCM_CAR (slots);
    return SCM_BOOL_F;
}


Is there something wrong here? I am not familiar with guile internals. I
am a C hacker from the gnome side of things wanting to use scheme in my
programs. Sorry for the long email, but I wanted to increase the
likelihood of getting assistance by providing all of the information.
Please copy me on any replies, as I am not on the list.

Hearty thanks in advance for any help,

Andy Wingo


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-04-03 19:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-03 19:16 segfault in guile-1.6 with guile-gobject Andy Wingo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).