<div dir="ltr"><div><br>
>If you're able to, make a local build, adding -O0 to cflags, and don't<br>
>strip the debug info. That should show you exactly where the issue<br>
>lies.<br><br></div>I built mesa 12.0.2 using:<br><span style="color:rgb(56,118,29)"><span style="font-family:monospace,monospace">~/src/mesa-12.0.2$ CFLAGS=-O0 ./configure --prefix=$HOME --disable-dri3</span></span><br><br><div>If I LD_PRELOAD the resulting libGL.so then the crash goes away and I see correctly reported:<br>GL_VERSION 3.3 (Core Profile) Mesa 12.0.2<br><br>So maybe it is an old bug, making 11.2.0 affected, but not 12.0.2?<br></div><div>So then I proceeded to build the same version that comes with Ubuntu.<br></div><div><br></div><div>When LD_PRELOAD-ing that libary, I get:<br><span style="font-family:monospace,monospace"><br><span style="color:rgb(56,118,29)">Thread 1 "game" received signal SIGFPE, Arithmetic exception.</span><br><span style="color:rgb(56,118,29)">0x00007fffeecb48e4 in gen7_upload_urb (brw=0x27419b8) at gen7_urb.c:301<br>301 round(hs_wants * (((double) remaining_space) / total_wants));<br>(gdb) where<br>#0 0x00007fffeecb48e4 in gen7_upload_urb (brw=0x27419b8) at gen7_urb.c:301<br>#1 0x00007fffeec95c8c in check_and_emit_atom (brw=0x27419b8, state=0x7ffffffe5500, atom=0x2767860) at brw_state_upload.c:771<br>#2 0x00007fffeec961ea in brw_upload_pipeline_state (brw=0x27419b8, pipeline=BRW_RENDER_PIPELINE) at brw_state_upload.c:882<br>#3 0x00007fffeec962e4 in brw_upload_render_state (brw=0x27419b8) at brw_state_upload.c:904<br>#4 0x00007fffeec76362 in brw_try_draw_prims (ctx=0x27419b8, arrays=0x270d010, prims=0x7ffffffe56c0, nr_prims=1, ib=0x0, min_index=0, max_index=2, indirect=0x0) at brw_draw.c:560<br>#5 0x00007fffeec76785 in brw_draw_prims (ctx=0x27419b8, prims=0x7ffffffe56c0, nr_prims=1, ib=0x0, index_bounds_valid=1 '\001', min_index=0, max_index=2, unused_tfb_object=0x0, stream=0, indirect=0x0)<br> at brw_draw.c:650<br>#6 0x00007fffeec7fcf5 in brw_draw_rectlist (brw=0x27419b8, rect=0x7ffffffe57b0, num_instances=1) at brw_meta_fast_clear.c:219<br>#7 0x00007fffeec80e01 in brw_meta_fast_clear (brw=0x27419b8, fb=0x2722e00, buffers=34, partial_clear=false) at brw_meta_fast_clear.c:777<br>#8 0x00007fffeec63e23 in brw_clear (ctx=0x27419b8, mask=34) at brw_clear.c:244<br>#9 0x00007fffee842f66 in _mesa_Clear (mask=17664) at main/clear.c:224<br>#10 0x00007ffff7ba43fa in glClear (mask=17664) at glapi/glapi_mapi_tmp.h:3068<br>#11 0x0000000000452d4d in Gfx::TargetClear (r=0.0100228256, g=0.0100228256, b=0.039681904, a=1, depth=1, stencil=0) at ../graphics/graphics.cpp:588<br>#12 0x000000000040a739 in Vis::Update (this=0x7ffffffe5d58, elapsed=1.70000007e-07, numsteps=1, dt=0.00416666688, wld=0x7ffffffe91b0) at vis.cpp:511<br>#13 0x0000000000428462 in main (argc=1, argv=0x7fffffffdd78) at main.cpp:106<br>(gdb) l<br>296 vs_chunks += vs_additional;<br>297 remaining_space -= vs_additional;<br>298 total_wants -= vs_wants;<br>299 <br>300 unsigned hs_additional = (unsigned)<br>301 round(hs_wants * (((double) remaining_space) / total_wants));<br>302 hs_chunks += hs_additional;<br>303 remaining_space -= hs_additional;<br>304 total_wants -= hs_wants;<br>305 <br>(gdb) print total_wants<br>$1 = 0<br>(gdb) </span></span><br><br></div><div>Even though 12.0.2 seems unaffected:<br>Ubuntu is using 11.2.0, maybe fixing the v11 tree still makes sense?<br><br></div><div>I'm also puzzled that this division by zero depends on the values I pass to glClearColor before the glClear command, though.<br></div><div><br></div><div>Bram<br><br></div><div>PS: Just a side-note: when I tried re-configuring (after building) my 11.2.0 tree, it choked on pyton mako. I had to delete the entire source tree, and unpack again before I could re-configure.<br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 5, 2016 at 10:19 AM, Ilia Mirkin <span dir="ltr"><<a href="mailto:imirkin@alum.mit.edu" target="_blank">imirkin@alum.mit.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Mon, Sep 5, 2016 at 12:55 PM, Bram Stolk <<a href="mailto:b.stolk@gmail.com">b.stolk@gmail.com</a>> wrote:<br>
> Hey,<br>
><br>
> Do you guys test with Floating-Point-Exceptions enabled?<br>
<br>
</span>I think most people just test with whatever is the default.<br>
<span class=""><br>
> Because on Intel-Haswell, I can trigger a FPE with a simple glClearColor and<br>
> glClear.<br>
> I think glClear is doing bad FP math on Haswell.<br>
><br>
> <a href="https://software.intel.com/en-us/forums/graphics-driver-bug-reporting/topic/681580" rel="noreferrer" target="_blank">https://software.intel.com/en-<wbr>us/forums/graphics-driver-bug-<wbr>reporting/topic/681580</a><br>
<br>
</span>Unfortunately you don't have any debug info for your mesa build.<br>
<span class=""><br>
><br>
> I recommend doing a:<br>
><br>
> feenableexcept( FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW );<br>
><br>
> In your test-suite.<br>
<br>
</span>I did that but was unable to trigger the error on a i7-920 CPU and an<br>
NVIDIA GPU (driven by nouveau) in some simple tests. Perhaps a change<br>
in how HSW reports errors, or could be a HSW- (or gen7+) specific code<br>
path.<br>
<br>
If you're able to, make a local build, adding -O0 to cflags, and don't<br>
strip the debug info. That should show you exactly where the issue<br>
lies.<br>
<br>
Separately, if you can make a small program that reproduces the issue<br>
for you (e.g. with glut + epoxy), that would help others test and<br>
figure out what's going on.<br>
<br>
-ilia<br>
<br>
P.S. for reference, this is the (whitespace-damaged) patch I applied<br>
to piglit for my testing:<br>
<br>
diff --git a/tests/util/piglit-framework-<wbr>gl.h b/tests/util/piglit-framework-<wbr>gl.h<br>
index 81c1a5e..1510fc1 100644<br>
--- a/tests/util/piglit-framework-<wbr>gl.h<br>
+++ b/tests/util/piglit-framework-<wbr>gl.h<br>
@@ -235,6 +235,7 @@ void<br>
piglit_gl_test_run(int argc, char *argv[],<br>
const struct piglit_gl_test_config *config);<br>
<br>
+#include <fenv.h><br>
#ifdef __cplusplus<br>
# define PIGLIT_EXTERN_C_BEGIN extern "C" {<br>
# define PIGLIT_EXTERN_C_END }<br>
@@ -263,6 +264,7 @@ piglit_gl_test_run(int argc, char *argv[],<br>
piglit_disable_error_message_<wbr>boxes(); \<br>
\<br>
piglit_gl_test_config_init(&<wbr>config); \<br>
+ feenableexcept( FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW ); \<br>
\<br>
config.init = piglit_init; \<br>
config.display = piglit_display; \<br>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Owner/Director of Game Studio Abraham Stolk Inc.</div><div>Vancouver BC, Canada</div><div><a href="mailto:b.stolk@gmail.com" target="_blank">b.stolk@gmail.com</a></div><div><br></div></div></div>
</div>