After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 126149 - Toolbar + stlport
Toolbar + stlport
Status: RESOLVED INVALID
Product: gtkmm
Classification: Bindings
Component: general
2.2
Other Linux
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2003-11-03 22:19 UTC by Alexander Bussman
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Alexander Bussman 2003-11-03 22:19:31 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
  • #0 Glib::ustring::~ustring()
    from /usr/lib/libglibmm-2.0.so.1
  • #1 Gtk::Toolbar_Helpers::Element::~Element()
  • #2 Gtk::Toolbar_Helpers::ButtonElem::~ButtonElem()
  • #3 ExampleWindow::ExampleWindow()
  • #4 main

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.
Comment 1 Murray Cumming 2003-11-04 17:30:39 UTC
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?
Comment 2 Alexander Bussman 2003-11-05 07:55:37 UTC
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.
Comment 3 Murray Cumming 2004-05-08 20:49:12 UTC
The tools() STL-list API has been removed from gtkmm 2.4. Are there any known
problems with stlport and gtkmm 2.4?
Comment 4 Murray Cumming 2004-10-25 11:37:39 UTC
Please reopen this if you intend to work on it.