Subject: valgrind: does not notice Intel DRI mapping in client process
Package: valgrind
Version: 1:3.14.0-3
Severity: normal
Tags: upstream

Hi,

I'm trying to debug a program that renders using OpenGL, so for direct
rendering, a portion of video ram is directly mapped into client address
space for the command queue. Valgrind doesn't notice this mapping being
made, so all commands are treated as invalid accesses:

==7997== Invalid write of size 4
==7997==    at 0x4EDAFBD2: ??? (in /usr/lib/x86_64-linux-gnu/dri/i965_dri.so)
==7997==    by 0x285B0242: ??? (in 
/usr/lib/x86_64-linux-gnu/libGLX_mesa.so.0.0.0)
==7997==    by 0x4891C5A: wxGLCanvasX11::SwapBuffers() (glx11.cpp:604)
[...]
==7997==  Address 0x7fea79042944 is not stack'd, malloc'd or (recently) free'd

The mapping can be found in /proc/7997/maps:

[...]
7fea76937000-7fea77037000 rw-s 00000000 00:18 7365028                    /i915 
(deleted)
7fea77037000-7fea79037000 rw-s 00000000 00:18 7366173                    /i915 
(deleted)
7fea79037000-7fea7903b000 rw-s 00000000 00:18 7369037                    /i915 
(deleted)
7fea7903b000-7fea7903f000 rw-s 00000000 00:18 7369035                    /i915 
(deleted)
7fea7903f000-7fea79044000 rw-s 00000000 00:18 7369034                    /i915 
(deleted)

This generates a few thousand error messages for each drawing operation,
and valgrind soon stops reporting errors.

It appears as if the memory is mapped through the DRM_IOCTL_I915_GEM_MMAP
ioctl on the DRM device.

   Simon

- -- System Information:
Debian Release: 10.1
  APT prefers stable
  APT policy: (990, 'stable'), (500, 'stable-updates'), (500, 'stable-debug')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, armhf

Kernel: Linux 4.19.0-5-amd64 (SMP w/8 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=ANSI_X3.4-1968) 
(ignored: LC_ALL set to C), LANGUAGE=de_DE.UTF-8 (charmap=ANSI_X3.4-1968) 
(ignored: LC_ALL set to C)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
LSM: AppArmor: enabled

Versions of packages valgrind depends on:
ii  libc6      2.28-10
ii  libc6-dbg  2.28-10

Versions of packages valgrind recommends:
ii  gdb           8.2.1-2+b1
ii  valgrind-dbg  1:3.14.0-3

Versions of packages valgrind suggests:
pn  alleyoop      <none>
pn  kcachegrind   <none>
pn  valgrind-mpi  <none>
pn  valkyrie      <none>

- -- no debconf information
-----BEGIN PGP SIGNATURE-----

iQEyBAEBCgAdFiEEtjuqOJSXmNjSiX3Tfr04e7CZCBEFAl2o5V8ACgkQfr04e7CZ
CBFAsQf40e/X0514ViMhCmL39Cy0cotKtjSKcbCEoVGHprTYU0MASitWIGqE1JGs
54pVZC/FCWV7N7EnElU2hHOaN5kbQOfWfvri+5XURupn9YiVd7Rj+THI2exGXFw2
aQEWIGhowjRh7s84CI8bkb3FgOqX5MxE8Mncypxi5O9bCmDzujwuMcm9if5zLFdh
Mk4b1CYtTffx9Ua5Qo7z/yXa/4QnkAOTn6iA9g3FJhAJzC59bPUmCJI2nG4YGBjz
HCPRGS10AFEyUbQfYrDWxsIUG32suulqMbjo41yVLTXr4GNqdBAHhnanQBQShcNB
O+tNmrrmIPt2DpFXN7ZyH5fkQduE
=LWj0
-----END PGP SIGNATURE-----

Reply via email to