﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>语源科技BlogJava-Listen to the J2EE</title><link>http://www.blogjava.net/SinoSuSE/</link><description>游丝横路</description><language>zh-cn</language><lastBuildDate>Thu, 07 May 2026 08:13:46 GMT</lastBuildDate><pubDate>Thu, 07 May 2026 08:13:46 GMT</pubDate><ttl>60</ttl><item><title>Assertion `c-&gt;xlib.lock' failed.</title><link>http://www.blogjava.net/SinoSuSE/archive/2007/11/03/157980.html</link><dc:creator>SinoSuSE</dc:creator><author>SinoSuSE</author><pubDate>Sat, 03 Nov 2007 14:34:00 GMT</pubDate><guid>http://www.blogjava.net/SinoSuSE/archive/2007/11/03/157980.html</guid><wfw:comment>http://www.blogjava.net/SinoSuSE/comments/157980.html</wfw:comment><comments>http://www.blogjava.net/SinoSuSE/archive/2007/11/03/157980.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/SinoSuSE/comments/commentRss/157980.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/SinoSuSE/services/trackbacks/157980.html</trackback:ping><description><![CDATA[<p>第一篇文章，就转我自己的吧。<br />
这是我试图在openSuSE10.3上跑NetBeans时出现的问题，很严重，因为XCB的问题，导致了SWING写的程序无法运行&#8230;&#8230;<br />
<br />
From my BLOG on Lily：<br />
Solved.<br />
<br />
安装openSUSE 10.3后出现的问题，花了几天时间解决。<br />
(其实也不能说是解决，因为问题出在XCB上)<br />
<br />
BUG描述：<br />
运行用Swing的APP时，会无法启动，显示类似于"Assertion `c-&gt;xlib.lock' failed."的<br />
问题<br />
如Zend Studio和NetBeans无法正常启动，官方解释这是由于使用了XCB而不是LibX的缘故<br />
，关键就在于assert时，Lock问题。一种解决方案是回去使用libx，另一种则是去掉asse<br />
rt时的检查。<br />
<br />
下面的解决方案可行，(试过。)<br />
<br />
［转］<br />
=======================================<br />
Here's one explaination:<br />
<br />
Re: NB doesn't work in open suse 10.3 "Assertion `c-&gt;xlib.lock' failed."<br />
Click to flag this post<br />
<br />
by pujansrt Oct 11, 2007; 02:45pm :: Rate this Message: - Use ratings to moder<br />
ate (?)<br />
<br />
Reply | Reply to Author | View Threaded | Show Only this Message<br />
This is the solution--&gt; just add this to your Environment<br />
export LIBXCB_ALLOW_SLOPPY_LOCK=1<br />
<br />
========================================<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6532373" target="_blank">http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6532373</a><br />
<br />
Bug ID:&nbsp;&nbsp;&nbsp;&nbsp; 6532373<br />
Votes&nbsp; 24<br />
Synopsis&nbsp; xcb_xlib.c:50: xcb_xlib_unlock: Assertion 'c-&gt;xlib.lock' failed.<br />
Category&nbsp; java:classes_awt<br />
Reported Against&nbsp; <br />
Release Fixed&nbsp; 7(b22)<br />
State&nbsp; Closed, fixed<br />
Related Bugs&nbsp; <br />
Submit Date&nbsp; 08-MAR-2007<br />
Description&nbsp; <br />
<br />
FULL PRODUCT VERSION :<br />
java version "1.6.0"<br />
Java(TM) SE Runtime Environment (build 1.6.0-b105)<br />
Java HotSpot(TM) 64-Bit Server VM (build 1.6.0-b105, mixed mode)<br />
<br />
(also occurs with jdk1.7.0-b09 snapshot)<br />
<br />
ADDITIONAL OS VERSION INFORMATION :<br />
Linux kellyc-desktop 2.6.20-9-generic #2 SMP Sun Feb 25 22:59:06 UTC 2007 x86_<br />
64 GNU/Linux<br />
Ubuntu Feisty 7.04<br />
<br />
EXTRA RELEVANT SYSTEM CONFIGURATION :<br />
libxcb1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1.0-1.1<br />
<br />
A DESCRIPTION OF THE PROBLEM :<br />
Starting up any java app that uses awt gives this error immediately upon start<br />
up. E.g. jconsole. See this forum post: <a href="http://forum.java.sun.com/thread.jspa?" target="_blank">http://forum.java.sun.com/thread.jspa?</a><br />
threadID=782829<br />
<br />
The error is: xcb_xlib.c:50: xcb_xlib_unlock: Assertion 'c-&gt;xlib.lock' failed.<br />
<br />
<br />
This occurs with the latest 1.7.0-b09 snapshot build. However if I build 1.7.0<br />
-b09 (svn trunk revision #70) from source on my machine, it works fine in both<br />
the regular binary and fastdebug binary, so this could be related to somethin<br />
g in the standard build environment, or perhaps related to the defines in Xlib<br />
Wrapper.c that look related to locking and are only enabled on internal builds<br />
.<br />
<br />
<br />
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :<br />
Install java on a ubuntu 7.04 (feisty) system with updates applied.<br />
Try to run jconsole from a terminal.<br />
The error occurs.<br />
<br />
EXPECTED VERSUS ACTUAL BEHAVIOR :<br />
EXPECTED -<br />
jconsole window should open.<br />
ACTUAL -<br />
no window opens.<br />
<br />
ERROR MESSAGES/STACK TRACES THAT OCCUR :<br />
xcb_xlib.c:50: xcb_xlib_unlock: Assertion 'c-&gt;xlib.lock' failed.<br />
<br />
REPRODUCIBILITY :<br />
This bug can be reproduced always.<br />
<br />
CUSTOMER SUBMITTED WORKAROUND :<br />
downgrade xcb and xlib<br />
Posted Date : 2007-03-08 12:24:41.0<br />
<br />
Work Around&nbsp; <br />
<br />
N/A<br />
<br />
Evaluation&nbsp; <br />
<br />
This issue has been already discussed in different forums, for example:<br />
<br />
<a href="http://lwjgl.org/forum/index.php/topic,2168.0.html" target="_blank">http://lwjgl.org/forum/index.php/topic,2168.0.html</a><br />
<br />
In a few words, the answer is: AWT is not supposed (yet) to be used with XCB, <br />
or at least this nobody checked this. Probably, we need to pay more attention <br />
to XCB support.<br />
Posted Date : 2007-03-09 08:09:18.0<br />
<br />
as far asI understand to trigger this problem we need to call either XLockDisp<br />
lay() or<br />
XUnlockDisplay.&nbsp; I've grepped for these names in our code and found nothing :(<br />
<br />
So, I suspect it is a bug in some library we use (like Xrandr).<br />
<br />
It would be nice to get stack trace for triggered assertion to understand what<br />
does<br />
trigger this.&nbsp; (Hope submitter should be able to get it)<br />
Posted Date : 2007-03-12 07:39:15.0<br />
<br />
well, it looks like everyone believe that the cause of the problem is old vers<br />
ion of<br />
Xinerama we use.&nbsp; We have updated it in 7.0 and so the problem must not be rep<br />
roducible <br />
with latest builds of jdk 7.<br />
<br />
Since I can not check this (I have no environment for this :(&nbsp; It would be nic<br />
e to get confirmation from the comunity.<br />
Posted Date : 2007-06-04 08:53:46.0<br />
<br />
I've developed the small test (attached) to demonstrate the problem and it loo<br />
ks like the problem is not in the code but in the environment&nbsp; :(&nbsp;&nbsp; The test i<br />
s very simple: it calls LockDisplay() and _XReply(), in usual situation it han<br />
gs because there is no replies, but on in bad it throws the assertion.<br />
<br />
Here is what you need to reproduce the problem:<br />
you need to build the test on platform which doesn't have xcb and then run it <br />
on a platform with xcb.<br />
<br />
My theory about why we have the problem is as follows:<br />
<br />
the test uses X11 library for LockDisplay() and Xext library for _XReply().&nbsp; A<br />
nd it looks like the direct calls to LockDisplay() are not intercepted by XCB <br />
and so XReply() triggers the assertion :(<br />
<br />
So, I'd say that this is no a java bug, but some problem with the way XCB is u<br />
sed on a platform :(<br />
Posted Date : 2007-06-26 13:51:01.0<br />
<br />
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=11390" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=11390</a><br />
<br />
was filed against this problem, and since XCB team has accepted it, I'm closin<br />
g this CR as<br />
not a java bug.<br />
Posted Date : 2007-06-28 07:11:25.0<br />
<br />
The XCB team has determined this is not their bug, since JDK is using a static<br />
ally<br />
linked, non-thread-safe copy of libXinerama.&nbsp; See Comment #3 on<br />
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=11390" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=11390</a><br />
Posted Date : 2007-07-26 15:36:03.0<br />
<br />
I can not say that I do like the decision XCB team made, but I do understand w<br />
hy they<br />
choose it :/<br />
<br />
Will see what we can do here.<br />
<br />
I'm not sure if we can always rely on Xinerama installed on a platform :( need<br />
to evaluate<br />
this.<br />
Posted Date : 2007-07-26 16:13:52.0<br />
<br />
it looks like the only way for us is to use dlopen to work with Xinerama.<br />
Since it is 2D who works with this stuff, I'm reassigning the problem to them.<br />
<br />
Posted Date : 2007-08-06 14:47:25.0<br />
<br />
awt_GraphicsEnv.c has two code paths<br />
One for Solaris which uses dlopen, the other for Linux which uses a JDK<br />
internal copy of Xinerama.c.<br />
<br />
So the code path we need is already there (the solaris one) - it more or less <br />
just needs<br />
to be made the Linux code path too - but pointing at libXibnerama not libXext<br />
<br />
and we can delete the libXinerma source.<br />
<br />
The principle consequence is that Linux envts which do not support that<br />
lib will no longer have a Xinerama aware JDK. Seems they may be on their<br />
way put anyway.<br />
Posted Date : 2007-08-06 15:20:10.0<br />
<br />
While using the dynamic library is preferred, can't you also fix it by using a<br />
<br />
version of the static library built with the thread-safe flag (-DXTHREADS)?<br />
Posted Date : 2007-08-06 15:27:56.0<br />
<br />
We could try do build Xinerama.c with DXTHREADS but it would require<br />
investigation to see if that was going to cause problems too.<br />
Also the preference of Linux distributions (and Sun) is for dynamic linking so<br />
that<br />
patches are more easily applied. Think of the static linking to date as a work<br />
around<br />
for the previous lack of dynamic linking as an option.<br />
Posted Date : 2007-08-07 00:13:05.0<br />
<br />
Requires installing the lib-x11 in the experimental repository.<br />
I've recreated the behavior this way:<br />
<br />
I installed debian 4.0r1<br />
Changed the sources.list to use "sid" (for unstable)<br />
did apt-get dist-upgrade<br />
Those two steps is the standard way to get to "Debian Unstable"<br />
Installed the sun-java6 packages<br />
It still didn't crash<br />
Added to sources.list:&nbsp; deb <a href="http://ftp.us.debian.org/debian/" target="_blank">http://ftp.us.debian.org/debian/</a> experimental mai<br />
n<br />
This accesses the experimental repository<br />
Ran: apt-get update; apt-get install libxcb1 libxcb-xlib0<br />
Now jconsole crashes with the reported error message<br />
<br />
Announcement of lib-x11 availability in experimental<br />
<a href="http://lists.debian.org/debian-devel-announce/2006/11/msg00010.html" target="_blank">http://lists.debian.org/debian-devel-announce/2006/11/msg00010.html</a><br />
<br />
<a href="http://packages.debian.org/experimental/libs/libx11-6" target="_blank">http://packages.debian.org/experimental/libs/libx11-6</a><br />
Posted Date : 2007-08-22 21:51:15.0<br />
<br />
Forum discussion on SDN<br />
<a href="http://forum.java.sun.com/thread.jspa?threadID=782829" target="_blank">http://forum.java.sun.com/thread.jspa?threadID=782829</a><br />
<br />
Gentoo, sun-java-5<br />
<a href="http://bugs.gentoo.org/show_bug.cgi?id=156353" target="_blank">http://bugs.gentoo.org/show_bug.cgi?id=156353</a><br />
"Fix" was to disable the XCB Xlib<br />
<br />
Gentoo, sun-java-6<br />
<a href="http://bugs.gentoo.org/show_bug.cgi?id=181617" target="_blank">http://bugs.gentoo.org/show_bug.cgi?id=181617</a><br />
<br />
Gentoo, sun-java-5<br />
<a href="http://bugs.gentoo.org/show_bug.cgi?id=181854" target="_blank">http://bugs.gentoo.org/show_bug.cgi?id=181854</a><br />
<br />
An article saying XCB Xlib will not be used for Ubuntu 7.10 (gutsy gibbon).<br />
<a href="http://www.desktoplinux.com/news/NS4979518777.html" target="_blank">http://www.desktoplinux.com/news/NS4979518777.html</a><br />
They cite delays by the XCB team in fixing some bugs.<br />
Posted Date : 2007-08-22 21:52:26.0<br />
<br />
[SQE]<br />
The fix affects Solaris and Linux.&nbsp; To verify it run all multiscreen-related t<br />
ests (test/java/awt/Multiscreen &amp; test/closed/awt/Multiscreen)<br />
[SQE]<br />
Posted Date : 2007-10-01 09:19:55.0<br />
<br />
</p>
<img src ="http://www.blogjava.net/SinoSuSE/aggbug/157980.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/SinoSuSE/" target="_blank">SinoSuSE</a> 2007-11-03 22:34 <a href="http://www.blogjava.net/SinoSuSE/archive/2007/11/03/157980.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>