0

This is my first time working with vlagrind and I am wondering if those errors are something sirious, I should worry about or just ignore them. My program is just simple SDL2 2D space game and i have no clue where those memory leaks could come from.

==9173== Conditional jump or move depends on uninitialised value(s)
==9173==    at 0xA0E1343: ??? (in /usr/lib/x86_64-linux-gnu/libLLVM-10.so.1)
==9173==    by 0xA0215E7: llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (in /usr/lib/x86_64-linux-gnu/libLLVM-10.so.1)
==9173==    by 0x9E8BD75: llvm::FPPassManager::runOnFunction(llvm::Function&) (in /usr/lib/x86_64-linux-gnu/libLLVM-10.so.1)
==9173==    by 0x9E8BFF2: llvm::FPPassManager::runOnModule(llvm::Module&) (in /usr/lib/x86_64-linux-gnu/libLLVM-10.so.1)
==9173==    by 0x9E8C49F: llvm::legacy::PassManagerImpl::run(llvm::Module&) (in /usr/lib/x86_64-linux-gnu/libLLVM-10.so.1)
==9173==    by 0xAFD7B34: llvm::MCJIT::emitObject(llvm::Module*) (in /usr/lib/x86_64-linux-gnu/libLLVM-10.so.1)
==9173==    by 0xAFD7F1D: llvm::MCJIT::generateCodeForModule(llvm::Module*) (in /usr/lib/x86_64-linux-gnu/libLLVM-10.so.1)
==9173==    by 0xAFD86AD: llvm::MCJIT::finalizeObject() (in /usr/lib/x86_64-linux-gnu/libLLVM-10.so.1)
==9173==    by 0xAF9C87F: LLVMGetPointerToGlobal (in /usr/lib/x86_64-linux-gnu/libLLVM-10.so.1)
==9173==    by 0x84B0041: ??? (in /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so)
==9173==    by 0x84A49EF: ??? (in /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so)
==9173==    by 0x8490937: ??? (in /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so)

And here it is mentioning some memory leak. But i have checked my code for leaks so many times that i think it must be in SDL library.

17 bytes in 1 blocks are definitely lost in loss record 10 of 1,977
==9173==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==9173==    by 0x4EC85A6: _XlcDefaultMapModifiers (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==9173==    by 0x4EC897A: XSetLocaleModifiers (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==9173==    by 0x4923824: ??? (in /home/coder/Desktop/game/libSDL2-2.0.so.0)
==9173==    by 0x492A45A: ??? (in /home/coder/Desktop/game/libSDL2-2.0.so.0)
==9173==    by 0x48FCF6A: ??? (in /home/coder/Desktop/game/libSDL2-2.0.so.0)
==9173==    by 0x486C8E6: ??? (in /home/coder/Desktop/game/libSDL2-2.0.so.0)
==9173==    by 0x10972A: main (projekt.c:115)
==9173== 
==9173== 112 (56 direct, 56 indirect) bytes in 1 blocks are definitely lost in loss record 1,922 of 1,977
==9173==    at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==9173==    by 0x880D07E: ???
==9173==    by 0x8488C3B: ???
==9173==    by 0x84737A5: ???
==9173==    by 0x847386C: ???
==9173==    by 0x8474479: ???
==9173==    by 0x8437A33: ???
==9173==    by 0x843A35C: ???
==9173==    by 0x84352BC: ???
==9173==    by 0x83F8357: ???
==9173==    by 0x841C33D: ???
==9173==    by 0x8419C76: ???
==9173== 
==9173== LEAK SUMMARY:
==9173==    definitely lost: 73 bytes in 2 blocks
==9173==    indirectly lost: 56 bytes in 1 blocks
==9173==      possibly lost: 0 bytes in 0 blocks
==9173==    still reachable: 330,333 bytes in 2,678 blocks
==9173==         suppressed: 0 bytes in 0 blocks

Could someone explain me what those errors mean?

1 Answers1

1

This kind of library will always have some leaks, unfortunately. You can check this post for further details or find more answers on the SDL / OpenGL / Any graphic library you want, but long story short, it will almost always happen. All the leaks you should focus on are the ones which are traced back to the code you wrote yourself.

I recommend launching valgrind --leak-check=full --show-reachable=yes instead of just valgrind, it will display your errors more precisely.

  • Thanks for your help. So these leaks are not in my code but in library itself? And what should i do about: Conditional jump or move depends on uninitialised value. –  Oct 05 '20 at 16:40
  • You can use Valgrind's --track-origins=yes, to deal with uninitialized values in conditional jumps (ifs, loops) – iTs.SL4y3R Oct 05 '20 at 16:45