<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>4954</bug_id>
          
          <creation_ts>2013-07-30 10:58:39 +0000</creation_ts>
          <short_desc>Crash running glmark2-es2 on i.MX6</short_desc>
          <delta_ts>2013-09-04 19:45:28 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>BSPs</product>
          <component>bsps-meta-fsl-arm</component>
          <version>1.5</version>
          <rep_platform>Other</rep_platform>
          <op_sys>arm</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.5</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Diego">diego.ml</reporter>
          <assigned_to name="Daiane">angolini</assigned_to>
          <cc>b07273</cc>
    
    <cc>otavio</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>New (Never tested)</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>35160</commentid>
    <comment_count>0</comment_count>
    <who name="Diego">diego.ml</who>
    <bug_when>2013-07-30 10:58:39 +0000</bug_when>
    <thetext>glmark2-es2 crashes after running the jellyfish benchmark in a fsl-image-gui-sdk image for machine nitrogen6x. I think this issue is present on all Vivante GPU based boards.

How to reproduce:
- build a fsl-image-gui-sdk
- bitbake glmark2
- install libpng12 and glmark2 on the image
- run the test with &quot;glmark2-es2 --fullscreen&quot;
- get the crash after the jellyfish benchmark


Output and backtrace:

# export DISPLAY=:0
# gdb glmark2-es2
GNU gdb (GDB) 7.6
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later &lt;http://gnu.org/licenses/gpl.html&gt;
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type &quot;show copying&quot;
and &quot;show warranty&quot; for details.
This GDB was configured as &quot;arm-poky-linux-gnueabi&quot;.
For bug reporting instructions, please see:
&lt;http://www.gnu.org/software/gdb/bugs/&gt;...
Reading symbols from /usr/bin/glmark2-es2...Reading symbols from /usr/bin/.debug/glmark2-es2...done.
done.
(gdb) run --fullscreen
Starting program: /usr/bin/glmark2-es2 --fullscreen
[Thread debugging using libthread_db enabled]
Using host libthread_db library &quot;/lib/libthread_db.so.1&quot;.
=======================================================
    glmark2 2012.12
=======================================================
    OpenGL Information
    GL_VENDOR:     Vivante Corporation
    GL_RENDERER:   GC2000 core
    GL_VERSION:    OpenGL ES 2.0
=======================================================
[build] use-vbo=false: FPS: 219 FrameTime: 4.566 ms
[build] use-vbo=true: FPS: 271 FrameTime: 3.690 ms
[texture] texture-filter=nearest: FPS: 163 FrameTime: 6.135 ms
[texture] texture-filter=linear: FPS: 148 FrameTime: 6.757 ms
[texture] texture-filter=mipmap: FPS: 173 FrameTime: 5.780 ms
[shading] shading=gouraud: FPS: 163 FrameTime: 6.135 ms
[shading] shading=blinn-phong-inf: FPS: 156 FrameTime: 6.410 ms
[shading] shading=phong: FPS: 124 FrameTime: 8.065 ms
[bump] bump-render=high-poly: FPS: 140 FrameTime: 7.143 ms
[bump] bump-render=normals: FPS: 168 FrameTime: 5.952 ms
[bump] bump-render=height: FPS: 150 FrameTime: 6.667 ms
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 64 FrameTime: 15.625 ms
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 27 FrameTime: 37.037 ms
[pulsar] light=false:quads=5:texture=false: FPS: 17 FrameTime: 58.824 ms
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 5 FrameTime: 200.000 ms
[desktop] effect=shadow:windows=4: FPS: 27 FrameTime: 37.037 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 58 FrameTime: 17.241 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 49 FrameTime: 20.408 ms
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 85 FrameTime: 11.765 ms
[ideas] speed=duration: FPS: 73 FrameTime: 13.699 ms
[jellyfish] &lt;default&gt;: FPS: 74 FrameTime: 13.514 ms
Error: Failed to link program created from files None and None:  
Alignment trap: glmark2-es2 (1986) PC=0x2afb5400 Instr=0xe8931001 Address=0x71a8ddeb FSR 0x001

Program received signal SIGSEGV, Segmentation fault.
_CompactHeap (Heap=&lt;optimized out&gt;) at gc_hal_user_heap.c:264
264     gc_hal_user_heap.c: No such file or directory.
(gdb) bt
#0  _CompactHeap (Heap=&lt;optimized out&gt;) at gc_hal_user_heap.c:264
#1  gcoHEAP_Allocate (Heap=0x10f028, Bytes=Bytes@entry=64, Memory=0x7effdd8c, 
    Memory@entry=0x7effdd84) at gc_hal_user_heap.c:771
#2  0x2b0485ac in gcoOS_Allocate (Os=Os@entry=0x0, Bytes=Bytes@entry=64, 
    Memory=Memory@entry=0x7effdd84) at gc_hal_user_os.c:1436
#3  0x340265bc in sloCOMPILER_Allocate (Compiler=0x33128f40, 
    Bytes=Bytes@entry=56, Memory=0x7effddbc, Memory@entry=0x7effddb4)
    at gc_glsl_compiler.c:1290
#4  0x3405b6cc in ppoTOKEN_Construct (PP=PP@entry=0x33128e20, 
    File=0x3406ab60 &quot;gc_glsl_input_stream.c&quot;, Line=Line@entry=647, 
    MoreInfo=0x3406acd8 &quot;ppoPREPROCESSOR_CBIS_GetToken : Creat sematic value.&quot;, Created=0x7effde00, Created@entry=0x7effddf8) at gc_glsl_token.c:114
#5  0x3405653c in ppoBYTE_INPUT_STREAM_GetToken (PP=0x33128e20, Is=0x33128e54, 
    Token=0x7effe228, WhiteSpace=0) at gc_glsl_input_stream.c:640
#6  0x34058630 in ppoPREPROCESSOR_TextLine (PP=PP@entry=0x33128e20)
    at gc_glsl_syntax.c:1449
#7  0x34059e00 in ppoPREPROCESSOR_GroupPart (PP=PP@entry=0x33128e20)
    at gc_glsl_syntax.c:473
#8  0x3405a184 in ppoPREPROCESSOR_Group (PP=PP@entry=0x33128e20)
    at gc_glsl_syntax.c:298
#9  0x3405ace4 in ppoPREPROCESSOR_PreprocessingFile (PP=PP@entry=0x33128e20)
    at gc_glsl_syntax.c:111
#10 0x34055350 in ppoPREPROCESSOR_Parse (PP=0x33128e20, PP@entry=0x2000, 
---Type &lt;return&gt; to continue, or q &lt;return&gt; to quit---
    Buffer=Buffer@entry=0x119784 &quot;&quot;, Max=Max@entry=8190, 
    WriteInNumber=0x7effe2ec, WriteInNumber@entry=0x119784)
    at gc_glsl_preprocessor.c:1130
#11 0x34053d90 in sloPREPROCESSOR_Parse (Preprocessor=0x2000, MaxSize=8190, 
    MaxSize@entry=8192, Buffer=Buffer@entry=0x119784 &quot;&quot;, ActualSize=0x119784, 
    ActualSize@entry=0x7effe2e4) at gc_glsl_api.c:135
#12 0x34026d84 in slInput (MaxSize=8192, Buffer=0x119784 &quot;&quot;)
    at gc_glsl_compiler.c:1573
#13 0x34047188 in yy_get_next_buffer () at gc_glsl_scanner.c:1337
#14 0x34047a70 in sloCOMPILER_Scan (Compiler=0x34065f18 &lt;yy_ec&gt;, 
    Compiler@entry=0x33128f40, Token=0x33128f40, Token@entry=0x7effe3f0)
    at gc_glsl_scanner.c:1172
#15 0x34042bb4 in yylex (pyylval=pyylval@entry=0x7effe3f0, 
    Compiler=Compiler@entry=0x33128f40) at gc_glsl_parser_misc.c:39
