What does valgrind mean by "jump to invalid address" here?
Asked Answered
P

1

9
valgrind --leak-check=full ./CH02_HelloTriangle 
==11404== Memcheck, a memory error detector
==11404== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==11404== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==11404== Command: ./CH02_HelloTriangle
==11404== 
==11404== Jump to the invalid address stated on the next line
==11404==    at 0x0: ???
==11404==    by 0x6F9271A: ??? (in /usr/lib/fglrx/dri/fglrx_dri.so)
==11404==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==11404== 
==11404== 
==11404== Process terminating with default action of signal 11 (SIGSEGV)
==11404==  Bad permissions for mapped region at address 0x0
==11404==    at 0x0: ???
==11404==    by 0x6F9271A: ??? (in /usr/lib/fglrx/dri/fglrx_dri.so)
==11404== 
==11404== HEAP SUMMARY:
==11404==     in use at exit: 144,423 bytes in 407 blocks
==11404==   total heap usage: 1,009 allocs, 602 frees, 189,993 bytes allocated
==11404== 
==11404== LEAK SUMMARY:
==11404==    definitely lost: 0 bytes in 0 blocks
==11404==    indirectly lost: 0 bytes in 0 blocks
==11404==      possibly lost: 0 bytes in 0 blocks
==11404==    still reachable: 144,423 bytes in 407 blocks
==11404==         suppressed: 0 bytes in 0 blocks
==11404== Reachable blocks (those to which a pointer was found) are not shown.
==11404== To see them, rerun with: --leak-check=full --show-reachable=yes
==11404== 
==11404== For counts of detected and suppressed errors, rerun with: -v
==11404== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 2 from 2)
Segmentation fault (core dumped)

What is the problem exactly ?

If i run this application it just exit with a segmentation fault error, it's an OpenGL ES 2.0 application compiled with the AMD GLES SDK for desktop.

This the source for this application.

Penitentiary answered 12/9, 2012 at 20:58 Comment(4)
Have you tried running this under just a typical debugger? This doesn't look like a memory leak, but rather some kind of null pointer exception, and I'm not sure if Valgrind is the appropriate tool for debugging NPE.Konstanze
@Konstanze i do not have the debug version of this OpenGL ES library and i do not know of other tools that are good for this that i can use without a debug library.Penitentiary
I don't think you need to debug the OGLES library, but rather just make sure that your application which calls it does not pass null values to the api calls. You could just step through the code in whatever IDE your particular language uses.Konstanze
@Konstanze the code is short and not complex at all, i really don't know what is wrong with this code.google.com/p/opengles-book-samples/source/browse/trunk/… code, also all the other inclusions are headers ...Penitentiary
H
10

The code in /usr/lib/fglrx/dri/fglrx_dri.so is jumping through a null function pointer.

Of course the real question is why, but as that is proprietary closed source code you have no easy way of finding out. If you are calling any functions in that code which take function pointers as callbacks then making sure you're not passing null pointers to them would be a good start.

Basically though this isn't a problem that valgrind is likely to help you find I'm afraid, and it certainly isn't anything to do with a memory leak.

Honky answered 14/9, 2012 at 9:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.