Results 1 to 3 of 3

Thread: Odd behaviour on ClanLib 2.4 Linux

  1. #1
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default Odd behaviour on ClanLib 2.4 Linux

    I broke something, but I do not know how. It works perfect on Microsoft Windows

    Using the latest SVN for ClanLib 2.4.

    Using the Basic2D example (you need to change the program.cpp and the Makefile to use GL, as SWRender is broken)
    Code:
    int Basic2D::start(const std::vector<CL_String> &args)
    {
    
    	CL_DisplayWindow aaa;
    	if (!aaa.is_null())
    		throw CL_Exception("Expect to be null");
    	//aaa.get_gc();	// Correct - An exception is thrown
    	aaa.get_ic();	//<- Why does this segfault instead of throwing an exception?

    The code for get_gc() and get_ic() is:

    Code:
    CL_GraphicContext& CL_DisplayWindow::get_gc() const
    {
    	throw_if_null();
    	return impl->provider->get_gc();
    }
    
    CL_InputContext CL_DisplayWindow::get_ic() const
    {
    	throw_if_null();
    	return impl->provider->get_ic();
    }

    Why does aaa.get_ic(); segfault instead of throwing an exception, when aaa.get_gc() works!!!

  2. #2
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    554

    Default

    I would try a rebuild (of your clanlib copy and the example).

    The pasted code behaves the same way, unless something else corrupted the memory first.

  3. #3
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    Yeah, I think you are right.

    I did a complete rebuild, that did not help.

    Then I did "rm -f -r Sources", and "svn update" ... Still the same

    But I have not tried looking in "/usr/include/ClanLib" and "/usr/local/include/ClanLib" to check for old API files that it may be picking up, since my Ubuntu upgrade.

    Hopefully that will work

    Earlier I did a "printf" of the "this" pointer in CL_DisplayWindow::get_ic(), and it was "-1".
    That would also explains that (mismatch compiled lib and api files)

Similar Threads

  1. Window size/behaviour differences on Windows and Linux
    By genail in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 12-31-2009, 12:02 AM
  2. clanlib crashes debian linux
    By 93interactive in forum Official ClanLib SDK Forums
    Replies: 3
    Last Post: 08-27-2009, 06:40 PM
  3. Software Renderer for Linux ClanLib 0.9
    By rombust in forum Official ClanLib SDK Forums
    Replies: 0
    Last Post: 03-26-2009, 04:55 PM
  4. Using GTK for ClanLib 0.9 Linux
    By rombust in forum Official ClanLib SDK Forums
    Replies: 3
    Last Post: 09-23-2008, 04:03 PM
  5. Installing ClanLib 0.8 and ClanLib 0.9 on linux
    By rombust in forum Official ClanLib SDK Forums
    Replies: 4
    Last Post: 07-15-2008, 09:51 AM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •