xterm dies on popup-menu action

Bug #756273 reported by Owen Leibman on 2011-04-10
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
xterm (Ubuntu)
Undecided
Unassigned

Bug Description

Binary package hint: xterm

When I use Xresources to assign a popup-menu action to a PF key, and then attempt to use that PF key, xterm dies:
X Error of failed request: BadWindow (invalid Window parameter)
  Major opcode of failed request: 38 (X_QueryPointer)
  Resource id in failed request: 0x0
  Serial number of failed request: 338
  Current serial number in output stream: 338
This is exactly the same as Debian Bug 426364, which was marked as done on June 18, 2007 - see http://<email address hidden>/msg64513.html . Apparently the fix applied at that time has been regressed.

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: xterm 261-1ubuntu3
ProcVersionSignature: Ubuntu 2.6.35-28.49-generic 2.6.35.11
Uname: Linux 2.6.35-28-generic x86_64
NonfreeKernelModules: wl
Architecture: amd64
DRM.card0.DP.1:
 status: disconnected
 enabled: disabled
 dpms: On
 modes:
 edid-base64:
DRM.card0.HDMI.A.1:
 status: disconnected
 enabled: disabled
 dpms: On
 modes:
 edid-base64:
DRM.card0.LVDS.1:
 status: connected
 enabled: enabled
 dpms: On
 modes: 1366x768
 edid-base64: AP///////wAlzBQAAAAAAAAUAQOAHxJ4Cof1lFdPjCcnUFQAAAABAQEBAQEBAQEBAQEBAQEBvBtWhFAAFjAwIBQANa4QAAAYvBtWhFAAFjAwIBQANa4QAAAAAAAA/gBIUjFWVIAxNDBHVzAxAAAAAAAAAAAAAAAAAAEBCiAgAEs=
DRM.card0.VGA.1:
 status: disconnected
 enabled: disabled
 dpms: On
 modes:
 edid-base64:
Date: Sat Apr 9 20:27:28 2011
DkmsStatus:
 bcmwl, 5.60.48.36+bdcom, 2.6.35-28-generic, x86_64: installed
 bcmwl, 5.60.48.36+bdcom, 2.6.35-27-generic, x86_64: installed
 bcmwl, 5.60.48.36+bdcom, 2.6.35-22-generic, x86_64: installed
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101007)
MachineType: Dell Inc. Inspiron N4010
ProcCmdLine: BOOT_IMAGE=/boot/vmlinuz-2.6.35-28-generic root=/dev/sda3 loop=/hostname/disks/root.disk ro quiet splash
ProcEnviron:
 LANGUAGE=
 PATH=(custom, user)
 LANG=en_US.utf8
 SHELL=/bin/bash
SourcePackage: xterm
dmi.bios.date: 08/12/2010
dmi.bios.vendor: Dell Inc.
dmi.bios.version: A07
dmi.board.name: 021CN3
dmi.board.vendor: Dell Inc.
dmi.board.version: A07
dmi.chassis.type: 8
dmi.chassis.vendor: Dell Inc.
dmi.chassis.version: A07
dmi.modalias: dmi:bvnDellInc.:bvrA07:bd08/12/2010:svnDellInc.:pnInspironN4010:pvrA07:rvnDellInc.:rn021CN3:rvrA07:cvnDellInc.:ct8:cvrA07:
dmi.product.name: Inspiron N4010
dmi.product.version: A07
dmi.sys.vendor: Dell Inc.
glxinfo: Error: [Errno 2] No such file or directory
system:
 distro: Ubuntu
 codename: maverick
 architecture: x86_64
 kernel: 2.6.35-28-generic
