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 570651 - DISPLAY env var overrides --display argument, but the latter should take precedence
DISPLAY env var overrides --display argument, but the latter should take prec...
Status: RESOLVED FIXED
Product: totem
Classification: Core
Component: GStreamer backend
unspecified
Other Linux
: Normal critical
: ---
Assigned To: Maintainer alias for GStreamer component of Totem
Maintainer alias for GStreamer component of Totem
Depends on:
Blocks:
 
 
Reported: 2009-02-05 15:15 UTC by Christian Persch
Modified: 2012-04-20 10:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Set the display on the video sink (1.24 KB, patch)
2009-11-16 11:57 UTC, Bastien Nocera
committed Details | Review

Description Christian Persch 2009-02-05 15:15:50 UTC
Steps to repro:
$ echo $DISPLAY
:0.0
$ totem --display :2.0
Gdk-ERROR **: The program 'totem' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
  (Details: serial 28 error_code 3 request_code 3 minor_code 0)
  (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 --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

Breakpoint 1, gdk_x_error (display=0x88e19c0, error=0xbfb15698) at gdkmain-x11.c:619
619	{
(gdb) where
  • #0 gdk_x_error
    at gdkmain-x11.c line 619
  • #1 _XError
    at ../../src/XlibInt.c line 2912
  • #2 process_responses
    at ../../src/xcb_io.c line 138
  • #3 _XReply
    at ../../src/xcb_io.c line 370
  • #4 _XGetWindowAttributes
    at ../../src/GetWAttrs.c line 116
  • #5 XGetWindowAttributes
    at ../../src/GetWAttrs.c line 151
  • #6 gst_xvimagesink_set_xwindow_id
    at xvimagesink.c line 2647
  • #7 gst_x_overlay_set_xwindow_id
    at xoverlay.c line 167
  • #8 bacon_video_widget_expose_event
    at ../../../../src/backend/bacon-video-widget-gst-0.10.c line 657
  • #9 _gtk_marshal_BOOLEAN__BOXED
    at gtkmarshalers.c line 84
  • #10 g_type_class_meta_marshal
    at gclosure.c line 878
  • #11 g_closure_invoke
    at gclosure.c line 767
  • #12 signal_emit_unlocked_R
    at gsignal.c line 3282
  • #13 g_signal_emit_valist
    at gsignal.c line 2987
  • #14 g_signal_emit
    at gsignal.c line 3034
  • #15 gtk_widget_event_internal
    at gtkwidget.c line 4767
  • #16 gtk_widget_send_expose
    at gtkwidget.c line 4596
  • #17 gtk_main_do_event
    at gtkmain.c line 1557
  • #18 gdk_window_process_updates_internal
    at gdkwindow.c line 2595
  • #19 gdk_window_process_all_updates
    at gdkwindow.c line 2661
  • #20 gtk_container_idle_sizer
    at gtkcontainer.c line 1353
  • #21 gdk_threads_dispatch
    at gdk.c line 477
  • #22 g_idle_dispatch
    at gmain.c line 3922
  • #23 g_main_dispatch
    at gmain.c line 1814
  • #24 g_main_context_dispatch
    at gmain.c line 2367
  • #25 g_main_context_iterate
    at gmain.c line 2448
  • #26 g_main_loop_run
    at gmain.c line 2656
  • #27 gtk_main
    at gtkmain.c line 1204
  • #28 main
    at ../../../src/totem.c line 3654


I think it's trying to create the xv on :0.0, not :2.0. You can also observe this crash when unsetting the DISPLAY variable and just passing the display with --display :0.0. 

In gtk_init(), --display takes precedence over DISPLAY, so totem should pass that through to gstreamer backend.
Comment 1 Christian Persch 2009-02-05 15:21:37 UTC
Might be related to bug 369134.
Comment 2 Bastien Nocera 2009-11-16 11:57:54 UTC
Created attachment 147875 [details] [review]
Set the display on the video sink

When creating the video sink, make sure it gets assigned the
same display as passed to --display on the command-line.
Comment 3 Bastien Nocera 2009-11-16 11:59:12 UTC
Comment on attachment 147875 [details] [review]
Set the display on the video sink

Attachment 147875 [details] pushed as e79427f - Set the display on the video sink
Comment 4 Bastien Nocera 2009-11-16 11:59:43 UTC
This patch should work. Can you test?
Comment 5 Christian Persch 2009-11-16 13:53:48 UTC
Still crashing with the same error:

$ Xnest -ac :2
$ DISPLAY=:0.0 totem --display :2.0 testfile.ogv

(gdb) where
  • #0 gdk_x_error
    at gdkmain-x11.c line 444
  • #1 _XError
    at ../../src/XlibInt.c line 2912
  • #2 process_responses
    at ../../src/xcb_io.c line 138
  • #3 _XReply
    at ../../src/xcb_io.c line 370
  • #4 _XGetWindowAttributes
    at ../../src/GetWAttrs.c line 116
  • #5 XGetWindowAttributes
    at ../../src/GetWAttrs.c line 151
  • #6 ??
    from /opt/gnome-trunk/lib/gstreamer-0.10/libgstxvimagesink.so
  • #7 gst_x_overlay_set_xwindow_id
    at xoverlay.c line 167
  • #8 bacon_video_widget_expose_event
    at ../../../src/backend/bacon-video-widget-gst-0.10.c line 701

When running the other way,

$ DISPLAY=:2.0 totem --display :0.0 testfile.ogv

the crash is the same, except that it's using ximagesink instead of xvimagesink.

Also it's not an Xnest bug; the same thing happens with Xephyr.
Comment 6 Bastien Nocera 2012-04-20 10:54:22 UTC
Fixed since the move to clutter for video output.