On Thu, Sep 13, 2001 at 05:37:14PM +0200, Lionel Ulmer wrote:
> So I tried another solution, connect my own function to the CList's
> 'scroll_vertical' message. And this causes the following error :
> 
> ** ERROR **: file gtkmodule.c: line 3237 (GtkRet_FromPyObject): should not be reached

Ok, /me is taking bad habits of taking to myself :-)

So, I started to debug this problem on my Solaris workstation (it works fine
on my Linux box with python 2.0 and Gtk+ 1.2.10).

To remove the 'Gtk+' bug option, I built Gtk+ 1.2.10 (I had 1.2.7 on my box
before) and get the same error.

So I fired up gdb on the core file to see into more details what is happening.

The interesting part of the backtrace looks like that :

#7  0xef4a543c in GtkRet_FromPyObject (ret=0xa65360, py_ret=0xc6204) at 
gtkmodule.c:3237
#8  0xef4a5d40 in PyGtk_CallbackMarshal (o=0xe80bc, data=0xc6204, nargs=2, 
args=0xa65330) at gtkmodule.c:3413
#9  0xeeb05694 in gtk_handlers_run (handlers=0x4aff28, signal=0xefffca18, 
object=0x5b00b0, params=0xa65330, after=0) at gtksignal.c:1906
#10 0xeeb045a8 in gtk_signal_real_emit (object=0x5b00b0, signal_id=125, 
params=0xa65330) at gtksignal.c:1477
#11 0xeeb013b4 in gtk_signal_emitv (object=0x5b00b0, signal_id=125, params=0xa65330) 
at gtksignal.c:523
#12 0xeea3c9a0 in gtk_binding_entry_activate (entry=0x1de930, object=0x5b00b0) at 
gtkbindings.c:411
#13 0xeea3dc34 in gtk_bindings_activate (object=0x5b00b0, keyval=1964608, 
modifiers=3476912) at gtkbindings.c:800
#14 0xeeb4c184 in gtk_widget_real_key_press_event (widget=0x5b00b0, event=0x480648) at 
gtkwidget.c:2687
#15 0xeea5b274 in gtk_clist_key_press (widget=0x5b00b0, event=0x480648) at 
gtkclist.c:4920

The error comes from the fact that we, apparently, use some garbage at
args[nargs] at the following line in PyGtk_CallbackMarshal :

    GtkRet_FromPyObject(&args[nargs], ret);

When we look at the backtrace, we see that 'args' (0xa65330) is created in
'gtk_binding_entry_activate' at the following function call :

     binding_compose_params (sig->args, query, &params)

This code does the following :

  params = g_new0 (GtkArg, query->nparams);
  
Now, let's check the value of 'query' (in 'gtk_binding_entry_activate') :

      query = gtk_signal_query (signal_id);
      
The signal is 'scroll_vertical' with an ID of 125.

(gdb) print _gtk_private_signals[125]
$5 = {signal_id = 125, object_type = 49685, name = 0x435110 "scroll-vertical", 
function_offset = 396, 
  marshaller = 0xeeac2584 <gtk_marshal_NONE__INT_FLOAT>, return_val = 1, signal_flags 
= 10, nparams = 2, params = 0x504198, hook_list = 0x0}

So 'nparams' is set to 2.

So my question is now : why do we even access args[nargs] at all ? According
to what I found out, this value should NOT be valid at all.

Could anyone explain to me where I messed up in my investigations :-) ?

Thanks,
                                Lionel

-- 
                 Lionel Ulmer - http://www.bbrox.org/
_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk

Reply via email to