lists.zerezo.com


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

***BOGO*** Re: [Mingw-users] crash with one version of MinGW but not another



On 2008-06-28 12:13Z, Damon Register wrote:
[probable segfault with gtk demo program]
> http://svn.gnome.org/viewvc/glibmm/trunk/examples/keyfile/main.cc?view=markup
> 
> I tried the example anyway and it worked on my work
> computer.  Later I tried it at home and it crashed
[...]
> The gtk and gtkmm were identical.
[...]
> g++.exe (GCC) 3.4.2 (mingw-special)
> g++.exe (GCC) 3.4.5 (mingw-vista special r3)

Are the gtk libraries C, or C++? If you're linking to any C++
library, then the problem may be that it was built with a
different compiler version than the library. See:
  http://mingw.org/MinGWiki/index.php/MixingCompilers

Otherwise, you could use 'gdb' to try to figure out where and
how it's crashing. It's not uncommon, though, for a segfault
to "disappear" when you run in a debugger. If that fails,
I would try inserting extra print statements in the demo
program that'll tell you where it crashed. For example, I'd
insert lines marked with an initial '+' below:

  int main(int argc, char** argv)
  {
+   std::cout << __LINE__ << std::endl;
    // This example should be executed like so:
    // ./example the_ini_file.ini

    Glib::init();
+   std::cout << __LINE__ << std::endl;

and similarly around each step that could possibly fail.
I'd also add "catch(...)" clauses to make sure all C++
exceptions are trapped, not just the anticipated ones.

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users