Use of -g workarea causes X Error of failed request: BadValue

Bug #192218 reported by David R. Hedges
46
This bug affects 8 people
Affects Status Importance Assigned to Milestone
rdesktop (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: rdesktop

On my hardy x86-64 machine, I attempted to use rdesktop with the following options (as I do on my gutsy x86 box):

rdesktop -n my-machine -k en-us -g workarea -D -K -z target-machine

After, experiencing an error, I isolated the problem down to this:

david@marshall:~$ /usr/bin/rdesktop -g workarea serverhostname
Autoselected keyboard map en-us
X Error of failed request: BadValue (integer parameter out of range for operation)
  Major opcode of failed request: 1 (X_CreateWindow)
  Value in failed request: 0x0
  Serial number of failed request: 41
  Current serial number in output stream: 52

The manpage for rdesktop provides this information about the -g flag:
Desktop geometry (WxH). If geometry is the special word "workarea", the geometry will be fetched from the extended window manager hints property _NET_WORKAREA, from the root window.

This is a "fresh" hardy alpha4 amd64 install + all updates to date.
rdesktop 1.5.0-3+cvs20071006
xorg 1:7.3+10ubuntu4
xserver-xorg-core 2:1.4.1~git20080131-1ubuntu2
nvidia-glx-new 169.09+2.6.24.8-7.19
nvidia-kernel-common 20051028+1ubuntu8
compiz 1:0.7.0-0ubuntu2

Please let me know if there's additional information I can provide.

Tags: patch

Related branches

Revision history for this message
dfalk (dfalk) wrote :

I second this. I have very similar specs. Running hardy 64, but I'm running up-to-date as of today (hardy's release).

Revision history for this message
Daniel T Chen (crimsun) wrote :

Is this symptom still reproducible in 8.10 or 9.04?

Changed in rdesktop:
status: New → Incomplete
Revision history for this message
dfalk (dfalk) wrote :

Yes it is still reproducible. Percentage values and "WxH" values for -g do work.

Revision history for this message
Valist (sew-ulforge) wrote :

I have the same error that you had (I copied over the error message it gave me and googled it, and here I am!). However, I don't think I was trying to do the same thing as you when I received it. I tried to run Savage2 through a terminal (since nothing happened the other way). I'm not Ubuntu literate to understand what you were trying to do, but it has something to do with the way things look, perhaps? I have a netbook, acer aspire one, with ubuntu 8.10 and netbook remix--a very small screen where not much fits(1024x600). Nothing has been updated besides that, because my wifi doesn't work with an updated kernel. Anyways, any suggestions would be awesome. Does anyone know why I'd be getting this error as well, since I'm not doing the same thing? :O I'm having a lot of trouble trying to fix the problem, as I don't know why I'm having it to begin with.

Revision history for this message
David R. Hedges (p14nd4) wrote :

Still reproducible in 9.04 (Jaunty) with rdesktop 1.6.0-2ubuntu1.

David R. Hedges (p14nd4)
Changed in rdesktop (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Falcon1 (mike-valk) wrote :

9.04 (Jaunty) 64Bit as well

Revision history for this message
Caleb Case (calebcase) wrote :

Reproducible on 9.10 (Karmic) 64bit

Revision history for this message
Falcon1 (mike-valk) wrote :

10.04 (Lucid) 64Bit also

Revision history for this message
KeenEars (fl-blade) wrote :

10.04 32bit too. Rdesktop and krdc are crashing when using the Kaspersky Administration Kit in terminal session. No matter what the -g option parameter is.

Revision history for this message
lilphil (lilphil) wrote :

This bug has been fixed in subversion revision 1550 and affects 64bit only, which presumably means that KeenEars is seeing a different bug.

http://rdesktop.svn.sourceforge.net/viewvc/rdesktop?view=revision&revision=1550

I have attached the relevant patch.

In order to fix this on a temporary basis for yourself:

apt-src install rdesktop
cp ~/Downloads/ewmhints.c.patch rdesktop-1.6.0 # or wherever you downloaded the patch to
cd rdesktop-1.6.0
patch -p2 < ewmhints.c.patch
apt-src build rdesktop

then you can install the resulting .deb file with dpkg -i.

tags: added: patch
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

The upstream patch seems to make sense since we have this in get_current_workarea():
    unsigned char *prop_return;
    uint32 *return_words;
    ...
    return_words = (uint32 *) prop_return;

uint32 is defined in rdesktop's types.h to be:
    typedef unsigned int uint32;

On 32 bit:
unsigned char *: 4
unsigned int: 4

But this results in mismatched sizes on 64 bit:
unsigned char *: 8
unsigned int: 4

get_current_workarea() sets prop_return via get_property_value(..., &prop_return, ...) which calls XGetWindowProperty(..., prop_return), and the man page of XGetWindowProperty shows this as an unsigned char **prop_return. Therefore, when it is set on 64 bit it can be as big as 8.

Since sizeof(long *) is 8 on 64 bit, this patch should fix the issue there. sizeof(long *) is 4 on 32 bit, so nothing should change on 32 bit (since sizeof(unsigned char *) is also 4).

Changed in rdesktop (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Tested with xrdp server in a VM (sudo apt-get install xrdp).

Old version:
rdesktop <vm> # WORKS
rdesktop -g workarea <vm> # FAILS as per this bug

Both of these are confirmed to work now:
rdesktop <vm> # WORKS
rdesktop -g workarea <vm> # WORKS

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

This bug was fixed in the package rdesktop - 1.6.0-3ubuntu3

---------------
rdesktop (1.6.0-3ubuntu3) natty; urgency=low

  * debian/patches/15_lp192218.dpatch: fix -g workarea on 64 bit machines
    (LP: #192218)
 -- Jamie Strandboge <email address hidden> Wed, 09 Mar 2011 15:18:10 -0600

Changed in rdesktop (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Tigra Polosatij (polosatij-tigra) wrote :

Where is patched package for ubuntu lucid?

Revision history for this message
Tigra Polosatij (polosatij-tigra) wrote :

Second try: Where is patched package for ubuntu lucid?
rdesktop_1.6.0-2ubuntu3.1_amd64.deb didn't fix this bug!!!

Revision history for this message
Julien (julien-t43) wrote :

got this problem too:
$ rdesktop -m -a 8 -g 900x550 -z -P -u Administrator 127.0.0.1

stop in middle with
X Error of failed request: BadValue (integer parameter out of range for operation)
  Major opcode of failed request: 53 (X_CreatePixmap)
  Value in failed request: 0x0
  Serial number of failed request: 1780947
  Current serial number in output stream: 1781145

with Ubuntu 12.04 (liveusb) and 1.7.0-1ubuntu2

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

Other bug subscribers

Remote bug watches

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