Bug 215173

Summary: X11 XGetWindowProperty _NET_WORKAREA wrong on x86_64
Product: [Fedora] Fedora Reporter: Ian MacArthur <ian>
Component: libX11Assignee: Søren Sandmann Pedersen <sandmann>
Status: CLOSED NOTABUG QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 6CC: kem, mcepl, xgl-maint
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-04-16 14:41:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
C code sample that illustrates the failure
none
Notes on results obtained running test-code none

Description Ian MacArthur 2006-11-11 21:44:04 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us) AppleWebKit/418.9 (KHTML, like Gecko) Safari/419.3

Description of problem:
I have a piece of code that uses the _NET_WORKAREA property of XGetWindowProperty to determine the 
usable screen area. This code works correctly under i386 builds but fails on x86-64 builds.

Investigation shows that, although XGetWindowProperty claims in it's returned status that the returned 
parameter array is 32-bit aligned, examination of the raw byte array returned shows it is actually 64-bit 
aligned.
However, subsequent codes depends on the format value returned by XGetWindowProperty to extract 
the returned values, and so of course it fails - the resulting window sizes are therefore unusable.

I would guess that the raw parameter array returned by XGetWindowProperty has not been correctly 
packed and so returns the machine native alignment, but fails to report that in the format status code.


Version-Release number of selected component (if applicable):
Xorg 7.1.1 kernel-2.6.18-1.2798.fc6

How reproducible:
Always


Steps to Reproduce:
1. Build code that uses XGetWindowProperty and _NET_WORKAREA
2. Show window sized to fit workarea
3.

Actual Results:
Window appears, but wrong size and positon, since the x, y, w, h, screen workarea parameters have been 
miscomputed

Expected Results:
A window the right size and position to fit the screen should appear

Additional info:

Comment 1 Matthias Clasen 2006-11-12 17:25:32 UTC
You need to show us your code for us to find the error...

Comment 2 Ian MacArthur 2006-11-13 10:59:11 UTC
Created attachment 141036 [details]
C code sample that illustrates the failure

Comment 3 Ian MacArthur 2006-11-13 11:21:00 UTC
Created attachment 141039 [details]
Notes on results obtained running test-code

Comment 4 Ian MacArthur 2006-11-24 17:04:26 UTC
I was just running through my open bugs and I see this one still marked as NEEDINFO against my name... 
Is there still more inout you need from me, or is the sample code and results I've posted so far enough?

Cheers,
-- 
Ian


Comment 5 Matěj Cepl 2007-04-06 14:56:22 UTC
Sorry for the delat, this bug somehow got lost -- is it still reproducible with
the current update of FC6? If yes, please attach your X server config file
(/etc/X11/xorg.conf) and X server log file (/var/log/Xorg.*.log) to the bug
report as individual uncompressed file attachments using the bugzilla file
attachment link below.

Could you please also try to run without any /etc/X11/xorg.conf whatsoever and
let X11 autodetect your display and video card? Attach to this bug
/var/log/Xorg.0.log from this attempt as well, please.

We will review this issue again once you've had a chance to attach this information.

Thanks in advance.


Comment 6 Ian MacArthur 2007-04-06 15:50:11 UTC
Sorry - I no longer have this box in x86_64 mode. I needed to to be working and stable, so I converted 
it to i386 mode and it works fine in that config. Same hardware etc., all running well.

I didn't think to configure for dual-boot (I was deperate to get the box working) and I'll need it in this 
sate for at least 4~6 weeks with my current work, so I can't easily get back to an x86-64 state anytime 
soon.

I take it that nobody else sees this then? It seemed robustly reproducible to me, anyway!

Thanks,
-- 
Ian


Comment 7 Matthias Clasen 2007-04-16 14:39:31 UTC
This is just a quirk of XGetWindowProperty. From the man page:

    If the returned format is 32, the returned data is represented
    as a long array and should be cast to that type to obtain the elements.