Xfce4-terminal cannot run on more than one X screen at a time

Bug #1243354 reported by Rena Kunisaki on 2013-10-22
62
This bug affects 11 people
Affects Status Importance Assigned to Milestone
xfce4-terminal
Confirmed
Medium
xfce4-terminal (Debian)
Confirmed
Unknown
xfce4-terminal (Ubuntu)
Undecided
Unassigned

Bug Description

I have a setup with two video cards, each running a separate X screen (DISPLAY=:0.0 and :0.1), using fglrx driver.

For the most part this is working fine, except that I cannot run Xfce4-terminal on both X screens at once. Several instances can run on each screen, but as soon as I start one on one screen, all instances on the other screen terminate with an X error. No other program seems to exhibit this behavour. It happens whether transparent background is enabled or not. lxterminal is able to display a transparent background on both screens simultaneously.

Example session in lxterminal:
$ echo $DISPLAY
:0.0

$ DISPLAY=:0.0 xfce4-terminal &
[1] 5078
# at this point, an xfce4-terminal window is open next to the lxterminal
# window on display :0.0
# it outputs the following message to stderr:

(xfce4-terminal:5078): GLib-WARNING **: (/build/buildd/glib2.0-2.38.0/./glib/gerror.c:390):g_error_new_valist: runtime check failed: (domain != 0)
Failed to connect to session manager: Failed to connect to the session manager: SESSION_MANAGER environment variable not defined

# now I try to start another xfce4-terminal on display :0.1
$ DISPLAY=:0.1 xfce4-terminal &
[2] 5133

$ The program 'xfce4-terminal' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadMatch (invalid parameter attributes)'.
  (Details: serial 480 error_code 8 request_code 1 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.)

(xfce4-terminal:5133): GLib-WARNING **: (/build/buildd/glib2.0-2.38.0/./glib/gerror.c:390):g_error_new_valist: runtime check failed: (domain != 0)
Failed to connect to session manager: Failed to connect to the session manager: SESSION_MANAGER environment variable not defined

[1]- Exit 1 DISPLAY=:0.0 xfce4-terminal

# now an Xfce4-terminal window is shown on display :0.1, but the window I previously opened on :0.0 is gone, as indicated by the X error message.

The same issue happens if I use `xfce4-terminal --display=:0.0` instead of setting the DISPLAY variable. Adding --geometry to ensure the window actually opens within the boundaries of the display doesn't help either. (Anyway, it was always opening within the display boundaries even without that option, but just a hunch that might have helped.)

syslog, kern.log and Xorg.0.log don't show anything interesting when this happens.

I suspect a driver bug that Xfce4-terminal is triggering somehow, but I don't know how to investigate. (Unfortunately I couldn't get the open-source drivers to work with this setup at all.)

ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: xfce4-terminal 0.6.2-3ubuntu1
ProcVersionSignature: Ubuntu 3.11.0-12.19-generic 3.11.3
Uname: Linux 3.11.0-12-generic x86_64
NonfreeKernelModules: fglrx
ApportVersion: 2.12.5-0ubuntu2
Architecture: amd64
Date: Tue Oct 22 14:30:16 2013
InstallationDate: Installed on 2013-10-22 (0 days ago)
InstallationMedia: Lubuntu 13.10 "Saucy Salamander" - Release amd64 (20131016.1)
MarkForUpload: True
SourcePackage: xfce4-terminal
UpgradeStatus: No upgrade log present (probably fresh install)

I use "Separate X screen" configuration (I have two separate screen).
If you run the terminal on one of the screens, and then start on the other, the terminal on the first screen is closed. On one screen can run multiple copies of the terminal, but if you open it on another screen, as they are all closed.

---------------
The program 'xfce4-terminal' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadMatch (invalid parameter attributes)'.
  (Details: serial 488 error_code 8 request_code 1 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.)
---------------

(xorg-server 1.14.1-1, nvidia driver version: 319.17)

Rena Kunisaki (i-am-inuyasha) wrote :
description: updated
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in xfce4-terminal (Ubuntu):
status: New → Confirmed

Same here.

jhansonxi (jhansonxi) wrote :

Also affects
0.6.2-3ubuntu1~ppa0.12.04.1

on Ubuntu 12.04 (Precise Pangolin) / Linux Mint 13 (maya)
x86_64

Erik Walthinsen (omega-omegacs) wrote :

Confirmed, upgraded to 13.10 last night and have this behavior. Running 0.6.2-3ubuntu1.

Rather seriously impacts my work, not so much at this exact instant but very soon. Not the least of which because an accidental click on the other screen's terminal will also shut down all child processes of the terminals on my main screen, which is a *particularly* nasty behavior.

Erik Walthinsen (omega-omegacs) wrote :

I just built raw 0.6.1 *and* 0.6.2 from xfce source, and neither have this problem. Then I did apt-get source and debuild, then installed the package I just built. No bug. Then I removed that and ran 'apt-get install xfce4-terminal', and *still* no bug.

So, for those with this bug, try just removing and reinstalling the package... /facepalm