#16 0x34052924 in yyparse (Compiler=Compiler@entry=0x33128f40)
    at gc_glsl_parser.c:1793
#17 0x34042d88 in sloCOMPILER_Parse (Compiler=Compiler@entry=0x33128f40, 
    StringCount=StringCount@entry=1, Strings=0x7efff28c, 
    Strings@entry=0x7efff584) at gc_glsl_parser_misc.c:171
#18 0x340279f0 in sloCOMPILER_Compile (Compiler=0x33128f40, 
    OptimizationOptions=OptimizationOptions@entry=65535, 
    DumpOptions=DumpOptions@entry=0, StringCount=StringCount@entry=1, 
    Strings=0x7efff28c, Strings@entry=0x7efff284, Binary=0x33129b84, 
---Type &lt;return&gt; to continue, or q &lt;return&gt; to quit---
    Binary@entry=0x10d8fc &lt;std::string::_Rep::_S_empty_rep_storage+12&gt;, 
    Log=0x33129b80, Log@entry=0x2ac53bac &lt;_glshCompileShader+60&gt;)
    at gc_glsl_compiler.c:754
#19 0x34025d74 in gcCompileShader (Hal=0x0, ShaderType=2, SourceSize=1184, 
    Source=0x2ad66f54 &lt;typeinfo for std::ctype&lt;char&gt;&gt; &quot;`n\326*|\026\325*&quot;, 
    Binary=0x33129b84, Log=0x33129b80) at gc_glsl_entry.c:278
#20 0x2ac53bac in _glshCompileShader (Context=Context@entry=0x338bf0e8, 
    ShaderType=&lt;optimized out&gt;, SourceSize=1184, Source=&lt;optimized out&gt;, 
    Binary=Binary@entry=0x33129b84, Log=Log@entry=0x33129b80)
    at gc_glsh_compiler.c:397
#21 0x2ac622e4 in glshCompileShader (Context=0x338bf0e8, Shader=0x33129b60)
    at gc_glsh_shader.c:510
#22 0x000ecb0c in Shader::compile (this=0x7efff514, this@entry=0x7efff50c)
    at ../src/libmatrix/program.cc:71
#23 0x000ee1dc in Program::addShader (this=this@entry=0x77c9c8, 
    type=type@entry=35632, source=...) at ../src/libmatrix/program.cc:183
#24 0x000dd1f8 in Scene::load_shaders_from_strings (program=..., 
    vtx_shader=..., frg_shader=..., vtx_shader_filename=..., 
    frg_shader_filename=...) at ../src/scene.cpp:268
#25 0x000c766c in BlurRenderer::blur_program (
    create_new=create_new@entry=true, radius=radius@entry=4, 
    sigma=sigma@entry=2.70000005, 
    dir=dir@entry=BlurRenderer::BlurDirectionVertical, step=..., 
---Type &lt;return&gt; to continue, or q &lt;return&gt; to quit---
    tilt_shift=tilt_shift@entry=0.5)
    at ../src/scene-terrain/blur-renderer.cpp:61
#26 0x000c8078 in BlurRenderer::BlurRenderer (this=0x778d38, size=..., 
    radius=4, sigma=2.70000005, dir=BlurRenderer::BlurDirectionVertical, 
    step=..., tilt_shift=0.5) at ../src/scene-terrain/blur-renderer.cpp:33
#27 0x000d4e4c in SceneTerrainPrivate::init_renderers (
    this=this@entry=0x147088) at ../src/scene-terrain.cpp:118
#28 0x000d2210 in SceneTerrainPrivate (use_tilt_shift=true, use_bloom=232, 
    repeat_overlay=&lt;synthetic pointer&gt;, canvas=..., this=0x147088)
    at ../src/scene-terrain.cpp:51
#29 SceneTerrain::setup (this=0x12d410) at ../src/scene-terrain.cpp:277
#30 0x00011e98 in Benchmark::setup_scene (this=0x13d008)
    at ../src/benchmark.cpp:111
#31 0x00016084 in MainLoop::step (this=this@entry=0x13c410)
    at ../src/main-loop.cpp:86
#32 0x00017db0 in do_benchmark (canvas=...) at ../src/main.cpp:139
#33 0x0000d884 in main (argc=&lt;optimized out&gt;, argv=&lt;optimized out&gt;)
    at ../src/main.cpp:223
(gdb)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35164</commentid>
    <comment_count>1</comment_count>
    <who name="Otavio Salvador">otavio</who>
    <bug_when>2013-07-30 12:04:36 +0000</bug_when>
    <thetext>Diego,

is this always reproducible?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35166</commentid>
    <comment_count>2</comment_count>
    <who name="Diego">diego.ml</who>
    <bug_when>2013-07-30 12:34:58 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; is this always reproducible?

Yes, I can always reproduce it in Yocto on my Nitrogen6x, even on BSP 3.0.35-4.0.0.

By the way I don&apos;t have this crash on FSL Ubuntu BSP 3.0.35-1.1.0 and 3.0.35-4.0.0 installing the prebuilt glmark2.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35167</commentid>
    <comment_count>3</comment_count>
    <who name="Diego">diego.ml</who>
    <bug_when>2013-07-30 12:42:19 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; (In reply to comment #1)
&gt; &gt; is this always reproducible?
&gt; 
&gt; Yes, I can always reproduce it in Yocto on my Nitrogen6x, even on BSP
&gt; 3.0.35-4.0.0.
&gt; 
&gt; By the way I don&apos;t have this crash on FSL Ubuntu BSP 3.0.35-1.1.0 and
&gt; 3.0.35-4.0.0 installing the prebuilt glmark2.

Sorry. Just though about it: prebuilt glmark2 on FSL Ubuntu is a previous version, 2012.03.
IIRC glmark2 2012.03 has less subbenchmarks than 2012.08, so it&apos;s could just be a matter of missing the benchmark that crashes the driver.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35531</commentid>
    <comment_count>4</comment_count>
    <who name="B07273">b07273</who>
    <bug_when>2013-08-09 09:36:32 +0000</bug_when>
    <thetext>Before this bug is fixed, please try this walkaround:
Modify shader file terrain-noise.frag:
@@ -29,7 +29,7 @@ vec4 taylorInvSqrt(vec4 r)

 float snoise(vec3 v)
{
-    const vec2 C = vec2(1.0 / 6.0, 1.0 / 3.0);
+    const vec3 C = vec3(1.0 / 6.0, 1.0 / 3.0, 1.0);
     const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);

     // First corner</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35694</commentid>
    <comment_count>5</comment_count>
    <who name="Diego">diego.ml</who>
    <bug_when>2013-08-16 11:20:03 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; Before this bug is fixed, please try this walkaround:
&gt; Modify shader file terrain-noise.frag:
&gt; @@ -29,7 +29,7 @@ vec4 taylorInvSqrt(vec4 r)
&gt; 
&gt;  float snoise(vec3 v)
&gt; {
&gt; -    const vec2 C = vec2(1.0 / 6.0, 1.0 / 3.0);
&gt; +    const vec3 C = vec3(1.0 / 6.0, 1.0 / 3.0, 1.0);
&gt;      const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);
&gt; 
&gt;      // First corner

Hi,

this modifications avoids the crash, thank you for the workaround. Now waiting for a proper fix.

Diego</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35897</commentid>
    <comment_count>6</comment_count>
    <who name="Otavio Salvador">otavio</who>
    <bug_when>2013-08-23 23:23:33 +0000</bug_when>
    <thetext>An workaround is being for in 3.5.7-1.0.0-alpha.2 drivers but it does not fix the problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36291</commentid>
    <comment_count>7</comment_count>
    <who name="Otavio Salvador">otavio</who>
    <bug_when>2013-09-04 19:45:28 +0000</bug_when>
    <thetext>Resolved in 3.5.7-1.0.0-alpha.2 GPU release.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>