On Wednesday, June 11, 2014 11:02:34 PM Matt Turner wrote: > How did you notice this? (More specifically than semicolons being > printed in your terminals!) > > Reviewed-by: Matt Turner <matts...@gmail.com>
I wrote a patch that altered the Meta GLSL clear shaders, and ran Piglit. Basically all of tests/hiz failed, along with some other random tests. When I looked at the Piglit output, I noticed that stdout was: ;;PIGLIT: {'result': 'pass' } I then reverted my patch, and discovered the bonus semicolons were gone. I checked my code for printfs - none. I ran valgrind - nothing. I used gdb and put breakpoints on printf, fprintf, and various other output functions. Nothing. I grepped the Mesa source code for print statements with semicolons not followed by whitespace or other text. Nothing. I grepped the Piglit code. Nothing. I finally gave up and started over, retyping my patch from scratch, one line at a time, compiling and running the hiz test with each change, looking for semicolons. Eventually, I got around to adding my shader source line: "#extension GL_AMD_vertex_shader_layer : enable;\n" and suddenly the semicolons appeared. So I knew it was something in the GLSL compiler, related to extension handling. I put breakpoints before and after the preprocessor ran, and did: (gdb) call printf("\n"); to flush out the semicolons. Nothing. I tried before and after the main lexer/parser. Semicolons. I put a breakpoint in _mesa_glsl_process_extension. Semicolons. I noticed the parser rule shouldn't accept ';', but apparently was anyway. I added it. Suddenly, no semicolon output. I looked at the lexer...and realized the normal rule for "." didn't apply, since non-annotated rules only happen in the initial state. That was the strangest bug I've tracked down in a while. You always think the actual executable code you add will have the bug. But it wasn't - it was the (const char *) string data that tripped up an existing bug. --Ken
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev