Bug 111001

Summary: Valgrind show a lot of invalid read/write when running Godot Engine
Product: Mesa Reporter: Rafał <synaptykq>
Component: OtherAssignee: mesa-dev
Status: RESOLVED INVALID QA Contact: mesa-dev
Severity: normal    
Priority: medium    
Version: git   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Valgrind Laptop

Description Rafał 2019-06-26 10:21:57 UTC
Created attachment 144638 [details]
Valgrind Laptop

Hi,
I tried to use valgrind on laptop, but it shows a lot of invalid reads/writes when running Godot(log Valgrind.txt). 
On system with Nvidia(PC Specs below) this error doesn't occurs.

To reproduce bug probably Godot must be compiled from source(howto https://docs.godotengine.org/en/latest/development/compiling/compiling_for_x11.html)

git clone https://github.com/godotengine/godot.git
cd godot
scons p=x11 -j3
bin/godot.x11.tools.64


When I open it
My Laptop Specs:
 Intel HD 3000
 Intel i3 2330m
 Ubuntu 19.04
 Mesa 19.2.0-devel - padoka PPA
My PC Specs:
 Intel i7 4770K
 Nvidia GTX 970, 430.26

Valgrind commmand

valgrind --log-file="/home/rafal/valgrind.txt" --leak-check=full --show-leak-kinds=definite --child-silent-after-fork=yes godot

(--child-silent-after-fork is needed because https://github.com/godotengine/godot/issues/29844#issuecomment-502772087)
Comment 1 Rafał 2019-06-26 10:26:15 UTC
This error probably also doesn't occur on Fedora 27 with RX580 Mesa - 17.2.4 - https://github.com/godotengine/godot/issues/16214#issuecomment-361773504
Comment 2 Rafał 2019-06-26 11:11:31 UTC
Oh, nevermind
I found that this bug is over six year old - https://www.phoronix.com/scan.php?page=news_item&px=MTQzNjk
Comment 3 Jason Ekstrand 2019-06-26 12:47:18 UTC
The real issue here is that we have lots of GPU allocations that don't come in through libc so valgrind doesn't know about them.  Valgrind then complains every time we touch these allocations from the CPU even though it's totally valid.  If you install the valgrind-devel package and build mesa yourself, it should detect valgrind and add hints to the driver to help valgrind out errors will go away.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.