XConvertSelection crashes any Gtk+ app

Bug #1395250 reported by Spitzak-k
36
This bug affects 4 people
Affects Status Importance Assigned to Milestone
GTK+
Fix Released
Critical
gtk+3.0 (Ubuntu)
Fix Released
High
Unassigned

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)

Revision history for this message
Spitzak-k (spitzak-k) wrote :
Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

Looks like a bug in Gtk+ -- the same code can also crash gedit, evince...

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in gnome-terminal (Ubuntu):
status: New → Confirmed
Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :
Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

Upstream fix is https://git.gnome.org/browse/gtk+/commit/?id=732af31 (I haven't verified).

Ubuntu folks should verify this fix, and if indeed works then backport to their Gtk+ packages.

summary: - XConvertSelection crashes gnome-terminal
+ XConvertSelection crashes any Gtk+ app
Changed in gtk:
importance: Unknown → Critical
status: Unknown → Fix Released
penalvch (penalvch)
description: updated
Revision history for this message
penalvch (penalvch) wrote :

Trivially reproducible as per Bug Description without elevated permissions, across gtk based applications:
gnome-terminal: https://bugs.launchpad.net/ubuntu/+source/gnome-terminal/+bug/1397502
gedit: https://bugs.launchpad.net/ubuntu/+source/gedit/+bug/1397503

affects: gnome-terminal (Ubuntu) → gtk+3.0 (Ubuntu)
Changed in gtk+3.0 (Ubuntu):
importance: Undecided → High
status: Confirmed → Triaged
Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

Dear Ubuntu guys,

Is there any chance of you releasing an update?

Here's another report of presumably the same bug: https://bugzilla.gnome.org/show_bug.cgi?id=743115

The reporter tried to copy-paste from gnome-terminal into supertuxkart, causing all his work in gnome-terminal getting lost.

It's a critical bug with a known fix. Could you please release updated packages?

Revision history for this message
Iain Lane (laney) wrote :

Ok thanks, I'll look.

Changed in gtk:
status: Fix Released → New
Changed in gtk:
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gtk+3.0 - 3.14.8-0ubuntu1

---------------
gtk+3.0 (3.14.8-0ubuntu1) vivid; urgency=medium

  * Fallback icon themes are deprecated & ignored upstream, drop the patch and
    the setting in debian/settings.ini.
  * New upstream release.
    + Fixes XConvertSelection crashing GTK apps. (LP: #1395250)
  * 0001-Menu-items-force-loading-16x16-icons.patch,
    0002-gtkimagemenuitem-create-widget-for-action-icons-lazi.patch: Drop,
    applied in this release.
  * debian/patches/0001-css-Add-gtk-dpi-CSS-property-hack.patch,
    debian/patches/0002-css-use-pre-3.16-gtk_css_style_property_register.patch:
    Cherry-pick patches from upstream to fix apps responding to changes to the
    value of the org.gnome.desktop.interface text-scaling factor key. (LP:
    #1408212)
  * Bump version of a-i-t build-dep to get more icons required for reftests.
 -- Iain Lane <email address hidden> Mon, 09 Feb 2015 18:00:35 +0000

Changed in gtk+3.0 (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
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.