[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gtkmm
Subject:    Re: Gtk::SpinButton crash
From:       Kjell Ahlstedt <kjell.ahlstedt () bredband ! net>
Date:       2013-11-29 19:19:16
Message-ID: 5298E8B4.8030408 () bredband ! net
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


2013-11-29 18:13, John Emmas skrev:
> On 29/11/2013 16:29, Kjell Ahlstedt wrote:
>>
>> It would be fine if you could try to find out what goes wrong when 
>> g_object_steal_qdata() is called. Why isn't the GQuark removed from 
>> the list of the GtkAdjustment's quarks?
>>
>
> Yes you're onto something Kjell.  The call to 'steal_qdata' looks like 
> this:-
>
>         g_object_steal_qdata((GObject*)gobj(), Glib::quark_);
>
> The value of 'Glib::quark_' is ludicrously high (3232507391) which 
> looks like an uninitialized number to me.  Also, when we step to the 
> next line:-
>
>         g_object_set_qdata((GObject*)gobj(), 
> Glib::quark_cpp_wrapper_deleted_, (gpointer)true);
>
> The value of 'Glib::quark_cpp_wrapper_deleted_' is also ludicrously 
> high.  These quark values are either uninitialized or there's some 
> kind of signed / unsigned mismatch somewhere.
>
> In function main() I call:-
>
>         Gtk::Main app(&argc, &argv);
>
> The above line calls 'gtk_init()' but is something extra needed for 
> initializing glibmm?  I'm sure I once tried this with plain GTK+ and 
> the values were reasonable.
>
> John
Glib::quark_ and Glib::quark_cpp_wrapper_deleted_ are statically 
allocated data, initialized to 0 in glibmm/glib/glibmm/quark.cc. They 
get their real values in glibmm/glib/glibmm/wrap.cc, 
Glib::wrap_register_init().

Glib::quark_ probably has a reasonable value in 
Glib::ObjectBase::_set_current_wrapper(), when g_object_set_qdata_full() 
is called.

Is it possible that you have some inconsistency between glibmm and 
gtkmm? That Glib::quark_ has a reasonable value when it's accessed in a 
glibmm function, but not when it's accessed in a gtkmm function? Can you 
see if Glib::quark_'s address is the same in 
Glib::ObjectBase::_set_current_wrapper() as in 
Gtk::Object::disconnect_cpp_wrapper()?

Kjell


[Attachment #5 (text/html)]

<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <div class="moz-cite-prefix">2013-11-29 18:13, John Emmas skrev:<br>
    </div>
    <blockquote cite="mid:5298CB46.8090504@tiscali.co.uk" type="cite">
      <meta content="text/html; charset=ISO-8859-1"
        http-equiv="Content-Type">
      <div class="moz-cite-prefix">On 29/11/2013 16:29, Kjell Ahlstedt
        wrote:<br>
      </div>
      <blockquote cite="mid:5298C0CF.8020409@bredband.net" type="cite">
        <meta content="text/html; charset=ISO-8859-1"
          http-equiv="Content-Type">
        <br>
        It would be fine if you could try to find out what goes wrong
        when g_object_steal_qdata() is called. Why isn't the GQuark
        removed from the list of the GtkAdjustment's quarks?<br>
        <br>
      </blockquote>
      <br>
      Yes you're onto something Kjell.&nbsp; The call to 'steal_qdata' looks
      like this:-<br>
      <br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
g_object_steal_qdata((GObject*)gobj(), Glib::quark_);<br>  <br>
      The value of 'Glib::quark_' is ludicrously high (3232507391) which
      looks like an uninitialized number to me.&nbsp; Also, when we step to
      the next line:-<br>
      <br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; g_object_set_qdata((GObject*)gobj(),
      Glib::quark_cpp_wrapper_deleted_, (gpointer)true);<br>
      <br>
      The value of 'Glib::quark_cpp_wrapper_deleted_' is also
      ludicrously high.&nbsp; These quark values are either uninitialized or
      there's some kind of signed / unsigned mismatch somewhere.<br>
      <br>
      In function main() I call:-<br>
      <br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Gtk::Main app(&amp;argc, \
&amp;argv);<br>  <br>
      The above line calls 'gtk_init()' but is something extra needed
      for initializing glibmm?&nbsp; I'm sure I once tried this with plain
      GTK+ and the values were reasonable.<br>
      <br>
      John<br>
    </blockquote>
    Glib::quark_ and Glib::quark_cpp_wrapper_deleted_ are statically
    allocated data, initialized to 0 in glibmm/glib/glibmm/quark.cc.
    They get their real values in glibmm/glib/glibmm/wrap.cc,
    Glib::wrap_register_init().<br>
    <br>
    Glib::quark_ probably has a reasonable value in
    Glib::ObjectBase::_set_current_wrapper(), when
    g_object_set_qdata_full() is called.<br>
    <br>
    Is it possible that you have some inconsistency between glibmm and
    gtkmm? That Glib::quark_ has a reasonable value when it's accessed
    in a glibmm function, but not when it's accessed in a gtkmm
    function? Can you see if Glib::quark_'s address is the same in
    Glib::ObjectBase::_set_current_wrapper() as in
    Gtk::Object::disconnect_cpp_wrapper()?<br>
    <br>
    Kjell<br>
    <br>
  </body>
</html>



_______________________________________________
gtkmm-list mailing list
gtkmm-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtkmm-list


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic