Getting strange readings with valgrind

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Ceultem
Posts: 7
Joined: Sat Feb 25, 2017 10:44 am

Getting strange readings with valgrind

Post by Ceultem »

Hi! :) I have just recently started to program with Irrlicht, and I'm not yet very used to it. I'm programming on Linux-based os (Debian), and recently decided to run one of my programs with valgrinds memcheck tool. Valgrind spit out a huge ammount of different errors like this:

Code: Select all

 
==2311== Invalid write of size 1
==2311==    at 0x8D9D5FF: ??? (in /usr/lib/x86_64-linux-gnu/dri/fglrx_dri.so)
==2311==    by 0x1E0B97BF1F: ???
==2311==    by 0xB087F3F: ???
==2311==  Address 0x7ffaec5e6e2e is not stack'd, malloc'd or (recently) free'd
==2311== 
==2311== Invalid write of size 4
==2311==    at 0x8E080F6: ??? (in /usr/lib/x86_64-linux-gnu/dri/fglrx_dri.so)
==2311==    by 0x1010000: ???
==2311==  Address 0x7ffaec62c9e0 is not stack'd, malloc'd or (recently) free'd
==2311== 
==2311== Invalid write of size 8
==2311==    at 0x8E080D7: ??? (in /usr/lib/x86_64-linux-gnu/dri/fglrx_dri.so)
==2311==    by 0x1010000: ???
==2311==  Address 0x7ffaec62c9e4 is not stack'd, malloc'd or (recently) free'd
The huge ammount of errors soon resulted in the message:
==2311== More than 10000000 total errors detected. I'm not reporting any more.
==2311== Final error counts will be inaccurate. Go fix your program!

What is interesting is that despite the errors, my program seems to run just fine. I have also downloaded the tutorial example sources from the Irrlicht website and compiled them with the provided makefiles. I tested the tutorial binaries with valgrind also, and got the same errors with most of them. So the problem probably isn't in my code. I suspect that there's something wrong with my setup. Any ideas on how I could fix this? In theory I could live with these errors, since myprograms are usually running just fine, but these errors make it quite hard to debug the programs. :D

EDIT:
The errors are referring to fglrx_dri.so. I have an AMD based GPU, and the fglrx_dri.so seems to have something to do with the AMD drivers. I still have no idea how to fix this problem, though. :?

EDIT 2:
The problem doesn't occur if using software rendering. Also, intrestingly I can run the first tutorial with openGL rendering without any errors, while most of the other tutorial programs do produce the errors.
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Getting strange readings with valgrind

Post by hendu »

The bug is in the AMD driver, not your program. Also, you should move to the open driver, AMD's blob is bad quality.
Ceultem
Posts: 7
Joined: Sat Feb 25, 2017 10:44 am

Re: Getting strange readings with valgrind

Post by Ceultem »

I know. :D I used to use the open source driver before, but sadly some games don't work with it. In general I do try to use open source software when possible. Maybe I should have two OS installations, one with the closed driver, and an other one with the open source driver. :D But so, if the bug is in the binary driver, then the only solution to fix this would be to start using the open source driver, right?
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Getting strange readings with valgrind

Post by hendu »

Yes. If you used the one shipped by Debian, it was likely years old; the latest one runs most games better than AMD's blob, see Phoronix.
Post Reply