Re: gdk_display_close segfault?



On 6/28/06, Dave Foster <dave foster gmail com> wrote:
Hi,

I've been trying to write a small section of code in my program which
makes a second connection to the X display, using gtkmm.. I kept having
problems, after rewriting it about 5 or 6 times, I tried writing it in
straight gdk, and STILL got the problems.

I seem to get a segfault whenever I call gdk_display_close().  Here is a
rediculously simple example that gives the problem:

Glib::ustring disp = ":0.0";
GdkDisplay* gdisp = gdk_display_open(disp.c_str());
if (!gdisp) ...
gdk_display_close(gdisp);

/*
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1224202560 (LWP 5689)]
0xb7b413d0 in gdk_display_x11_dispose () from /usr/lib/libgdk-x11-2.0.so.0
(gdb) bt
#0  0xb7b413d0 in gdk_display_x11_dispose () from /usr/lib/libgdk-x11-2.0.so.0
#1  0xb7a11f2b in g_object_unref () from /usr/lib/libgobject-2.0.so.0
#2  0xb7b20c04 in gdk_display_close () from /usr/lib/libgdk-x11-2.0.so.0
#3  0x080571d5 in SetBG::set_bg (disp= 0xbfe1b2b0, file= 0xbfe1b2ac,
    mode=SetBG::SET_SCALE, bgcolor= 0xbfe1b2a8) at SetBG.cc:67
...
*/

The display is opening fine.  I'm running:

gtk: 2.8.17-1
glib: 2.10.2-1

(hmm, didn't notice that before,t he 2.8 vs 2.10 thing, could that be it?)

Anyway, I've spent all night trying to debug this and weeks trying to
sort this problem out in my program.  What is up with this, what can I
do?

gdk_display_close has been fixed in GTK+ 2.10, which should  be
available soon.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]