Results 1 to 7 of 7

Thread: crash in LayeredWindow2 example

  1. #1

    Default crash in LayeredWindow2 example

    Hi guys,
    sorry for my poor English.
    I have got a crash with corrupted heap on start LayeredWindow2 example. It's repeated stable.
    I have investigated problem and got the following result:
    the problem is located in the .\Sources\GL\WGL\opengl_window_provider_wgl.cpp file in the
    void CL_OpenGLWindowProvider_WGL::flip(int interval) method
    After change bottom code
    CL_PixelBuffer pixelbuffer(width, height, cl_r8);
    on this
    CL_PixelBuffer pixelbuffer(width, height + 1, cl_r8);
    the crash is not repeated.
    May be OS allocate new page and heap corruoted is not located by OS more, but the method is need more memory (heiht * 2 or height * 3 )

    PS sorry for my poor English.
    PSS CLanLib v.2.3.6

  2. #2
    ClanLib Developer
    Join Date
    May 2007


    I have seen this exact crash before.

    Unfortunately I cannot remember the outcome of the investigation into it.

    But, I do remember I also fixed the crash by using: CL_PixelBuffer pixelbuffer(width, height + 1, cl_r8);

    But (if I remember correctly), updating the graphics card driver fixed the problems.

    Maybe this problem should be looked at again.

    What is your graphics card?
    What is the graphics card driver version number?

  3. #3


    Graphics card: NVidia, Geforce GT 540M
    Driver release data: 27.03.11

    I'll try to update driver and I will write to thread results by 15.00 GMT

  4. #4


    It looks like I have found the solution of the problem.
    I read the manual of the opengl and found that:
    This method stores many options of the glReadPixels.
    One of them is GL_UNPACK_ALIGNMENT whose default value is 4.
    I remember that the width of the widow in the example is 650px which is not divided on 4.
    After that I tried to change the width of the window to 652px and the problem is not repeated.
    Could you please check the solution and fix the problem takeing into account current states of params of glPixelStore?
    Thank you.

    PS I've updated drivers but it not resolve the problem

  5. #5
    ClanLib Developer
    Join Date
    May 2007


    Looking at the documentation, you are correct.

    Many thanks for finding and solving the problem.

  6. #6
    ClanLib Developer
    Join Date
    May 2007


    Applied patch to SVN (For ClanLib 2.3 and ClanLib 3.0 devel)


    "Six of the twelve storage parameters affect how pixel data is returned to client memory. They are as follows ... GL_PACK_ALIGNMENT" <-- which is what glReadPixels does

    (Not tested patch)

  7. #7


    The patch fix issue. Thanks

Similar Threads

  1. Blackberry crash
    By JonyMnemonic in forum Proton SDK
    Replies: 2
    Last Post: 02-25-2012, 11:50 AM
  2. CRASH
    By Hawk in forum Funeral Quest
    Replies: 4
    Last Post: 04-18-2010, 03:11 PM
  3. Animated gif causes crash.
    By jara in forum Novashell Game Creation System
    Replies: 1
    Last Post: 01-02-2010, 02:53 PM
  4. Crash this bug
    By huntercool in forum Official ClanLib SDK Forums
    Replies: 2
    Last Post: 09-29-2009, 02:40 PM
  5. Crash
    By valdirSalgueiro in forum Official ClanLib SDK Forums
    Replies: 4
    Last Post: 03-14-2009, 01:47 AM



Posting Permissions

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