Bug 35071 - Valgrind warnings in _mesa_texstore_argb8888
Summary: Valgrind warnings in _mesa_texstore_argb8888
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: 7.10
Hardware: Other All
: lowest enhancement
Assignee: Chris Wilson
QA Contact:
Depends on:
Reported: 2011-03-06 16:00 UTC by Lionel Landwerlin
Modified: 2012-02-11 03:46 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Note You need to log in before you can comment on or make changes to this bug.
Description Lionel Landwerlin 2011-03-06 16:00:20 UTC
Here are a couple of warnings from valgrind when running a Clutter application :

==4768== Invalid write of size 4
==4768==    at 0xFBA3372: _mesa_texstore_argb8888 (texstore.c:1505)
==4768==    by 0xFAD8FFF: intelTexImage (intel_tex_image.c:500)
==4768==    by 0xFAD9BC2: intelTexImage2D (intel_tex_image.c:549)
==4768==    by 0xFB92D9B: teximage (teximage.c:2435)
==4768==    by 0xFB932F3: _mesa_TexImage2D (teximage.c:2489)
==4768==    by 0x5F8271C: _cogl_texture_driver_upload_to_gl (cogl-texture-driver-gl.c:200)
==4768==    by 0x5FAEAA5: _cogl_texture_2d_new_from_bitmap (cogl-texture-2d.c:309)
==4768==    by 0x5FAD5EC: cogl_texture_new_from_bitmap (cogl-texture.c:452)
==4768==    by 0x5FAD8CB: cogl_texture_new_from_data (cogl-texture.c:431)
==4768==    by 0x5F8A509: _cogl_context_get_default (cogl-context.c:266)
==4768==    by 0x5F8AA3A: cogl_get_features (cogl.c:384)
==4768==    by 0x5F3550E: _clutter_feature_init (clutter-feature.c:110)
==4768==  Address 0x7f51b5887000 is not stack'd, malloc'd or (recently) free'd

==4768== Invalid write of size 4
==4768==    at 0xFBA3372: _mesa_texstore_argb8888 (texstore.c:1505)
==4768==    by 0xFAD8FFF: intelTexImage (intel_tex_image.c:500)
==4768==    by 0xFAD9BC2: intelTexImage2D (intel_tex_image.c:549)
==4768==    by 0xFB94D1D: _mesa_get_fallback_texture (texobj.c:767)
==4768==    by 0xFB98245: _mesa_update_texture (texstate.c:592)
==4768==    by 0xFB87988: _mesa_update_state_locked (state.c:588)
==4768==    by 0xFB87E70: _mesa_update_state (state.c:674)
==4768==    by 0xFB53FE6: find_value (get.c:1688)
==4768==    by 0xFB54A97: _mesa_GetIntegerv (get.c:1991)
==4768==    by 0x5FB8F10: _cogl_framebuffer_flush_state (cogl-framebuffer.c:659)
==4768==    by 0x5FB935F: _cogl_framebuffer_clear4f (cogl-framebuffer.c:381)
==4768==    by 0x5F42B8B: _clutter_do_pick (clutter-main.c:614)
==4768==  Address 0x7f51b5880000 is not stack'd, malloc'd or (recently) free'd
Comment 1 Chris Wilson 2011-03-07 00:53:38 UTC
valgrind doesn't know that the mmapping is valid.
Comment 2 Eric Anholt 2011-03-11 10:21:59 UTC
I forget what the conclusion was on whether we would ever be able to convince valgrind that mmap had actually happened, inside of libdrm.  There were patches floating around at one point.
Comment 3 Chris Wilson 2012-02-11 03:46:55 UTC
commit 90b23cc24c19fbe131d84237c55311cafeb4ca21
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Feb 9 10:23:10 2012 +0000

    intel: Mark up with valgrind intrinsics to reduce false positives
    In particular, declare the hidden CPU mmaps to valgrind so that it knows
    about those memory regions.
    v2: Add an additional VG_CLEAR for the getparam
    References: https://bugs.freedesktop.org/show_bug.cgi?id=35071
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
    Acked-by: Ben Widawsky <ben@bwidawsk.net>
    [anholt: Ideally valgrind should just learn about the ioctls, and
             removing the clear for the non-valgrindified code feels risky.]
    Reviewed-by: Eric Anholt <eric@anholt.net>

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct.