#132 inconsistent pad value causes SEGV


I am using Xorg version of X11.

When I tried rdesktop 1.5.0 on my PC that runs linux (FC5),
rdesktop crashes (SEGV in XputImage) every time
a certain GUI operation was done.
For example, when I try to open "Open File" menu of adobe
acrobat 7.

I tracked down the problem to an inconsistent calculation
of pad value that is passed to XCreateImage() that was
called before XPutImage(). XCreateImage() returned NULL image pointer,
and this caused the subsequent XPutImage() to crash.

With the attached patch, rdesktop runs fine now : at least, it doesn't
crash on my PC.

I think the use of 16 bit pixel value on my NDIVIA graphics chip
revealed the dormant problem.
The crash occurred irrespective of the
display setting on my ordinary windows desktop on real window PC.
(Oh, I forgot to check the command parameter to rdesktop, but
in any case, the calculation seems to be inconsistent and
incorret at worst.)

X11 version
X Window System Version 7.0.0
Release Date: 21 December 2005
X Protocol Version 11, Revision 0, Release 7.0
Build Operating System:Linux 2.6.9-42.0.8.ELsmp i686Red Hat, Inc.
Current Operating System: Linux dell-w2k-note 2.6.20-1.2312.fc5 #1 Tue Apr 10 15:09:44 EDT 2007 i686
Build Date: 08 April 2007
(**) NVIDIA(0): Depth 16, (--) framebuffer bpp 16
(II) NVIDIA(0): Setting mode "1600x1200"


  • zephyrus

    Patches to xwin.c

  • Marc Schütz
    Marc Schütz

    Logged In: YES
    Originator: NO

    I can confirm both the bug and your patch for it. In my case, the bug was triggered by an update to xorg-x11-libs-6.9.0-50.32.5 via SuSE online update. It didn't occur with the previous version.

    After application of your patch, rdesktop seems to work now. Thanks!

  • Logged In: YES
    Originator: NO

    I also can confirm this problem. I get SIGSEGV at logon time to a server with rdesktop 1.5. The patch allows me to log in and work, thanks for it.

    X Window System Version 7.1.1
    Release Date: 12 May 2006
    X Protocol Version 11, Revision 0, Release 7.1.1
    Build Operating System: UNKNOWN
    Current Operating System: Linux nemeth 2.6.19 #1 PREEMPT Sun Dec 3 06:51:32 CET 2006 i686
    Build Date: 04 April 2007
    (**) NV(0): Depth 16, (--) framebuffer bpp 16
    (--) NV(0): Virtual size is 1024x768 (pitch 1024)

  • Logged In: NO

    I am glad that my patch saved a couple of other users, and it also
    seems to be that the problem is wide.
    Maybe someone who knows the internal of X11 Xorg version library, etc.
    should track down why the updated library causes this problem.
    In my original patch, I tried to use the system supplied macro
    to calculate the pad value to see if the consistent use of the macro
    would solve the problem. No, it didn't.
    The only way to avoid the crash was to use the submitted patch.
    Something fishy is going on here.

    Anyway, thank you for the follow-up posts. Initially, I was
    surprised that rdesktop would not run and I thought it was only
    my particular hardware. But it seems that the recent update of x libraries, etc. causes the problem.