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

<bugzilla version="5.2"
          urlbase="https://jogamp.org/bugzilla/"
          
          maintainer="sgothel@jausoft.com"
>

    <bug>
          <bug_id>623</bug_id>
          
          <creation_ts>2012-09-29 13:03:00 +0200</creation_ts>
          <short_desc>Sporadic XCB assertion failures w/ ATI proprietary driver and w/o native X11 locking</short_desc>
          <delta_ts>2012-10-02 17:32:26 +0200</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Jogl</product>
          <component>x11</component>
          <version>2</version>
          <rep_platform>pc_all</rep_platform>
          <op_sys>linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>---</priority>
          <bug_severity>critical</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>603</blocked>
    
    <blocked>616</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Sven Gothel">sgothel</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          <cc>alexander.lex</cc>
    
    <cc>andres.colubri</cc>
    
    <cc>bforrester</cc>
    
    <cc>dp</cc>
    
    <cc>gouessej</cc>
    
    <cc>wwalker3</cc>
    
    <cc>xerxes</cc>
          
          <cf_type>---</cf_type>
          <cf_scm_refs>jogl 43891be36e8485353ac74f329fd2f7438303a846
jogl  92398025abdabb2fdef0d78edd41e730991a6f94
jogl 2d35fc546097818aba5db51885f796cb0b442734
jogl 0790108ca9c2a6a6d494e5017589fe083c518e23
jogl 7c333e3e2574879465719ed968112b27255368d4
jogl 9c96be7c0a1a19365ae983908260c6ff44f045c4</cf_scm_refs>
          <cf_workaround>TRUE</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1850</commentid>
    <comment_count>0</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2012-09-29 13:03:00 +0200</bug_when>
    <thetext>W/o native X11 locking (i.e. w/o XInitThreads(), XLockDisplay()/XUnlockDisplay())
XCB assertions fail sporadically w/ ATI proprietary driver.

The assertions appear sometimes at &apos;glXCreateContextAttribsARB(..)&apos;
and at &apos;X11Lib.XineramaIsEnabled()&apos; if commit 43891be36e8485353ac74f329fd2f7438303a846 is disabled.
  &lt;http://jogamp.org/git/?p=jogl.git;a=commit;h=43891be36e8485353ac74f329fd2f7438303a846&gt;

The latter is pretty much regulary triggered w/ unit test 
  com.jogamp.opengl.test.junit.jogl.acore.TestGLContextDrawableSwitchNEWT

Blocks Bug 616 to become stable.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1851</commentid>
    <comment_count>1</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2012-09-29 13:05:10 +0200</bug_when>
    <thetext>JOGL commit 43891be36e8485353ac74f329fd2f7438303a846
relaxes usage of X11Lib.XineramaIsEnabled() and hence the chance to trigger the XCB assertion failure.

&lt;http://jogamp.org/git/?p=jogl.git;a=commit;h=43891be36e8485353ac74f329fd2f7438303a846&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1855</commentid>
    <comment_count>2</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2012-09-30 20:56:25 +0200</bug_when>
    <thetext>Fix seems to be impossible, since root cause probably is within ATI proprietary driver.

Workaround is to use a global lock as fallback in case ATI proprietary driver is being used.

The proprietary ATI X11 driver does not handle multi-threaded [GL] clients well,
i.e. triggers an XCB assertion &apos;from time to time&apos;.
    
It almost seems like that the driver either:
  - aliases all display connections to it&apos;s connection name, i.e. server; or
  - utilizes a build-in display connection w/o locking, used for some reason

See details here:
  &lt;http://jogamp.org/git/?p=jogl.git;a=commit;h=92398025abdabb2fdef0d78edd41e730991a6f94&gt;
  &lt;http://jogamp.org/git/?p=jogl.git;a=commit;h=2d35fc546097818aba5db51885f796cb0b442734&gt;
  &lt;http://jogamp.org/git/?p=jogl.git;a=commit;h=0790108ca9c2a6a6d494e5017589fe083c518e23&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1860</commentid>
    <comment_count>3</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2012-10-02 07:42:39 +0200</bug_when>
    <thetext>Reopened .. workaround is not feasible:

Relax Bug 613 workaround of commit 92398025abdabb2fdef0d78edd41e730991a6f94
    
Utilizing a GlobalToolkitLock in general to lock the display connection results in deadlock
situations where locked surfaces signal other [offscreen] surfaces to render.
    
We have to see whether we find a better solution, for now sporadic XCB assertion still happen.
But it is preferrable to point to the root cause, then to jumping through hoops to complicate locking
or even to deadlock.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1861</commentid>
    <comment_count>4</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2012-10-02 17:32:26 +0200</bug_when>
    <thetext>NativeWindowFactory: Remove &apos;remedy&apos; of Bug 613 
Commit 2398025abdabb2fdef0d78edd41e730991a6f94 GlobalToolkitLock for create/destroy
    
Turns out on it has no effect and ATI prop. driver still has XCB failures at this point.

+++

Well, I give this bug a rest for now (WONTFIX) until further notice and knowledge.

Summary is that even w/ rolled-back changes (XInitThreads()) the prop. ATI driver
is not intrinsically thread safe regarding to the XCB assertion failures.

The new test non blocking test TestInitConcurrent02NEWT triggers it w/ or w/o 
native X11 locking. Non blocking, since it utilizes 2 separate exclusive X11 display connections
for each NEWT window, one for X11 event pump and one for rendering.
Doing this 16 times in parallel, where we create 32 threads:
  - Each window-pump and window-render has it&apos;s own thread

Tested w/ latest Ubuntu 12.04.1 LTS w/ backports enabled w/ KDE
and amd-driver-installer-12-8-x86.x86_64 and amd-driver-installer-12-9-beta-x86.x86_64.

Also validated w/ Mesa R600 Gallium git tip from 2012-10-02,
git-sha1 523c01524638b3d1bb363f4c0a647b0777840b7a.
No XCB threading issue exist here - however, other issues exist like
  - Shared Context Teats: &quot;radeon: The kernel rejected CS&quot;
  - No FBO MSAA (all Mesa hw-accel driver, i.e. intel gallium)

+++

Best &apos;stable&apos; ATI proprietary config so far:
  Using KDE w/ compositing (dekstop effects) enabled.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>