After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 746746 - gtk3-demo 'OpenGL Area' crashes on systems with old OpenGL version
gtk3-demo 'OpenGL Area' crashes on systems with old OpenGL version
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkGLArea
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2015-03-25 14:21 UTC by Ting-Wei Lan
Modified: 2015-03-25 17:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
x11/gl: Trap GL context creation (1.65 KB, patch)
2015-03-25 14:36 UTC, Emmanuele Bassi (:ebassi)
committed Details | Review
x11/gl: Do not try to call MakeCurrent with a NULL context (1.01 KB, patch)
2015-03-25 15:21 UTC, Emmanuele Bassi (:ebassi)
committed Details | Review
glarea: Check that the context is not NULL (1.27 KB, patch)
2015-03-25 15:22 UTC, Emmanuele Bassi (:ebassi)
committed Details | Review
demo/glarea: Check errors on GtkGLArea (1.32 KB, patch)
2015-03-25 15:22 UTC, Emmanuele Bassi (:ebassi)
committed Details | Review

Description Ting-Wei Lan 2015-03-25 14:21:54 UTC
Hardware: Intel Ironlake Desktop

It only supports OpenGL 2.1 using Mesa 10.4, so it causes gtk3-demo to crash with the following messages:

(gtk3-demo:25924): Gdk-ERROR **: The program 'gtk3-demo' received an X Window System error.
This probably reflects a bug in the program.
The error was 'GLXBadFBConfig'.
  (Details: serial 4435 error_code 179 request_code 155 (GLX) minor_code 34)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the GDK_SYNCHRONIZE environment
   variable to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

Program received signal SIGTRAP, Trace/breakpoint trap.


Stack trace:

  • #0 _g_log_abort
    at gmessages.c line 315
  • #1 g_logv
    at gmessages.c line 1041
  • #2 g_log
    at gmessages.c line 1079
  • #3 _gdk_x11_display_error_event
    at gdkdisplay-x11.c line 2552
  • #4 gdk_x_error
    at gdkmain-x11.c line 303
  • #5 _XError
    at XlibInt.c line 1463
  • #6 __glXSendErrorForXcb
    at glx_error.c line 83
  • #7 glXCreateContextAttribsARB
    at create_context.c line 119
  • #8 epoxy_glXCreateContextAttribsARB_global_rewrite_ptr
    at glx_generated_dispatch.c line 1239
  • #9 create_gl3_context
    at gdkglcontext-x11.c line 565
  • #10 gdk_x11_gl_context_realize
    at gdkglcontext-x11.c line 609
  • #11 gdk_gl_context_realize
    at gdkglcontext.c line 581
  • #12 gdk_window_get_paint_gl_context
    at gdkwindow.c line 2759
  • #13 gdk_window_create_gl_context
    at gdkwindow.c line 2798
  • #14 gtk_gl_area_real_create_context
    at gtkglarea.c line 293
  • #15 _gtk_marshal_OBJECT__VOID
    at gtkmarshalers.c line 2569
  • #16 g_type_class_meta_marshal
    at gclosure.c line 994
  • #17 g_closure_invoke
    at gclosure.c line 801
  • #18 signal_emit_unlocked_R
    at gsignal.c line 3587
  • #19 g_signal_emit_valist
    at gsignal.c line 3315
  • #20 g_signal_emit
    at gsignal.c line 3361
  • #21 gtk_gl_area_realize
    at gtkglarea.c line 258
  • #22 g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 875
  • #23 g_type_class_meta_marshal
    at gclosure.c line 994
  • #24 g_closure_invoke
    at gclosure.c line 801
  • #25 signal_emit_unlocked_R
    at gsignal.c line 3479
  • #26 g_signal_emit_valist
    at gsignal.c line 3305
  • #27 g_signal_emit
    at gsignal.c line 3361
  • #28 gtk_widget_realize
    at gtkwidget.c line 5537
  • #29 gtk_widget_map
    at gtkwidget.c line 5066
  • #30 gtk_container_map_child
    at gtkcontainer.c line 3544
  • #31 gtk_box_forall
    at gtkbox.c line 2567
  • #32 gtk_container_forall
    at gtkcontainer.c line 2292
  • #33 gtk_container_map
    at gtkcontainer.c line 3552
  • #34 g_cclosure_marshal_VOID__VOIDv
    at gmarshal.c line 905
  • #35 g_type_class_meta_marshalv
    at gclosure.c line 1021
  • #36 _g_closure_invoke_va
    at gclosure.c line 864
  • #37 g_signal_emit_valist
    at gsignal.c line 3214
  • #38 g_signal_emit
    at gsignal.c line 3361
  • #39 gtk_widget_map
    at gtkwidget.c line 5068
  • #40 gtk_window_map
    at gtkwindow.c line 5995
  • #41 g_cclosure_marshal_VOID__VOIDv
    at gmarshal.c line 905
  • #42 g_type_class_meta_marshalv
    at gclosure.c line 1021
  • #43 _g_closure_invoke_va
    at gclosure.c line 864
  • #44 g_signal_emit_valist
    at gsignal.c line 3214
  • #45 g_signal_emit
    at gsignal.c line 3361
  • #46 gtk_widget_map
    at gtkwidget.c line 5068
  • #47 gtk_window_show
    at gtkwindow.c line 5905
  • #48 g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 875
  • #49 g_type_class_meta_marshal
    at gclosure.c line 994
  • #50 g_closure_invoke
    at gclosure.c line 801
  • #51 signal_emit_unlocked_R
    at gsignal.c line 3479
  • #52 g_signal_emit_valist
    at gsignal.c line 3305
  • #53 g_signal_emit
    at gsignal.c line 3361
  • #54 gtk_widget_show
    at gtkwidget.c line 4874
  • #55 gtk_container_show_all
    at gtkcontainer.c line 3455
  • #56 gtk_widget_show_all
    at gtkwidget.c line 5040
  • #57 do_glarea
    at glarea.c line 412
  • #58 run_example_for_row
    at main.c line 128
  • #59 row_activated_cb
    at main.c line 973
  • #60 _gtk_marshal_VOID__BOXED_OBJECT
    at gtkmarshalers.c line 3166
  • #61 g_closure_invoke
    at gclosure.c line 801
  • #62 signal_emit_unlocked_R
    at gsignal.c line 3549
  • #63 g_signal_emit_valist
    at gsignal.c line 3305
  • #64 g_signal_emit
    at gsignal.c line 3361
  • #65 gtk_tree_view_row_activated
    at gtktreeview.c line 12646
  • #66 gtk_tree_view_multipress_gesture_pressed
    at gtktreeview.c line 3299
  • #67 ffi_call_unix64
    at ../src/x86/unix64.S line 76
  • #68 ffi_call
    at ../src/x86/ffi64.c line 525
  • #69 g_cclosure_marshal_generic_va
    at gclosure.c line 1594
  • #70 _g_closure_invoke_va
    at gclosure.c line 864
  • #71 g_signal_emit_valist
    at gsignal.c line 3214
  • #72 g_signal_emit
    at gsignal.c line 3361
  • #73 gtk_gesture_multi_press_begin
    at gtkgesturemultipress.c line 232
  • #74 g_cclosure_marshal_VOID__BOXEDv
    at gmarshal.c line 1950
  • #75 g_type_class_meta_marshalv
    at gclosure.c line 1021
  • #76 _g_closure_invoke_va
    at gclosure.c line 864
  • #77 g_signal_emit_valist
    at gsignal.c line 3214
  • #78 g_signal_emit
    at gsignal.c line 3361
  • #79 _gtk_gesture_set_recognized
    at gtkgesture.c line 273
  • #80 _gtk_gesture_check_recognized
    at gtkgesture.c line 318
  • #81 gtk_gesture_handle_event
    at gtkgesture.c line 598
  • #82 gtk_gesture_single_handle_event
    at gtkgesturesingle.c line 218
  • #83 gtk_event_controller_handle_event
    at gtkeventcontroller.c line 224
  • #84 _gtk_widget_run_controllers
    at gtkwidget.c line 7454
  • #85 gtk_widget_real_button_event
    at gtkwidget.c line 7232
  • #86 _gtk_marshal_BOOLEAN__BOXEDv
    at gtkmarshalers.c line 130
  • #87 g_type_class_meta_marshalv
    at gclosure.c line 1021
  • #88 _g_closure_invoke_va
    at gclosure.c line 864
  • #89 g_signal_emit_valist
    at gsignal.c line 3214
  • #90 g_signal_emit
    at gsignal.c line 3361
  • #91 gtk_widget_event_internal
    at gtkwidget.c line 7799
  • #92 gtk_widget_event
    at gtkwidget.c line 7392
  • #93 propagate_event_up
    at gtkmain.c line 2422
  • #94 propagate_event
    at gtkmain.c line 2524
  • #95 gtk_propagate_event
    at gtkmain.c line 2559
  • #96 gtk_main_do_event
    at gtkmain.c line 1756
  • #97 _gdk_event_emit
    at gdkevents.c line 69
  • #98 gdk_event_source_dispatch
    at gdkeventsource.c line 364
  • #99 g_main_dispatch
    at gmain.c line 3122
  • #100 g_main_context_dispatch
    at gmain.c line 3737
  • #101 g_main_context_iterate
    at gmain.c line 3808
  • #102 g_main_context_iteration
    at gmain.c line 3869
  • #103 g_application_run
    at gapplication.c line 2308
  • #104 main
    at main.c line 1058