---
Architecture: amd64
CompizPlugins: No value set for `/apps/compiz-1/general/screen0/options/active_plugins'
CompositorRunning: compiz
DRM.card0.DP.1:
 status: disconnected
 enabled: disabled
 dpms: Off
 modes:
 edid-base64:
DRM.card0.HDMI.A.1:
 status: disconnected
 enabled: disabled
 dpms: Off
 modes:
 edid-base64:
DRM.card0.LVDS.1:
 status: connected
 enabled: enabled
 dpms: On
 modes: 1366x768
 edid-base64: AP///////wAlzBQAAAAAAAAUAQOAHxJ4Cof1lFdPjCcnUFQAAAABAQEBAQEBAQEBAQEBAQEBvBtWhFAAFjAwIBQANa4QAAAYvBtWhFAAFjAwIBQANa4QAAAAAAAA/gBIUjFWVIAxNDBHVzAxAAAAAAAAAAAAAAAAAAEBCiAgAEs=
DRM.card0.VGA.1:
 status: disconnected
 enabled: disabled
 dpms: Off
 modes:
 edid-base64:
DistUpgraded: Log time: 2011-04-28 18:32:23.545489
DistroCodename: natty
DistroRelease: Ubuntu 11.04
DistroVariant: ubuntu
DkmsStatus:
 bcmwl, 5.100.82.38+bdcom, 2.6.38-8-generic, x86_64: installed
 bcmwl, 5.100.82.38+bdcom, 2.6.35-28-generic, x86_64: installed
GraphicsCard:
 Intel Corporation Core Processor Integrated Graphics Controller [8086:0046] (rev 18) (prog-if 00 [VGA controller])
   Subsystem: Dell Device [1028:0456]
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101007)
MachineType: Dell Inc. Inspiron N4010
NonfreeKernelModules: wl
Package: xterm 268-1ubuntu1
PackageArchitecture: amd64
ProcEnviron:
 LANGUAGE=en_US:en
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-2.6.38-8-generic root=UUID=18B4B7BBB4B799A8 loop=/hostname/disks/root.disk ro quiet splash
ProcVersionSignature: Ubuntu 2.6.38-8.42-generic 2.6.38.2
Renderer: Unknown
Tags: natty ubuntu compiz-0.9
Uname: Linux 2.6.38-8-generic x86_64
UpgradeStatus: Upgraded to natty on 2011-04-29 (0 days ago)
UserGroups: adm admin cdrom dialout lpadmin plugdev sambashare
dmi.bios.date: 03/31/2011
dmi.bios.vendor: Dell Inc.
dmi.bios.version: A13
dmi.board.name: 021CN3
dmi.board.vendor: Dell Inc.
dmi.board.version: A13
dmi.chassis.type: 8
dmi.chassis.vendor: Dell Inc.
dmi.chassis.version: A13
dmi.modalias: dmi:bvnDellInc.:bvrA13:bd03/31/2011:svnDellInc.:pnInspironN4010:pvrA13:rvnDellInc.:rn021CN3:rvrA13:cvnDellInc.:ct8:cvrA13:
dmi.product.name: Inspiron N4010
dmi.product.version: A13
dmi.sys.vendor: Dell Inc.
version.compiz: compiz 1:0.9.4+bzr20110415-0ubuntu2
version.ia32-libs: ia32-libs 20090808ubuntu13
version.libdrm2: libdrm2 2.4.23-1ubuntu6
version.libgl1-mesa-dri: libgl1-mesa-dri 7.10.2-0ubuntu2
version.libgl1-mesa-dri-experimental: libgl1-mesa-dri-experimental N/A
version.libgl1-mesa-glx: libgl1-mesa-glx 7.10.2-0ubuntu2
version.xserver-xorg: xserver-xorg 1:7.6+4ubuntu3
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:6.14.0-0ubuntu4
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.14.0-4ubuntu7
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:0.0.16+git20110107+b795ca6e-0ubuntu7

Owen Leibman (eclipsechasers2) wrote :
Thomas Dickey (dickey-his) wrote :

It's unlikely to be the same bug.

More likely (since no one's reported anything recent - Ubuntu's
xterm is from last summer) is this item fixed in patch #263:

Patch #263 - 2010/10/13
corrected initialization of "misc" resource values, to ensure that xterm has allocated a copy of strings which may not have been malloc'd by the X library (Debian #600129).

bugbot (bugbot) wrote :

Hey Owen,

Hi, have you had a chance to test if this bug is still present in natty?

If it does (and if you're the original reporter), please boot into natty
and run the command:

  apport-collect <bug-number>

which will update the bug with fresh logs and tag the bug as affecting
natty. (It is best to run this right after reproducing the problem.)

Changed in xterm (Ubuntu):
status: New → Incomplete

apport information

tags: added: apport-collected compiz-0.9 natty ubuntu
description: updated

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

apport information

Owen Leibman (eclipsechasers2) wrote :

Bug still occurring in natty, error messages exactly the same as before (except that serial number of failed request has changed, which I think is as it should be). xterm -version shows XTerm(268).

Thomas Dickey (dickey-his) wrote :

Perhaps your machine doesn't have the fonts used for the menus.
(None of the attachments or responses address this area, packagers
generally decline to add fonts as dependencies to xterm).

Owen Leibman (eclipsechasers2) wrote :

The fonts are there. I know this because I can use the various control-mouse button options to show the menus correctly. It is only when I try to perform the same action using a function key that the program crashes. For the record, I just want to use the function keys because control-mouse button is awkward, especially on a laptop with a touchpad and no mouse.

Thomas Dickey (dickey-his) wrote :

I see (now, having read through the changes, and made a test-case). The fix in #226
was for the core-dump. The report was for two errors, and one was not addressed.
I can see that it's dying in the call in menu.c
   XtCallActionProc(w, "XawPositionSimpleMenu", event, params, 1);

The widget itself is okay (commenting out that call makes it "work").
But the problem is in the Xaw library. Reading the source code, that
causes it to go into a case-statement where the normal event types
are ButtonPress, ButtonRelease, etc. None of the normal types apply;
it goes into a default case for
   PositionMenu(menu, NULL);
which asks it to get the child-window of the menu-widget which encloses
the pointer. However, the pointer is probably outside the menu widget
since it's pointing to the vt100 window. So the XQueryPointer call fails

I might be able to appease it by checking for this case and warping the
pointer onto the menu widget (will see).

thanks for the feedback

On Sat, Apr 30, 2011 at 12:02:06AM -0000, Thomas Dickey wrote:
> I might be able to appease it by checking for this case and warping the
> pointer onto the menu widget (will see).

This seems to work:

===================================================================
RCS file: RCS/menu.c,v
retrieving revision 1.289
diff -u -r1.289 menu.c
--- menu.c 2011/04/24 18:18:30 1.289
+++ menu.c 2011/04/30 00:22:23
@@ -834,10 +834,29 @@
 {
     TRACE(("HandlePopupMenu\n"));
     if (domenu(w, event, params, param_count)) {
+ XtermWidget xw = term;
+ TScreen *screen = TScreenOf(xw);
+
 #if OPT_TOOLBAR
  w = select_menu(w, mainMenu)->w;
 #endif
- XtCallActionProc(w, "XawPositionSimpleMenu", event, params, 1);
+ /*
+ * The action procedure in SimpleMenu.c, PositionMenu does not expect a
+ * key translation event when we are popping up a menu. In particular,
+ * if the pointer is outside the menu, then the action procedure will
+ * fail in its attempt to determine the location of the pointer within
+ * the menu. Anticipate that by warping the pointer into the menu when
+ * a key event is detected.
+ */
+ switch (event->type) {
+ case KeyPress:
+ case KeyRelease:
+ XWarpPointer(screen->display, None, XtWindow(w), 0, 0, 0, 0, 0, 0);
+ break;
+ default:
+ XtCallActionProc(w, "XawPositionSimpleMenu", event, params, 1);
+ break;
+ }
  XtCallActionProc(w, "MenuPopup", event, params, 1);
     }
 }

--
Thomas E. Dickey <email address hidden>
http://invisible-island.net
ftp://invisible-island.net

Launchpad Janitor (janitor) wrote :

[Expired for xterm (Ubuntu) because there has been no activity for 60 days.]

Changed in xterm (Ubuntu):
status: Incomplete → Expired
Bryce Harrington (bryce) on 2011-07-01
Changed in xterm (Ubuntu):
status: Expired → Triaged
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xterm - 271-1ubuntu1

---------------
xterm (271-1ubuntu1) oneiric; urgency=low

  * Merge from Debian unstable (LP: #756273), remaining changes:
    - debian/patches/950_ubuntu_charclass_highlight.diff: Enabled URL
      highlighting
    - debian/patches/Add 951_uxterm_utf8_title.diff: Set utf8Titles to true by
      default when using uxterm, so that it displays utf8 directories in titles
      properly. May cause issues with apps that use control sequences for
      updating the xterm titlebar - users should use xterm or set utf8Title
      to false in this case.
    - debian/gbp.conf: Use "Ubuntu" in "debian-branch" directly
    - Install .desktop files.
  * control: Revert the change to Vcs headers.
  * xterm.overrides: Purge old utempter-reversal cruft.

xterm (271-1) unstable; urgency=low

  * New upstream release
    - amend change for Debian #110226 so that "-h" or "-v" options cause an
      exit, rather than simply printing to stdout while the window is
      displayed (closes: #629358)
    - handle special-case of KeyPress translated to popup-menu action
      (LP: #756273)
 -- Timo Aaltonen <email address hidden> Thu, 11 Aug 2011 15:04:15 +0300

Changed in xterm (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.