PDA

View Full Version : heap corruption detected error in run GUI_Layered sample.



clanlib4d
12-05-2011, 04:34 PM
When I run sample GUI_Layered , there is error which is heap corruption detected:... , for detail information,please refer to attachment(picture).650

Could someone help to fix this issue or tell me why?

In addition, I known that the debug version has this issue, but there is no error message in the release version .

but when I run the release version, I can NOT see the GUI like http://clanlib.org/w/images/thumb/6/68/Linux_layered2.png/120px-Linux_layered2.png.

clanlib4d
12-05-2011, 05:25 PM
> GUI_Layered.exe!_free_dbg_nolock(void * pUserData, int nBlockUse) Line 1376 + 0x3b bytes C++
GUI_Layered.exe!_free_dbg(void * pUserData, int nBlockUse) Line 1265 + 0xd bytes C++
GUI_Layered.exe!_aligned_free_dbg(void * memblock) Line 3129 + 0xd bytes C++
GUI_Layered.exe!_aligned_free(void * memblock) Line 3087 + 0x9 bytes C++
GUI_Layered.exe!CL_PixelBuffer_Impl::~CL_PixelBuff er_Impl() Line 127 + 0x10 bytes C++
GUI_Layered.exe!std::tr1::_Ref_count<CL_PixelBuffer_Impl>::_Destroy() Line 1107 + 0xe bytes C++
GUI_Layered.exe!CL_Win32Window::update_layered_wor ker_thread() Line 2003 + 0x7c bytes C++
GUI_Layered.exe!CL_RunnableMember_v0<CL_Win32Window>::run() Line 108 + 0x4 bytes C++
GUI_Layered.exe!CL_Thread_Win32::thread_main(void * data) Line 94 C++
GUI_Layered.exe!_callthreadstartex() Line 314 + 0xf bytes C
GUI_Layered.exe!_threadstartex(void * ptd) Line 297 C
kernel32.dll!75fd339a()
[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]
ntdll.dll!773a9ed2()
ntdll.dll!773a9ea5()

clanlib4d
12-05-2011, 05:28 PM
My OS: Win7 Pro
My Visual studio is VS2010
lib downloaded from clanlib.org, which are ClanLib-VC10Precompiled-static-mt-Win32-2.3.4 , External-VC10Precompiled-static-mt-Win32, etc.

clanlib4d
12-06-2011, 07:08 AM
Sample in release ClanLib-2.2.12 is OK.:)
So this is bug in release 2.3.4:sweatdrop:, If ..., could fix it in new release (No meaning of push to our volunteer :))?

rombust
12-06-2011, 08:00 AM
I saw a similar error when trying out similar code for linux (now removed)

I assumed that it was a graphics card driver problem, which it still could be?

In: Sources/GL/WGL/opengl_window_provider_wgl.cpp -


void CL_OpenGLWindowProvider_WGL::flip(int interval)
{
...
CL_PixelBuffer pixelbuffer(width, height, cl_r8);
glReadPixels(
0, 0,
width, height,
GL_ALPHA,
GL_BYTE, // use GL_BITMAP here for even less transfer?
pixelbuffer.get_data());
...

}

Changing cl_r8 to cl_rgba8 fixed the problem. Which was very strange, since glReadPixels is reading in a byte per pixel (alpha channel)

I wonder if that fixes it on your computer?