← Back to team overview

desktop-packages team mailing list archive

[Bug 1395250] Re: XConvertSelection crashes any Gtk+ app

 

** Description changed:

- Trivial program that will crash gnome-terminal. Select some text in
- gnome-terminal and run this:
+ 1) lsb_release -rd
+ Description:	Ubuntu 14.04.1 LTS
+ Release:	14.04
  
+ 2) apt-cache policy gnome-terminal
+ gnome-terminal:
+   Installed: 3.6.2-0ubuntu1
+   Candidate: 3.6.2-0ubuntu1
+   Version table:
+  *** 3.6.2-0ubuntu1 0
+         500 http://us.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
+         100 /var/lib/dpkg/status
+ 
+ 3) What is expected to happen is when one first installs the package libx11-dev , opens two terminal windows, highlights some text in one, and executes the following in the other, it does not crash:
+ gcc -o run run.c -lX11 && ./run
+ 
+ Where run.c is a file containing the following:
  #include <X11/Xlib.h>
  
  int main()
  {
-   Display* dpy = XOpenDisplay(0);
-   Atom selection = XInternAtom(dpy, "PRIMARY", False);
-   Atom target = XInternAtom(dpy, "STRING", False);
-   Window table = RootWindow(dpy, 0);
-   XConvertSelection(dpy, selection, target, None, table, CurrentTime);
-   XSync(dpy, 0);
-   return 0;
+   Display* dpy = XOpenDisplay(0);
+   Atom selection = XInternAtom(dpy, "PRIMARY", False);
+   Atom target = XInternAtom(dpy, "STRING", False);
+   Window table = RootWindow(dpy, 0);
+   XConvertSelection(dpy, selection, target, None, table, CurrentTime);
+   XSync(dpy, 0);
+   return 0;
  }
  
+ 4) What happens instead is it crashes consistently.
  ProblemType: Bug
  DistroRelease: Ubuntu 12.04
  Package: gnome-terminal 3.4.1.1-0ubuntu1
  ProcVersionSignature: Ubuntu 3.2.0-70.105-generic 3.2.63
  Uname: Linux 3.2.0-70-generic x86_64
  NonfreeKernelModules: blackmagic nvidia
  ApportVersion: 2.0.1-0ubuntu17.8
  Architecture: amd64
  Date: Fri Nov 21 19:50:03 2014
  ExecutablePath: /usr/bin/gnome-terminal
  MarkForUpload: True
  ProcEnviron:
-  LANGUAGE=en_US:
-  PATH=(custom, user)
-  LANG=en_US.UTF-8
-  SHELL=/bin/bash
+  LANGUAGE=en_US:
+  PATH=(custom, user)
+  LANG=en_US.UTF-8
+  SHELL=/bin/bash
  SourcePackage: gnome-terminal
  UpgradeStatus: No upgrade log present (probably fresh install)

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to gnome-terminal in Ubuntu.
https://bugs.launchpad.net/bugs/1395250

Title:
  XConvertSelection crashes any Gtk+ app

Status in GTK+ GUI Toolkit:
  Fix Released
Status in gnome-terminal package in Ubuntu:
  Confirmed

Bug description:
  1) lsb_release -rd
  Description:	Ubuntu 14.04.1 LTS
  Release:	14.04

  2) apt-cache policy gnome-terminal
  gnome-terminal:
    Installed: 3.6.2-0ubuntu1
    Candidate: 3.6.2-0ubuntu1
    Version table:
   *** 3.6.2-0ubuntu1 0
          500 http://us.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
          100 /var/lib/dpkg/status

  3) What is expected to happen is when one first installs the package libx11-dev , opens two terminal windows, highlights some text in one, and executes the following in the other, it does not crash:
  gcc -o run run.c -lX11 && ./run

  Where run.c is a file containing the following:
  #include <X11/Xlib.h>

  int main()
  {
    Display* dpy = XOpenDisplay(0);
    Atom selection = XInternAtom(dpy, "PRIMARY", False);
    Atom target = XInternAtom(dpy, "STRING", False);
    Window table = RootWindow(dpy, 0);
    XConvertSelection(dpy, selection, target, None, table, CurrentTime);
    XSync(dpy, 0);
    return 0;
  }

  4) What happens instead is it crashes consistently.
  ProblemType: Bug
  DistroRelease: Ubuntu 12.04
  Package: gnome-terminal 3.4.1.1-0ubuntu1
  ProcVersionSignature: Ubuntu 3.2.0-70.105-generic 3.2.63
  Uname: Linux 3.2.0-70-generic x86_64
  NonfreeKernelModules: blackmagic nvidia
  ApportVersion: 2.0.1-0ubuntu17.8
  Architecture: amd64
  Date: Fri Nov 21 19:50:03 2014
  ExecutablePath: /usr/bin/gnome-terminal
  MarkForUpload: True
  ProcEnviron:
   LANGUAGE=en_US:
   PATH=(custom, user)
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  SourcePackage: gnome-terminal
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/gtk/+bug/1395250/+subscriptions


References