Re: [GtkGLExt] segfault on configure event



I may be having a similar problem (although I'm using gtkglextmm) - my program segfaults whenever I configure or realize

Looking at the debug from GDM, it might be something to do with reference pointers, although I'm not sure how.

If you work anything out, please let me know

Toby

Mike Hudson wrote:

Hi all,

Newbie here. I am trying to create an opengl canvas for our gtk app ui (one
of many interfaces) and am having little luck. I have followed the example
laid out in template.c in order to try and create a "canvas" area but am
consistently getting a segfault when (as per the example configure-event
handler) I call gtk_widget_get_gl_context().
I've built the libraries from source on fc7 (not too sure if that is
relevant).
Below is the output from a ddd session, with some content coming from
setting debug output on glext, some is mine (but based on calls to glglext
functions)

I hope someone might be able to see something out of the ordinary..?

GNU DDD 3.3.11 (i686-redhat-linux-gnu), by Dorothea Lütkehaus and Andreas
Zeller.
Copyright © 1995-1999 Technische Universität Braunschweig, Germany.
Copyright © 1999-2001 Universität Passau, Germany.
Copyright © 2001 Universität des Saarlandes, Germany.
Copyright © 2001-2004 Free Software Foundation, Inc.
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) break gtk_canvas_configure_event
Breakpoint 1 at 0x805fd19: file uio_gtk.c, line 431.
(gdb) run -i gtk newtest_ui.u
[Thread debugging using libthread_db enabled]
[New Thread -1208350992 (LWP 5372)]
GdkGLExt-Message:  - gdk_gl_config_new ()
GdkGLExt-Message:  -- gdk_gl_config_new_common ()
GdkGLExt-Message:  -- Server GLX_VENDOR     : NVIDIA Corporation
GdkGLExt-Message:  -- Server GLX_VERSION    : 1.4
GdkGLExt-Message:  -- Server GLX_EXTENSIONS : GLX_EXT_visual_info
GLX_EXT_visual_rating GLX_SGIX_fbconfig GLX_SGIX_pbuffer GLX_SGI_video_sync
GLX_SGI_swap_control GLX_EXT_texture_from_pixmap GLX_ARB_multisample
GLX_NV_float_buffer
GdkGLExt-Message:  -- Client GLX_VENDOR     : NVIDIA Corporation
GdkGLExt-Message:  -- Client GLX_VERSION    : 1.4
GdkGLExt-Message:  -- Client GLX_EXTENSIONS : GLX_ARB_get_proc_address
GLX_ARB_multisample GLX_EXT_visual_info GLX_EXT_visual_rating
GLX_EXT_import_context GLX_SGI_video_sync GLX_NV_swap_group GLX_NV_video_out
GLX_SGIX_fbconfig GLX_SGIX_pbuffer GLX_SGI_swap_control GLX_NV_float_buffer
GLX_ARB_fbconfig_float GLX_EXT_fbconfig_packed_float
GLX_EXT_texture_from_pixmap
GdkGLExt-Message:  ** glXChooseVisual ()
GdkGLExt-Message:  - gdk_gl_config_new ()
GdkGLExt-Message:  -- gdk_gl_config_new_common ()
GdkGLExt-Message:  ** glXChooseVisual ()
GdkGLExt-Message:  -- glXChooseVisual: screen number = 0
GdkGLExt-Message:  -- glXChooseVisual: visual id = 0x23
GdkGLExt-Message:  -- gdk_gl_config_class_init ()
GdkGLExt-Message:  -- gdk_gl_config_impl_x11_class_init ()
GdkGLExt-Message:  -- gdk_gl_config_setup_colormap ()
GdkGLExt-Message:  -- gdk_gl_config_get_std_rgb_colormap ()
GdkGLExt-Message:  -- Colormap: new
GdkGLExt-Message:  -- Colormap: visual id = 0x23
Got config!
gtkgl successfully initialised
Canvas widget is: 0x98225c0
GtkGLExt-Message:  - gtk_widget_set_gl_capability ()
Created canvas
Internal: Setting a label on a list with no current label
GtkGLExt-Message:  -- gtk_gl_widget_style_set ()
GtkGLExt-Message:  -- gtk_gl_widget_size_allocate ()
GtkGLExt-Message:  -- gtk_gl_widget_configure_event ()
GtkGLExt-Message:  -- gtk_gl_widget_realize ()
GdkGLExt-Message:  - gdk_window_set_gl_capability ()
GdkGLExt-Message:  - gdk_gl_window_new ()
GdkGLExt-Message:  -- gdk_gl_window_class_init ()
GdkGLExt-Message:  -- gdk_gl_window_impl_x11_class_init ()
GdkGLExt-Message:  -- gdk_gl_window_impl_x11_gl_drawable_interface_init ()
GdkGLExt-Message:  - window->bg_pixmap = (nil)
GdkGLExt-Message:  - window->bg_pixmap = 0x2
[Switching to Thread -1208350992 (LWP 5372)]

Breakpoint 1, gtk_canvas_configure_event (widget=0x98225c0, event=0x98210b0,
data=0x0) at uio_gtk.c:431
(gdb) next
configure_event passed widget 0x98225c0
(gdb) next
(gdb) next
widget is gl capable
(gdb) next
(gdb) next
gl window of widget 0x98225c0 is: 0x9836060
(gdb) step
gtk_widget_get_gl_context (widget=0x98225c0) at gtkglwidget.c:476
/home/mike/gtkglext-1.2.0/gtk/gtkglwidget.c:476:13733:beg:0x1178fd
(gdb) next
...
(gdb) next
(gdb) step
gtk_widget_create_gl_context (widget=0x98225c0, share_list=0x0, direct=1,
render_type=32788) at gtkglwidget.c:428
/home/mike/gtkglext-1.2.0/gtk/gtkglwidget.c:428:12536:beg:0x1177a4
(gdb) next
(gdb) next
GtkGLExt-Message:  - gtk_widget_create_gl_context ()
(gdb) next
...
(gdb) print gldrawable
No symbol "gldrawable" in current context. (EDIT: Think this is a
build/debugger issue?)
...
(gdb) step
Program received signal SIGSEGV, Segmentation fault.
0x00a51207 in XVisualIDFromVisual () from /usr/lib/libX11.so.6

Basically I get through the creation of the widget ok, but as soon as the
configure_event handler is called,  I get this segfault when trying to
create a gl context.
FYI the template example builds and runs perfectly.

Any feedback/requests for more info gratefully received (apologies if this
is a little long).

Regards,

M Hudson


--
------------------------------------------------------------------------
Sent by Toby Roworth (webmaster orkyden co uk)
This message is intended for the named reciepients only, and should not be forwarded without permission
The conents of this message may be ©Toby Roworth




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