GNOME Bugzilla – Bug 126149
Toolbar + stlport
Last modified: 2004-12-22 21:47:04 UTC
this peace of code creates a crash with stlport (4.5): Gtk::Toolbar toolbar; toolbar.tools().push_back(Gtk::Toolbar_Helpers::ButtonElem("Test", SigC::slot(*this,ExampleWindow::action), "testing")); You get the idea... It produces a segfault if I use stlport and works fine if I don't use stlport. gdb tells me this: Program received signal SIGSEGV, Segmentation fault. 0x40563dd7 in Glib::ustring::~ustring() () from /usr/lib/libglibmm-2.0.so.1 (gdb) bt
+ Trace 41432
I have also encountered a simular problem (the same peace of code) in a larger application. Then gdb told me something about SigC::clean or something.
Thanks for the report. I would like you to investigate this. If you want somebody else to investigate it for you, then please at least write down some instructions about how to build "gtkmm + STLPort". And it would be nice to have an actual test case for this, but I guess you should just be able to name one of the examples for us. Personally, I have no great incentive to do the work myself. Also, do all the libsigc++ tests work successfully?
I post a full example here: #include <gtkmm.h> class ExampleWindow : public Gtk::Window { private: Gtk::Toolbar toolbar; Gtk::VBox box; public: ExampleWindow(); ~ExampleWindow(); protected: virtual void action(); }; ExampleWindow::ExampleWindow() { set_default_size(640, 480); add(box); box.pack_start(toolbar, Gtk::PACK_SHRINK); toolbar.tools().push_back(Gtk::Toolbar_Helpers::ButtonElem("Test", SigC::slot(*this, &ExampleWindow::action), "testing")); show_all_children(); } ExampleWindow::~ExampleWindow() {} void ExampleWindow::action() { hide(); } int main(int argc, char *argv[]) { Gtk::Main kit(argc, argv); ExampleWindow window; Gtk::Main::run(window); return 0; } compile this with this and it will work: g++ code.cpp `pkg-config gtkmm-2.0 --cflags --libs` and not with this (well it will compile and link but it won't run) g++ code.cpp `pkg-config gtkmm-2.0 --cflags --libs` -I/usr/include/stlport I will test the libsigc++ examples later today when I get more time for it.
The tools() STL-list API has been removed from gtkmm 2.4. Are there any known problems with stlport and gtkmm 2.4?
Please reopen this if you intend to work on it.