Erik Walthinsen (omega-omegacs) wrote :

Gah, spoke too soon. 0.6.1 works fine, and my further tests with 0.6.2 and a debuild attempt were confused by the fact that the original 0.6.1 binary stayed running throughout those test, and the 0.6.2[+] binaries just told it to open new windows.

So, the bug exists somewhere between 0.6.1 and 0.6.2 *stock* code.

Erik Walthinsen (omega-omegacs) wrote :

Confirmed, http://git.xfce.org/apps/xfce4-terminal/commit/?id=d1dc0d1f1ef0591d06ef7998c1956834bc4d9869 is indeed the culprit. Not sure what the purpose of the patch was supposed to be (don't have *any* source awareness of xfce4-terminal), so I have no idea if it's a bug in the patch, or the patch was intended to do this. If the patch was intended to have this effect, I would consider the patch to be a VERY BAD IDEA. Given that X returns BadMatch, I'm assuming it's a bug in the patch.

Alistair Buxton (a-j-buxton) wrote :

Erik, the reason you saw that behaviour is because xfce4-terminal runs a server. When you open a second or third terminal it communicates with the server to open the new window, so they are all one process. So when you ran what you thought was a new binary, the old server was still running.

Please test with "--disable-server" - I suspect this would fix the bug. Likely what is happening is the same xfce4-terminal server is being used on both X displays, and is trying to reuse a resource across them both in a way that is not valid. Probably a pixmap or something.

While testing the suspect commit, I was very careful to make sure that I shut down any running instances of the terminal server before trying an alternate binary. Note comment #7 where I notice the server behavior and correct for it in my testing of the versions and the commit.

Running with --disable-server is a workaround, not a fix. The actual fix involves either rolling back the change made in the relevant commit, or fixing whatever it's trying to do so it behaves properly across multiple X screens without causing a resource problem.

Łukasz Kościuk (members) wrote :

Also affects on:
Distributor ID: Ubuntu
Description: Ubuntu 14.04 LTS
Release: 14.04
Codename: trusty
Linux 3.13.0-23-generic #45-Ubuntu x86_64 x86_64 x86_64 GNU/Linux

It's realy anoying.

Confirmed still present on Xubuntu 14.04.

Confirmed still annoying (fatal actually).

Changed in xfce4-terminal:
importance: Unknown → Medium
status: Unknown → Confirmed
Changed in xfce4-terminal (Debian):
status: Unknown → Confirmed
information type: Public → Public Security

Thanks for taking the time to report this bug and helping to make Ubuntu better. We appreciate the difficulties you are facing, but this appears to be a "regular" (non-security) bug. I have unmarked it as a security issue since this bug does not show evidence of allowing attackers to cross privilege boundaries nor directly cause loss of data/privacy. Please feel free to report any other bugs you may find.

information type: Public Security → Public

This is still present in [X]ubuntu 14.10, xfce4-terminal-0.6.3-1ubunutu1.

Not understanding why this very simple-to-fix bug has been left untouched for a year and a half.

This bug indeed sucks, but I have found that running xfce4-terminal with the option --disable-server (as noted by Erik above for testing purposes) has mitigated the impact for me. Since I launch xfce4-terminal with a keyboard shortcut, this was easy enough to do.

I think that very few people (proportionally) use separate screens these days; most folks with multiple monitors just stretch one screen across them. This fact leads to bug like this getting neglected. FWIW, Firefox and Chrome both have the same problem. Although if you try to open another window on the other screen, at least it doesn't crash your initial window, it just opens a tab in it usually.

Xubuntu 18.04:

I also have two screens running two different Xfce sessions, and like others reporting here, I have had a devil of a time getting this xfce4-terminal program to run on the two monitors by specifying the --display=:0.0 and --display=:0.1 options. I have a script that launches the terminal windows on the appropriate screen using the proper options. This works -- then it stops working. Then I get it working again and then it stops working again. This has been going on for years.

A short while ago I had to dive into this yet again and I got things working so that I could open terminals on both screens. This has been good now for the past few weeks. There were no recent upgrades on the system, but I had some sort of smbd(8) fault a short while ago and decided to reboot. When the system came up, I simply could not get xfce4-terminal to start on display :0.1. Even if I selected Terminal Emulator from the built-in Applications menu on the second screen, it would still only start on display :0.0. After another reboot and then screwing around for two more hours, I went looking for a place to report this and found this old thread that was -- unbelievably -- still active. Fortunately for me, I saw the comments above that recommend using the --disable-server option. I added this to my script and now I can open terminals on both screens once again. Since the manpage says:

-disable-server: Do not register with the D-BUS session message bus

I'd say this pretty clearly points to a D-BUS problem. Would someone who in maintaining the terminal program check back regarding the history of D-BUS implementation back in 2013 onward and then coordinate to get this resolved. At the very least, deactivate the server option and allow it to be turned on if desired, in order to stop users from pulling out their hair. The amount of time wasted on this problem by me alone is ... a lot! Regards.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.