Hi,

I know how Solaris has the binary back compatibility thing to keep up
with so xcb can not be integrated right away. One such bug that was
shown to me was:
http://bugs.sun.com/view_bug.do?bug_id=6532373
Which I believe I have a workaround in xcb so that the assertion is
not triggered when a xcb_xlib_unlock is incurred.

Submitted By: Dan Nicholson <dnicholson AT linuxfromscratch DOT org>
Date: 2007-07-08
Initial Package Version: 1.0
Upstream Status: Will not apply.
Origin: OpenSuSE
  
http://download.opensuse.org/distribution/SL-OSS-factory/inst-source/suse/src/xorg-x11-libxcb-7.2-33.src.rpm
Description: This is a workaround for X11 applications which have locking bugs
  that will trigger assertions when libxcb is used. An environment variable,
  LIBXCB_ALLOW_SLOPPY_LOCK, can be set to skip the check that the display lock
  has been set correctly. This will not be merged upstream as the XCB
  developers have decided to be strict in exposing the bugs so they are fixed
  in the appropriate location.

diff -pNur libxcb-1.0.orig/src/xcb_conn.c libxcb-1.0/src/xcb_conn.c
--- libxcb-1.0.orig/src/xcb_conn.c      2006-11-21 20:18:48.000000000 -0800
+++ libxcb-1.0/src/xcb_conn.c   2007-07-08 17:29:46.000000000 -0700
@@ -62,6 +62,11 @@ static int set_fd_flags(const int fd)
 static int _xcb_xlib_init(_xcb_xlib *xlib)
 {
     xlib->lock = 0;
+    xlib->sloppy_lock = 0;
+
+    if (getenv("LIBXCB_ALLOW_SLOPPY_LOCK"))
+        xlib->sloppy_lock = 1;
+
     pthread_cond_init(&xlib->cond, 0);
     return 1;
 }
diff -pNur libxcb-1.0.orig/src/xcbint.h libxcb-1.0/src/xcbint.h
--- libxcb-1.0.orig/src/xcbint.h        2006-11-20 23:06:29.000000000 -0800
+++ libxcb-1.0/src/xcbint.h     2007-07-08 17:29:46.000000000 -0700
@@ -130,6 +130,7 @@ int _xcb_in_read_block(xcb_connection_t

 typedef struct _xcb_xlib {
     int lock;
+    int sloppy_lock;
     pthread_t thread;
     pthread_cond_t cond;
 } _xcb_xlib;
diff -pNur libxcb-1.0.orig/src/xcb_xlib.c libxcb-1.0/src/xcb_xlib.c
--- libxcb-1.0.orig/src/xcb_xlib.c      2006-11-02 17:38:00.000000000 -0800
+++ libxcb-1.0/src/xcb_xlib.c   2007-07-08 17:29:46.000000000 -0700
@@ -38,7 +38,8 @@ unsigned int xcb_get_request_sent(xcb_co
 void xcb_xlib_lock(xcb_connection_t *c)
 {
     _xcb_lock_io(c);
-    assert(!c->xlib.lock);
+    if (!c->xlib.sloppy_lock)
+           assert(!c->xlib.lock);
     c->xlib.lock = 1;
     c->xlib.thread = pthread_self();
     _xcb_unlock_io(c);
@@ -47,7 +48,8 @@ void xcb_xlib_lock(xcb_connection_t *c)
 void xcb_xlib_unlock(xcb_connection_t *c)
 {
     _xcb_lock_io(c);
-    assert(c->xlib.lock);
+    if (!c->xlib.sloppy_lock)
+       assert(c->xlib.lock);
     assert(pthread_equal(c->xlib.thread, pthread_self()));
     c->xlib.lock = 0;
     pthread_cond_broadcast(&c->xlib.cond);

I believe this is what was needed for older apps such as old JRE's or
whatever that Sun customers need for there old apps.

Hope this is helpful,
Please do let me know how you go for testing.

Best Regards,
Edward O'Callaghan.

-- 
All Documents adhered to the ISO/IEC 26300  standard file format for
electronic office documents, such as spreadsheets, charts,
presentations and word processing documents from this email address.
The author does not take responsibility of the recipients inability to
read international standards and who use proprietary products such as
MS Office.
See: http://www.openoffice.org/
Edward O'Callaghan.
--
http://fedoraproject.org/wiki/EdwardOcallaghan
http://moonshine.opn4.org/
http://www.pcbsd.org/

Reply via email to