Bug 101730 - xorg-server-1.19.3 - XShmGetImage() improperly crops returned image (regression from 1.18.4)
Summary: xorg-server-1.19.3 - XShmGetImage() improperly crops returned image (regressi...
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/General (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL: https://bugzilla.gnome.org/show_bug.c...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-09 17:54 UTC by Andrew Church
Modified: 2018-10-24 18:35 UTC (History)
5 users (show)

See Also:
i915 platform:
i915 features:


Attachments
s (deleted)
2018-10-24 16:59 UTC, smurfy
no flags Details
up (deleted)
2018-10-24 17:04 UTC, smurfy
no flags Details

Description Andrew Church 2017-07-09 17:54:44 UTC
In xorg-server-1.19.3, XShmGetImage() crops the image grab to the absolute region (x,y)-(x+w,y+h).  For example, given a window with geometry 640x480+200+300 and a 640x480 image:

    XShmGetImage(display, window, image, 0, 0, AllPlanes);

returns only the upper-left 440x180 of the window image, clearing the rest of the image to empty.

This is a regression from xorg-server-1.18.4.

This occurs with both the NVIDIA (proprietary, version 384.47) and Intel (open-source, git commit 7e9e92c) drivers, so it would seem to be a bug in the server code.
Comment 2 Andrew Church 2017-07-10 04:38:39 UTC
Reverting https://cgit.freedesktop.org/xorg/xserver/commit/?id=4926845a57fa8b53e18ea7d3434bf5539e9b7782 appears to fix the bug.
Comment 3 Alberts Muktupāvels 2017-10-06 18:43:04 UTC
https://bugzilla.gnome.org/show_bug.cgi?id=788556

This bug have bug788556.c that can be used to reproduce this problem. Window id is hard-coded and should be updated when testing different windows. It seems that problem can be reproduced with GTK+ client-side decorated windows. I tested mostly with gedit. test1.png is always correct, but test2.png has different results and mostly shows problem.

Mentioned commit is in server-1.18-branch branch and I was unable to reproduce this problem with 1.18.4-1ubuntu6.1 that is available in Ubuntu 16.10.

After mentioned commit Xext has two commits that might cause problem:
- https://cgit.freedesktop.org/xorg/xserver/commit/Xext?h=server-1.19-branch&id=92b3cd32066aa5befa67a408cc079cd2ce4c077e
- https://cgit.freedesktop.org/xorg/xserver/commit/?h=server-1.19-branch&id=6c6f09aac7f1d1367a042087b7681c7fdf1d1e0f

I am able to reproduce this problem on 17.04 and 17.10. So for testing I used ubuntu version 1.19.3-1ubuntu1.1 that is available in 17.04. I used pbuilder to build two versions - "original" and version with 6c6f09aa reverted. Then I tried to install both versions multiple times, after install rebooted and tried to reproduce problem with mentioned program. With "original" version I was able to reproduce problem and not with version that had revert.
Comment 4 Antonio Ospite 2017-10-08 16:13:44 UTC
Hi,

I confirm the issue with xserver-xorg 1.9.3 and the radeon driver, it would be great to have this fixed; the issue affects several screen-shotting programs.

Find below another example which produces similar results to the test program Alberts provided:

  gst-launch-1.0 ximagesrc xid=0x040000f8 num-buffers=1 ! videoconvert ! pngenc ! filesink location=out.png

Where xid refers to a program with Client-Side Decorations.

Would writing to the xorg-devel mailing list help to bring more attention to this issue?

Thanks,
   Antonio
Comment 5 Michel Dänzer 2017-10-13 09:54:38 UTC
Thanks for the report, should be fixed in Git master:

commit 885636b7d42b3c7b151fc386d358184db004ce45
Author: Nikolay Martynov <mar.kolya@gmail.com>
Date:   Wed Sep 13 23:23:13 2017 -0400

    XShmGetImage: fix censoring
Comment 6 smurfy 2018-10-24 16:59:36 UTC
Created attachment 142172 [details]
s
Comment 7 smurfy 2018-10-24 17:04:06 UTC
Created attachment 142173 [details]
up
Comment 8 Adam Jackson 2018-10-24 18:34:50 UTC
The content of attachment 142172 [details] has been deleted for the following reason:

spam
Comment 9 Adam Jackson 2018-10-24 18:35:10 UTC
The content of attachment 142173 [details] has been deleted for the following reason:

spam


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.