So, I'm new to this, and I'm not sure if it's a mac-specific thing, or  
a general issue... Be gentle :)

I'm trying to run my application under valgrind, and it's failing when  
I initialise the OpenGL context... I get the debug log:

==50304==  ... (snipped)
==50304== Process terminating with default action of signal 11 (SIGSEGV)
==50304==  Access not within mapped region at address 0x187E7108
==50304==    at 0x1466316: memcpy (mc_replace_strmem.c:482)
==50304==    by 0x16050DFA: gldGetTextureLevel (in /System/Library/ 
Extensions/GeForce8xxxGLDriver.bundle/Contents/MacOS/ 
GeForce8xxxGLDriver)
==50304==    by 0x160528A0: gldGetTextureLevel (in /System/Library/ 
Extensions/GeForce8xxxGLDriver.bundle/Contents/MacOS/ 
GeForce8xxxGLDriver)
==50304==    by 0x160EBA76: gldGetTextureLevel (in /System/Library/ 
Extensions/GeForce8xxxGLDriver.bundle/Contents/MacOS/ 
GeForce8xxxGLDriver)
==50304==    by 0x160EBDDA: gldGetTextureLevel (in /System/Library/ 
Extensions/GeForce8xxxGLDriver.bundle/Contents/MacOS/ 
GeForce8xxxGLDriver)
==50304==    by 0x1606ED55: gldGetTextureLevel (in /System/Library/ 
Extensions/GeForce8xxxGLDriver.bundle/Contents/MacOS/ 
GeForce8xxxGLDriver)
==50304==    by 0x15FEA6CE: gldAllocVertexBuffer (in /System/Library/ 
Extensions/GeForce8xxxGLDriver.bundle/Contents/MacOS/ 
GeForce8xxxGLDriver)
==50304==    by 0x15FEA7D0: gldAllocVertexBuffer (in /System/Library/ 
Extensions/GeForce8xxxGLDriver.bundle/Contents/MacOS/ 
GeForce8xxxGLDriver)
==50304==    by 0x15FC9EFB: gldCreateContext (in /System/Library/ 
Extensions/GeForce8xxxGLDriver.bundle/Contents/MacOS/ 
GeForce8xxxGLDriver)
==50304==    by 0x15E1387C: gliCreateContext (in /System/Library/ 
Frameworks/OpenGL.framework/Versions/A/Resources/GLEngine.bundle/ 
GLEngine)
==50304==    by 0x24F58E7: cglInitializeContext (in /System/Library/ 
Frameworks/OpenGL.framework/Versions/A/OpenGL)
==50304==    by 0x24F51DD: CGLCreateContext (in /System/Library/ 
Frameworks/OpenGL.framework/Versions/A/OpenGL)
==50304==  If you believe this happened as a result of a stack
==50304==  overflow in your program's main thread (unlikely but
==50304==  possible), you can try to increase the size of the
==50304==  main thread stack using the --main-stacksize= flag.
==50304==  The main thread stack size used in this run was 8388608.
--50304:0:schedule VG_(sema_down): read returned -4
==50304==
==50304== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 23 from  
2)
==50304== malloc/free: in use at exit: 6,482,048 bytes in 23,552 blocks.
==50304== malloc/free: 110,105 allocs, 86,553 frees, 17,010,063 bytes  
allocated.
==50304== For counts of detected errors, rerun with: -v
==50304== searching for pointers to 23,552 not-freed blocks.
==50304== checked 47,251,752 bytes.
==50304==
==50304== LEAK SUMMARY:
==50304==    definitely lost: 272 bytes in 17 blocks.
==50304==    indirectly lost: 6,828 bytes in 12 blocks.
==50304==      possibly lost: 868,510 bytes in 2,184 blocks.
==50304==    still reachable: 5,600,608 bytes in 21,197 blocks.
==50304==         suppressed: 5,830 bytes in 142 blocks.
==50304== Rerun with --leak-check=full to see details of leaked memory.


I've been playing with suppressions because the above are OS-internal  
issues, and eventually (after failing to stop the SIGSEGV being sent),  
my 'valgrind' file looks like:

-----8<-----8<----- Snip here -----8<-----8<-----
{
    GL context creation
    Memcheck:Addr16
    fun:memcpy
    ...
    fun:CGLCreateContext
}

{
    GL context creation
    Memcheck:Addr8
    fun:memcpy
    ...
    fun:CGLCreateContext
}

{
    GL context creation
    Memcheck:Addr4
    fun:memcpy
   ...
    fun:CGLCreateContext
}

{
    GL context creation
    Memcheck:Addr2
    fun:memcpy
    ...
    fun:CGLCreateContext
}

{
    GL context creation
    Memcheck:Addr1
    fun:memcpy
    ...
    fun:CGLCreateContext
}

-----8<-----8<----- Snip here -----8<-----8<-----

I started off with more-specific suppressions, but even with the  
above, the application is aborted every time I run. As far as I can  
tell from the manual, *any* access with a chain starting with  
'CGLCreateContext' and ending with 'memcpy' ought to be ignored by  
memcheck... Either I'm missing something, or I've tickled a bug... I  
tried making the stack larger, but that made no difference ...

Any help gratefully received :)

Simon




------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to