Comment 1 Emmanuele Bassi (:ebassi) 2015-03-25 14:30:21 UTC
Taking this up for 3.16.1.
Comment 2 Emmanuele Bassi (:ebassi) 2015-03-25 14:36:08 UTC
Created attachment 300282 [details] [review]
x11/gl: Trap GL context creation

Avoid an X11 error in case the context creation fails, so we can avoid a
crash and pick it up in the upper layers, and display an error.
Comment 3 Emmanuele Bassi (:ebassi) 2015-03-25 14:37:07 UTC
This should take care of the crash, and the GtkGLArea should display an error message. Testing on older platforms is appreciated.
Comment 4 Emmanuele Bassi (:ebassi) 2015-03-25 15:21:53 UTC
Created attachment 300287 [details] [review]
x11/gl: Do not try to call MakeCurrent with a NULL context

This should not happen, but better safe than sorry.
Comment 5 Emmanuele Bassi (:ebassi) 2015-03-25 15:22:06 UTC
Created attachment 300288 [details] [review]
glarea: Check that the context is not NULL

The public API should perform more checks when it comes to an NULL
context.
Comment 6 Emmanuele Bassi (:ebassi) 2015-03-25 15:22:13 UTC
Created attachment 300289 [details] [review]
demo/glarea: Check errors on GtkGLArea

We should not call OpenGL API if GtkGLArea is in an error state.
Comment 7 Emmanuele Bassi (:ebassi) 2015-03-25 17:03:38 UTC
15:26 < lantw44> ebassi: It shows error instead of exiting now

I'll assume a Tested-by, and push the patches to master. We should cherry-pick them for 3.16.1 as well.
Comment 8 Emmanuele Bassi (:ebassi) 2015-03-25 17:04:34 UTC
Attachment 300282 [details] pushed as b899a78 - x11/gl: Trap GL context creation
Attachment 300287 [details] pushed as 85141bc - x11/gl: Do not try to call MakeCurrent with a NULL context
Attachment 300288 [details] pushed as fae3eaf - glarea: Check that the context is not NULL
Attachment 300289 [details] pushed as 721134b - demo/glarea: Check errors on GtkGLArea