Window creation/destruction causes segmentation fault in seamless mode

Bug #275545 reported by fubarbundy
42
This bug affects 8 people
Affects Status Importance Assigned to Milestone
rdesktop (Ubuntu)
Confirmed
Undecided
Unassigned
Nominated for Karmic by ktp420

Bug Description

Binary package hint: rdesktop

Remote OS: Windows XP Pro SP3
Local OS: Ubuntu Intrepid alpha 6 64-bit

Steps to reproduce: open or close pretty much any window, e.g. Explorer or Firefox
                            or: change directories in Explorer, show/hide folder tree
                            or: click the drop-down address bar on Firefox
                            or: probably loads of other cases, but I think these are enough!

Affected versions: rdesktop 1.6.0-2ubuntu1, amd64 (Intrepid)
                                rdesktop 1.6.0-2, amd64 (from Debian: ftp://ftp.debian.org/debian/pool/main/r/rdesktop/)
                                rdesktop 1.5.0-3+cvs20071006ubuntu0.1 (Hardy)
Unaffected versions:rdesktop 1.5.0-1etch2 (from Debian: ftp://ftp.debian.org/debian/pool/main/r/rdesktop/)

Revision history for this message
Olivier Lemaire (olivier-lemaire) wrote :

Bug confirmed with rdesktop 1.5.0-3+cvs20071006ubuntu0.1 under 8.04.1 LTS x86_64 (2.6.24-21-server #1 SMP Tue Oct 21 23:40:13 UTC 2008 x86_64 GNU/Linux) :(

Any plans to have it fixed on this 8.04 LTS ?

Cheers,
--
lem

Revision history for this message
ar (arjenmeijernl) wrote :

On Rdesktop 1.6.0. under ubuntu 9.04 64 bits and with Windows 2003 server same error.

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

Hi, Same problem here using Ubuntu 9.04 and rdesktop 1.6.?

Installed the Debian rdesktop version 1.6.2_amd64. Still same issue. See bug 275528 for instructions

ktp420 (ktp420)
Changed in rdesktop (Ubuntu):
status: New → Confirmed
Revision history for this message
Hyun (hyunwoo-park) wrote :
Download full text (4.3 KiB)

Hi, everyone
I have an exact same problem with my 64bit CPU. After some investigation, I added some dump routines to see what's going on around icon settings as below.
As you can see the result of the printf, the icon bitmap and the size has been changed after XChangeProperty function that should not be happen. This cause the segmentation fault after next call of ewmh_set_icon function
Is it a fault of XGetWindowProperty function on xlib? or some other problem?

Regards
Hyunwoo Park

~~~~~
diff for debug
~~~~~

[hyun@hyun trunk]$ LANG=en_US svn diff
Index: ewmhints.c
===================================================================
--- ewmhints.c (revision 1505)
+++ ewmhints.c (working copy)
@@ -440,10 +440,27 @@

  if (get_property_value(wnd, "_NET_WM_ICON", 10000, &nitems, &props, 1) >= 0)
  {
+ printf( "%s: %d: %d\n", __func__, __LINE__, nitems );
   cur_set = (uint32 *) props;
+ {
+ int a, len = nitems;
+ unsigned char *ptr = cur_set;

+ printf( "len: %d\n", len );
+ for( a=0; a<len; )
+ {
+ printf( " %02x", ptr[a] );
+ a++;
+ if( (a & 15) == 0 )
+ printf( "\n" );
+ }
+ if( (a & 15) != 0 )
+ printf( "\n" );
+ }
+
   for (i = 0; i < nitems;)
   {
+ printf( "%s: %d: i=%d\n", __func__, __LINE__, i );
    if (cur_set[i] == width && cur_set[i + 1] == height)
     break;

@@ -462,6 +479,7 @@
  }
  else
  {
+ printf( "%s: %d: new for %dX%d\n", __func__, __LINE__, height, width );
   new_set = xmalloc((width * height + 2) * 4);
   icon = new_set;
   nitems = width * height + 2;
@@ -480,6 +498,23 @@
    ((rgba_data[i * 4 + 2] << 0) & 0x000000FF);
  }

+ // dump before changing property
+ {
+ int a, len = nitems;
+ unsigned char *ptr = icon;
+
+ printf( "len: %d\n", len );
+ for( a=0; a<len; )
+ {
+ printf( " %02x", ptr[a] );
+ a++;
+ if( (a & 15) == 0 )
+ printf( "\n" );
+ }
+ if( (a & 15) != 0 )
+ printf( "\n" );
+ }
+
  XChangeProperty(g_display, wnd, g_net_wm_icon_atom, XA_CARDINAL, 32,
    PropModeReplace, (unsigned char *) (new_set ? new_set : cur_set), nitems);

@@ -487,6 +522,29 @@
   XFree(cur_set);
  if (new_set)
   xfree(new_set);
+
+ // dump after changing preperty
+ if (get_property_value(wnd, "_NET_WM_ICON", 10000, &nitems, &props, 1) >= 0)
+ {
+ printf( "%s: %d: %d confirming...\n", __func__, __LINE__, nitems );
+ {
+ int a, len = nitems;
+ unsigned char *ptr = props;
+
+ printf( "len: %d\n", len );
+ for( a=0; a<len; )
+ {
+ printf( " %02x", ptr[a] );
+ a++;
+ if( (a & 15) == 0 )
+ printf( "\n" );
+ }
+ if( (a & 15) != 0 )
+ printf( "\n" );
+ }
+ }
+ else
+ printf( "failed to get property\n" );
 }

 void
[hyun@hyun trunk]$

~~~~~
result of printf
~~~~~

ewmh_set_icon: 482: new for 16X16
len: 258
 10 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 31 9a ce ff 31 9a ce ff 31 96 ce ff 29 96 c6 ff
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 31 9a ce ff
 ff ff ...

Read more...

Revision history for this message
Alex Ward (awarddev2) wrote :

I can confirm that this still exists with 10.10 64-bit (no surprise as it has not been closed).

I'd be happy to help debug, as seamless RDP is basically DOA for me :-(

Also, after doing a lot of reading, I have found two things:

1. Lots of people report that 1.5.0 from debian etch works much better. Unfortunately, I did not find that it helped.
2. XP SP3 (as opposed to XP2) seems to have have aggravated the issue. Unfortunately, I do not have an SP2 system available currently.

So, if anyone is still paying attention to this, like I said, I'm willing to put some effort in to fix this two year old issue. I used to work on screen-sharing software, so I'm familiar with the paradigm. However, it has been a loooooooooong time since I wrote a line of C -- it would be good for me to dust off that part of my brain -- so I will probably need a little guidance, and have a few stupid questions along the way.

Revision history for this message
brian mullan (bmullan) wrote :

I too would like to see this seg fault problem fixed. Its been there for several years now and
still shows up on Ubuntu 10.10 rdesktop.

Using a java rdp client on the very same machine works but it lacks some of the useful options of rdesktop.

Anyway the java client works and rdesktop fails (same client machine & same target windows server).

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.