Re: where is error?



I have not been following enough to know what is wrong, but I pasted
your test program into a file called "testprg.cc", built it, and ran it,
and it does core dump on Fedora Core 5, 64 bit.  Hope that helps.  Here
is the log:

doug doug> cat buildit.sh
#!/bin/csh

set flags=`/usr/bin/pkg-config --cflags --libs gtkmm-2.4 libglademm-2.4
libgnomeui-2.0`
echo gcc -g $flags testprg.cc
gcc -g $flags testprg.cc
#echo gcc ‘pkg-config --cflags --libs gtkmm-2.4 libglademm-2.4
libgnomeui-2.0‘ testprg.cc
#gcc ‘pkg-config --cflags --libs gtkmm-2.4 libglademm-2.4
libgnomeui-2.0‘ testprg.cc
doug doug>


doug doug> ./buildit.sh
gcc -g -DORBIT2=1 -pthread -I/usr/include/gtkmm-2.4
-I/usr/lib64/gtkmm-2.4/include -I/usr/include/glibmm-2.4
-I/usr/lib64/glibmm-2.4/include -I/usr/include/gdkmm-2.4
-I/usr/lib64/gdkmm-2.4/include -I/usr/include/pangomm-1.4
-I/usr/include/atkmm-1.6 -I/usr/include/gtk-2.0 -I/usr/include/sigc
++-2.0 -I/usr/lib64/sigc++-2.0/include -I/usr/include/glib-2.0
-I/usr/lib64/glib-2.0/include -I/usr/lib64/gtk-2.0/include
-I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/atk-1.0
-I/usr/include/libglademm-2.4 -I/usr/lib64/libglademm-2.4/include
-I/usr/include/libglade-2.0 -I/usr/include/libxml2
-I/usr/include/libgnomeui-2.0 -I/usr/include/libgnome-2.0
-I/usr/include/libgnomecanvas-2.0 -I/usr/include/libart-2.0
-I/usr/include/gconf/2 -I/usr/include/libbonoboui-2.0
-I/usr/include/gnome-vfs-2.0 -I/usr/lib64/gnome-vfs-2.0/include
-I/usr/include/gnome-keyring-1 -I/usr/include/orbit-2.0
-I/usr/include/libbonobo-2.0 -I/usr/include/bonobo-activation-2.0
-I/usr/include/freetype2 -pthread -lglademm-2.4 -lgtkmm-2.4 -lglade-2.0
-lgdkmm-2.4 -latkmm-1.6 -lpangomm-1.4 -lglibmm-2.4 -lsigc-2.0
-lgnomeui-2 -lSM -lICE -lbonoboui-2 -lgnome-keyring -lxml2 -lz
-lgnomecanvas-2 -lgnome-2 -lpopt -lart_lgpl_2 -lpangoft2-1.0
-lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0
-lpango-1.0 -lcairo -lgnomevfs-2 -lbonobo-2 -lgconf-2 -lgobject-2.0
-lbonobo-activation -lORBit-2 -lm -lgmodule-2.0 -ldl -lgthread-2.0
-lglib-2.0 testprg.cc


doug doug> gdb a.out
GNU gdb Red Hat Linux (6.3.0.0-1.122rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "x86_64-redhat-linux-gnu"...Using host
libthread_db library "/lib64/libthread_db.so.1".

(gdb) run
Starting program: /home/doug/testprg/a.out
[Thread debugging using libthread_db enabled]
[New Thread 46912496377392 (LWP 16809)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 46912496377392 (LWP 16809)]
0x0000003df6523ed0 in g_type_check_instance_is_a ()
from /usr/lib64/libgobject-2.0.so.0
(gdb) where
#0  0x0000003df6523ed0 in g_type_check_instance_is_a ()
from /usr/lib64/libgobject-2.0.so.0
#1  0x0000003df814bcb6 in gtk_radio_action_get_group ()
from /usr/lib64/libgtk-x11-2.0.so.0
#2  0x00000039234553b5 in Gtk::RadioAction::get_group ()
from /usr/lib64/libgtkmm-2.4.so.1
#3  0x0000003923455408 in Gtk::RadioAction::set_group ()
from /usr/lib64/libgtkmm-2.4.so.1
#4  0x00000039234558a7 in Gtk::RadioAction::RadioAction$base ()
from /usr/lib64/libgtkmm-2.4.so.1
#5  0x0000000000401dc1 in Radio_action (this=0x5477c0,
group= 0x7fff91a5a1d0) at testprg.cc:15
#6  0x0000000000401ef4 in (anonymous namespace)::Radio_action::create
(group= 0x7fff91a5a1d0) at testprg.cc:21
#7  0x0000000000401c54 in main (argc=1, argv=0x7fff91a5a2f8) at
testprg.cc:37
(gdb)





On Thu, 2006-08-10 at 00:38 +0300, Paul Pogonyshev wrote:
> Murray Cumming wrote:
> > It should of course be
> > 
> > Glib::RefPtr<Radio_action> Radio_action::create(RadioActionGroup& group)
> > {
> >   return Glib::RefPtr<Radio_action>( new Radio_action(group) );
> > }
> > 
> > Again, I have no idea whether this will stop your segfault.
> 
> It will not, since it uses the same constructor, only with RefPtr wrapped
> over the constructed object.  I actually _checked_ this and experienced
> the same crash, as expected.
> 
> Can anyone check if this happens with recent Gtkmm too?  Can anyone
> understand (and fix) the reason of the crash?
> 
> (I might have not been nice, but it's not like I asked the list when I
> first saw the crash.  I encountered it in a real program, pondered for a
> while and created small test below.  I'm pretty sure it's a problem/bug of
> Gtkmm, but cannot check with recent versions.)
> 
> Paul
> 
> 
> #include <glibmm/refptr.h>
> #include <gtkmm/main.h>
> #include <gtkmm/radioaction.h>
> #include <gtkmm/stock.h>
> 
> 
> namespace
> {
> 
>   class Radio_action : public Gtk::RadioAction
>   {
>   public:
> 
>     Radio_action (Group& group)
>       : Gtk::RadioAction (group, "test", Gtk::StockID (), "", "")
>     { }
> 
>     static  Glib::RefPtr <Radio_action>
>     create (Group& group)
>     {
>       return Glib::RefPtr <Radio_action> (new Radio_action (group));
>     }
>   };
> 
> }
> 
> 
> int
> main (int argc, char** argv)
> {
>   Gtk::Main  main (argc, argv);
> 
>   Radio_action::Group  test_group;
> 
> #if 1
>   // This segfaults.
>   Radio_action::create (test_group);
> #else
>   Gtk::RadioAction::create (test_group, "test");
> #endif
> 
>   return 0;
> }
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list





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