Maarten Maathuis wrote:
On Sat, Jan 31, 2009 at 7:37 PM, Brian Rogers <br...@xyzw.org> wrote:
On Ubuntu Jaunty, Ekiga hangs during startup before it can open any windows.
I traced the issue back to an uninitialized condition variable in libX11 xcb
code. So to anyone with mysterious freezes, this may be the fix you need.
Especially if your backtrace looks like the following one:

#0  0x00007fb79f38ca94 in __lll_lock_wait () from /lib/libpthread.so.0
#1  0x00007fb79f38a830 in pthread_cond_broadcast@@GLIBC_2.3.2 () from 
/lib/libpthread.so.0
#2  0x00007fb7a1f266b7 in wait_or_poll_for_event (dpy=0x10a6290, wait=<value 
optimized out>) at ../../src/xcb_io.c:141
#3  0x00007fb7a1f26a2d in process_responses (dpy=0x10a6e00, 
wait_for_first_event=1, current_error=0x0, current_request=0) at 
../../src/xcb_io.c:166
#4  0x00007fb7a1f272e9 in _XReadEvents (dpy=0x10a6290) at ../../src/xcb_io.c:272
#5  0x00007fb7a1f05bd4 in XIfEvent (dpy=0x10a6290, event=0x7fffaa400690, 
predicate=0x7fb79dd02a70 <timestamp_predicate>, arg=0x2800004 <Address 
0x2800004 #6  0x00007fb79dd02a39 in IA__gdk_x11_get_server_time (window=0x135a3f0) at 
/build/buildd/gtk+2.0-2.15.0/gdk/x11/gdkevents-x11.c:2598
#7  0x00007fb79e4782f8 in gtk_tray_icon_send_manager_message (icon=0x10d1340, 
message=0, window=<value optimized out>, data1=41943044, data2=0, data3=0)
#8  0x00007fb79e4785cf in gtk_tray_icon_realize (widget=0x10d1340) at 
/build/buildd/gtk+2.0-2.15.0/gtk/gtktrayicon-x11.c:629
#9  0x00007fb79d3f12cd in IA__g_closure_invoke (closure=0x108aa30, 
return_value=0x0, n_param_values=1, param_values=0x11d2280, 
invocation_hint=0x7fffaa4009e0)
Was there supposed to be a patch or some other hint attached to this message?
Sorry, I was trying out 'git send-email' for the first time (after sending a test-run to myself). It likes to post the patch as a separate mail and I wanted to write my own message separate from the commit message. Then I guess an anti-spam measure delayed delivery of the second e-mail. I'm attaching the patch here to make sure everyone can see it.

Also CC'ing Keith Packard because even though I specified him as a CC and the tool repeated a header showing both names I CC'd, it just silently dropped one of them. I'm going to be avoiding 'git format-patch' for a while now...

>From 301eefc5376d039b14cf7bb027c610ee276eab33 Mon Sep 17 00:00:00 2001
From: Brian Rogers <br...@xyzw.org>
Date: Sat, 31 Jan 2009 05:24:59 -0800
Subject: [PATCH] Initialize event_notify after allocating the memory for it.

An uninitialized or otherwise invalid condition variable can apparently
cause a hang in pthread_cond_broadcast. Ekiga, openoffice, and xine
at least are freezing as a result of event_notify never being initialized.

Signed-off-by: Brian Rogers <br...@xyzw.org>
---
 src/xcb_disp.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/xcb_disp.c b/src/xcb_disp.c
index d976064..584380c 100644
--- a/src/xcb_disp.c
+++ b/src/xcb_disp.c
@@ -94,6 +94,9 @@ int _XConnectXCB(Display *dpy, _Xconst char *display, char **fullnamep, int *scr
 	dpy->xcb->next_xid = xcb_generate_id(dpy->xcb->connection);
 
 	dpy->xcb->event_notify = xcondition_malloc();
+	if (!dpy->xcb->event_notify)
+		return 0;
+	xcondition_init(dpy->xcb->event_notify);
 	return !xcb_connection_has_error(c);
 }
 
-- 
1.6.0.4

_______________________________________________
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Reply via email to