[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

segfault in guile-1.6 with guile-gobject

From: Andy Wingo
Subject: segfault in guile-1.6 with guile-gobject
Date: Thu, 3 Apr 2003 21:16:02 +0200
User-agent: Mutt/1.5.3i

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
#3  0x40048d6f in scm_eval_body (code=0x40341c40, env=0x40372e10) at

[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 
513                                               len, k_instance, FUNC_NAME);
514             }

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

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_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));

#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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]