[cairo-bugs] [Bug 91293] New: GLX_NONE != None

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Jul 10 08:08:44 PDT 2015


            Bug ID: 91293
           Summary: GLX_NONE != None
           Product: cairo
           Version: unspecified
          Hardware: Other
                OS: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: gl backend
          Assignee: cairo-bugs at cairographics.org
          Reporter: sixtysix at inwind.it
        QA Contact: cairo-bugs at cairographics.org


>(cd test; DISPLAY=:2 CAIRO_TEST_TARGET=gl valgrind --track-origins=yes .libs/cairo-test-suite -f text-antialias-gray )

valgrind reports:

>==10525== Conditional jump or move depends on uninitialised value(s)
>==10525==    at 0x393C81C995: ??? (in /usr/lib64/libGL.so.1.2.0)
>==10525==    by 0x393C819E11: glXChooseVisual (in /usr/lib64/libGL.so.1.2.0)
>==10525==    by 0x45EDB8: _cairo_boilerplate_gl_create_surface (cairo/boilerplate/cairo-boilerplate-glx.c:123)
>==10525==    by 0x40DD4C: cairo_test_for_target (cairo/test/cairo-test.c:819)
>==10525==    by 0x40EEC1: _cairo_test_context_run_for_target (cairo/test/cairo-test.c:1551)
>==10525==    by 0x40BB13: _cairo_test_runner_draw (cairo/test/cairo-test-runner.c:255)
>==10525==    by 0x40BB13: main (cairo/test/cairo-test-runner.c:937)
>==10525==  Uninitialised value was created by a stack allocation
>==10525==    at 0x45EC40: _cairo_boilerplate_gl_create_surface (cairo/boilerplate/cairo-boilerplate-glx.c:78)

looking what's allocated on the stack in
boilerplate/cairo-boilerplate-glx.c around line 78:


you can see that the attribute list is terminated by GLX_NONE, but
the man page of 'glXChooseVisual' says it must be terminated with None.

on my laptop  grep says:
[massimo at laptop cairo (master *)]$ grep None /usr/include/X11/X.h
#define None                 0L /* universal null resource or null atom */
[massimo at laptop cairo (master *)]$ grep GLX_NONE /usr/include/GL/glx.h
#define GLX_NONE                        0x8000

so they're not interchangeable. And ending the attribute list
with 'None' valgrind does not report this particular warning.

My suggestion here is:

sed -i 's/GLX_NONE/None/' boilerplate/cairo-boilerplate-glx.c
make -C boilerplate libcairoboilerplate.la && make -C test

You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo-bugs/attachments/20150710/68945fc9/attachment.html>

More information about the cairo-bugs mailing list